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 <minyue@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30729}
This commit is contained in:
Minyue Li 2020-03-09 13:28:43 +01:00 committed by Commit Bot
parent 4e1d6ce384
commit 21bccae341
2 changed files with 4 additions and 0 deletions

View file

@ -94,6 +94,8 @@ class RTC_EXPORT EncodedImage {
void SetEncodeTime(int64_t encode_start_ms, int64_t encode_finish_ms); void SetEncodeTime(int64_t encode_start_ms, int64_t encode_finish_ms);
int64_t NtpTimeMs() const { return ntp_time_ms_; }
absl::optional<int> SpatialIndex() const { return spatial_index_; } absl::optional<int> SpatialIndex() const { return spatial_index_; }
void SetSpatialIndex(absl::optional<int> spatial_index) { void SetSpatialIndex(absl::optional<int> spatial_index) {
RTC_DCHECK_GE(spatial_index.value_or(0), 0); RTC_DCHECK_GE(spatial_index.value_or(0), 0);
@ -184,6 +186,7 @@ class RTC_EXPORT EncodedImage {
uint32_t _encodedWidth = 0; uint32_t _encodedWidth = 0;
uint32_t _encodedHeight = 0; uint32_t _encodedHeight = 0;
// NTP time of the capture time in local timebase in milliseconds. // 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 ntp_time_ms_ = 0;
int64_t capture_time_ms_ = 0; int64_t capture_time_ms_ = 0;
VideoFrameType _frameType = VideoFrameType::kVideoFrameDelta; VideoFrameType _frameType = VideoFrameType::kVideoFrameDelta;

View file

@ -56,6 +56,7 @@ class RTC_EXPORT VCMEncodedFrame : protected EncodedImage {
using EncodedImage::ColorSpace; using EncodedImage::ColorSpace;
using EncodedImage::data; using EncodedImage::data;
using EncodedImage::GetEncodedData; using EncodedImage::GetEncodedData;
using EncodedImage::NtpTimeMs;
using EncodedImage::PacketInfos; using EncodedImage::PacketInfos;
using EncodedImage::Retain; using EncodedImage::Retain;
using EncodedImage::set_size; using EncodedImage::set_size;