diff options
Diffstat (limited to 'api/video/video_frame.h')
-rw-r--r-- | api/video/video_frame.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/api/video/video_frame.h b/api/video/video_frame.h index a257a3209e..2608f9aa42 100644 --- a/api/video/video_frame.h +++ b/api/video/video_frame.h @@ -109,6 +109,8 @@ class RTC_EXPORT VideoFrame { Builder& set_timestamp_us(int64_t timestamp_us); Builder& set_capture_time_identifier( const absl::optional<Timestamp>& capture_time_identifier); + Builder& set_reference_time( + const absl::optional<Timestamp>& reference_time); Builder& set_timestamp_rtp(uint32_t timestamp_rtp); Builder& set_ntp_time_ms(int64_t ntp_time_ms); Builder& set_rotation(VideoRotation rotation); @@ -123,6 +125,7 @@ class RTC_EXPORT VideoFrame { rtc::scoped_refptr<webrtc::VideoFrameBuffer> video_frame_buffer_; int64_t timestamp_us_ = 0; absl::optional<Timestamp> capture_time_identifier_; + absl::optional<Timestamp> reference_time_; uint32_t timestamp_rtp_ = 0; int64_t ntp_time_ms_ = 0; VideoRotation rotation_ = kVideoRotation_0; @@ -177,6 +180,13 @@ class RTC_EXPORT VideoFrame { capture_time_identifier_ = capture_time_identifier; } + const absl::optional<Timestamp>& reference_time() const { + return reference_time_; + } + void set_reference_time(const absl::optional<Timestamp>& reference_time) { + reference_time_ = reference_time; + } + // Set frame timestamp (90kHz). void set_timestamp(uint32_t timestamp) { timestamp_rtp_ = timestamp; } @@ -274,6 +284,7 @@ class RTC_EXPORT VideoFrame { const rtc::scoped_refptr<VideoFrameBuffer>& buffer, int64_t timestamp_us, const absl::optional<Timestamp>& capture_time_identifier, + const absl::optional<Timestamp>& reference_time, uint32_t timestamp_rtp, int64_t ntp_time_ms, VideoRotation rotation, @@ -289,6 +300,11 @@ class RTC_EXPORT VideoFrame { int64_t ntp_time_ms_; int64_t timestamp_us_; absl::optional<Timestamp> capture_time_identifier_; + // Contains a monotonically increasing clock time and represents the time + // when the frame was captured. Not all platforms provide the "true" sample + // capture time in |reference_time| but might instead use a somewhat delayed + // (by the time it took to capture the frame) version of it. + absl::optional<Timestamp> reference_time_; VideoRotation rotation_; absl::optional<ColorSpace> color_space_; // Contains parameters that affect have the frame should be rendered. |