Niels Möller | be682d4 | 2018-03-27 08:31:45 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #include "api/video/encoded_frame.h" |
| 12 | |
Evan Shrubsole | d6cdf80 | 2022-03-02 15:13:55 +0100 | [diff] [blame] | 13 | #include "absl/types/optional.h" |
| 14 | |
Niels Möller | be682d4 | 2018-03-27 08:31:45 +0200 | [diff] [blame] | 15 | namespace webrtc { |
Niels Möller | be682d4 | 2018-03-27 08:31:45 +0200 | [diff] [blame] | 16 | |
Evan Shrubsole | e9126c1 | 2022-03-07 14:50:51 +0100 | [diff] [blame] | 17 | absl::optional<Timestamp> EncodedFrame::ReceivedTimestamp() const { |
| 18 | return ReceivedTime() >= 0 |
| 19 | ? absl::make_optional(Timestamp::Millis(ReceivedTime())) |
| 20 | : absl::nullopt; |
| 21 | } |
| 22 | |
Evan Shrubsole | d6cdf80 | 2022-03-02 15:13:55 +0100 | [diff] [blame] | 23 | absl::optional<Timestamp> EncodedFrame::RenderTimestamp() const { |
| 24 | return RenderTimeMs() >= 0 |
| 25 | ? absl::make_optional(Timestamp::Millis(RenderTimeMs())) |
| 26 | : absl::nullopt; |
| 27 | } |
| 28 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 29 | bool EncodedFrame::delayed_by_retransmission() const { |
Anton Bikineev | 7abf45f | 2022-01-23 22:22:59 +0100 | [diff] [blame] | 30 | return false; |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 31 | } |
Niels Möller | be682d4 | 2018-03-27 08:31:45 +0200 | [diff] [blame] | 32 | |
Niels Möller | be682d4 | 2018-03-27 08:31:45 +0200 | [diff] [blame] | 33 | } // namespace webrtc |