From 21bccae341e09c5da2ab9089de820e6e625697d3 Mon Sep 17 00:00:00 2001 From: Minyue Li Date: Mon, 9 Mar 2020 13:28:43 +0100 Subject: [PATCH] Add NtpTimeMs as a method in EncodedImage. Bug: b/151082828 Change-Id: Idaa6848f952f9cc9458899680d19ddf338a3ace1 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170044 Commit-Queue: Minyue Li Reviewed-by: Rasmus Brandt Reviewed-by: Niels Moller Cr-Commit-Position: refs/heads/master@{#30729} --- api/video/encoded_image.h | 3 +++ modules/video_coding/encoded_frame.h | 1 + 2 files changed, 4 insertions(+) diff --git a/api/video/encoded_image.h b/api/video/encoded_image.h index b375d4825c..25f83c7cf3 100644 --- a/api/video/encoded_image.h +++ b/api/video/encoded_image.h @@ -94,6 +94,8 @@ class RTC_EXPORT EncodedImage { void SetEncodeTime(int64_t encode_start_ms, int64_t encode_finish_ms); + int64_t NtpTimeMs() const { return ntp_time_ms_; } + absl::optional SpatialIndex() const { return spatial_index_; } void SetSpatialIndex(absl::optional spatial_index) { RTC_DCHECK_GE(spatial_index.value_or(0), 0); @@ -184,6 +186,7 @@ class RTC_EXPORT EncodedImage { uint32_t _encodedWidth = 0; uint32_t _encodedHeight = 0; // NTP time of the capture time in local timebase in milliseconds. + // TODO(minyue): make this member private. int64_t ntp_time_ms_ = 0; int64_t capture_time_ms_ = 0; VideoFrameType _frameType = VideoFrameType::kVideoFrameDelta; diff --git a/modules/video_coding/encoded_frame.h b/modules/video_coding/encoded_frame.h index 2ca02632ce..84b8c71e32 100644 --- a/modules/video_coding/encoded_frame.h +++ b/modules/video_coding/encoded_frame.h @@ -56,6 +56,7 @@ class RTC_EXPORT VCMEncodedFrame : protected EncodedImage { using EncodedImage::ColorSpace; using EncodedImage::data; using EncodedImage::GetEncodedData; + using EncodedImage::NtpTimeMs; using EncodedImage::PacketInfos; using EncodedImage::Retain; using EncodedImage::set_size;