xref: /aosp_15_r20/external/webrtc/api/video/encoded_frame.cc (revision d9f758449e529ab9291ac668be2861e7a55c2422)
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 
13 #include "absl/types/optional.h"
14 
15 namespace webrtc {
16 
ReceivedTimestamp() const17 absl::optional<Timestamp> EncodedFrame::ReceivedTimestamp() const {
18   return ReceivedTime() >= 0
19              ? absl::make_optional(Timestamp::Millis(ReceivedTime()))
20              : absl::nullopt;
21 }
22 
RenderTimestamp() const23 absl::optional<Timestamp> EncodedFrame::RenderTimestamp() const {
24   return RenderTimeMs() >= 0
25              ? absl::make_optional(Timestamp::Millis(RenderTimeMs()))
26              : absl::nullopt;
27 }
28 
delayed_by_retransmission() const29 bool EncodedFrame::delayed_by_retransmission() const {
30   return false;
31 }
32 
33 }  // namespace webrtc
34