Revert "Add Timestamp accessor methods to the EncodedImage class."
This reverts commit f34d467b03da4f20a1d036a20966fcad43d2433f.
Reason for revert: Seems to break downstream project.
Original change's description:
> Add Timestamp accessor methods to the EncodedImage class.
>
> Bug: webrtc:9378
> Change-Id: I59bf14f631f92f0f4e05f60d4af25641a23a53f9
> Reviewed-on: https://webrtc-review.googlesource.com/82100
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23734}
TBR=brandtr@webrtc.org,nisse@webrtc.org,stefan@webrtc.org,philipel@webrtc.org
Change-Id: I3aa0c0119426886bc583c918aae862eb7f4b6b63
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9378
Reviewed-on: https://webrtc-review.googlesource.com/85600
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23739}
diff --git a/api/video/encoded_frame.cc b/api/video/encoded_frame.cc
index 26a794e..f9152b2 100644
--- a/api/video/encoded_frame.cc
+++ b/api/video/encoded_frame.cc
@@ -17,5 +17,13 @@
return 0;
}
+uint32_t EncodedFrame::Timestamp() const {
+ return timestamp;
+}
+
+void EncodedFrame::SetTimestamp(uint32_t rtp_timestamp) {
+ timestamp = rtp_timestamp;
+}
+
} // namespace video_coding
} // namespace webrtc
diff --git a/api/video/encoded_frame.h b/api/video/encoded_frame.h
index b8462c6..1b0a26a 100644
--- a/api/video/encoded_frame.h
+++ b/api/video/encoded_frame.h
@@ -58,6 +58,10 @@
virtual bool GetBitstream(uint8_t* destination) const = 0;
+ // The capture timestamp of this frame, using the 90 kHz RTP clock.
+ virtual uint32_t Timestamp() const;
+ virtual void SetTimestamp(uint32_t rtp_timestamp);
+
// When this frame was received.
virtual int64_t ReceivedTime() const = 0;
@@ -74,6 +78,7 @@
bool is_keyframe() const { return num_references == 0; }
VideoLayerFrameId id;
+ uint32_t timestamp = 0;
// TODO(philipel): Add simple modify/access functions to prevent adding too
// many |references|.
diff --git a/common_video/include/video_frame.h b/common_video/include/video_frame.h
index 7b85cc8..41c3919 100644
--- a/common_video/include/video_frame.h
+++ b/common_video/include/video_frame.h
@@ -37,14 +37,6 @@
EncodedImage(const EncodedImage&);
EncodedImage(uint8_t* buffer, size_t length, size_t size);
- // TODO(nisse): Change style to timestamp(), set_timestamp(), for consistency
- // with the VideoFrame class.
- // Set frame timestamp (90kHz).
- void SetTimestamp(uint32_t timestamp) { _timeStamp = timestamp; }
-
- // Get frame timestamp (90kHz).
- uint32_t Timestamp() const { return _timeStamp; }
-
void SetEncodeTime(int64_t encode_start_ms, int64_t encode_finish_ms);
uint32_t _encodedWidth = 0;
diff --git a/modules/video_coding/decoding_state.cc b/modules/video_coding/decoding_state.cc
index 1d54063..23bf668 100644
--- a/modules/video_coding/decoding_state.cc
+++ b/modules/video_coding/decoding_state.cc
@@ -58,7 +58,7 @@
assert(frame != NULL);
if (in_initial_state_)
return false;
- return !IsNewerTimestamp(frame->Timestamp(), time_stamp_);
+ return !IsNewerTimestamp(frame->TimeStamp(), time_stamp_);
}
bool VCMDecodingState::IsOldPacket(const VCMPacket* packet) const {
@@ -73,7 +73,7 @@
if (!UsingFlexibleMode(frame))
UpdateSyncState(frame);
sequence_num_ = static_cast<uint16_t>(frame->GetHighSeqNum());
- time_stamp_ = frame->Timestamp();
+ time_stamp_ = frame->TimeStamp();
picture_id_ = frame->PictureId();
temporal_id_ = frame->TemporalId();
tl0_pic_id_ = frame->Tl0PicId();
@@ -143,7 +143,7 @@
// Continuous empty packets or continuous frames can be dropped if we
// advance the sequence number.
sequence_num_ = frame->GetHighSeqNum();
- time_stamp_ = frame->Timestamp();
+ time_stamp_ = frame->TimeStamp();
return true;
}
return false;
diff --git a/modules/video_coding/encoded_frame.h b/modules/video_coding/encoded_frame.h
index aadfcdf..17c61d7 100644
--- a/modules/video_coding/encoded_frame.h
+++ b/modules/video_coding/encoded_frame.h
@@ -65,12 +65,10 @@
* Get frame length
*/
size_t Length() const { return _length; }
-
/**
- * Frame RTP timestamp (90kHz)
+ * Get frame timestamp (90kHz)
*/
- using EncodedImage::Timestamp;
- using EncodedImage::SetTimestamp;
+ uint32_t TimeStamp() const { return _timeStamp; }
/**
* Get render time in milliseconds
*/
diff --git a/modules/video_coding/frame_buffer2.cc b/modules/video_coding/frame_buffer2.cc
index 8bb241a..f13ed35 100644
--- a/modules/video_coding/frame_buffer2.cc
+++ b/modules/video_coding/frame_buffer2.cc
@@ -117,8 +117,7 @@
next_frame_it_ = frame_it;
if (frame->RenderTime() == -1)
- frame->SetRenderTime(
- timing_->RenderTimeMs(frame->Timestamp(), now_ms));
+ frame->SetRenderTime(timing_->RenderTimeMs(frame->timestamp, now_ms));
wait_ms = timing_->MaxWaitingTime(frame->RenderTime(), now_ms);
// This will cause the frame buffer to prefer high framerate rather
@@ -147,7 +146,7 @@
if (!frame->delayed_by_retransmission()) {
int64_t frame_delay;
- if (inter_frame_delay_.CalculateDelay(frame->Timestamp(), &frame_delay,
+ if (inter_frame_delay_.CalculateDelay(frame->timestamp, &frame_delay,
frame->ReceivedTime())) {
jitter_estimator_->UpdateEstimate(frame_delay, frame->size());
}
@@ -164,7 +163,7 @@
if (HasBadRenderTiming(*frame, now_ms)) {
jitter_estimator_->Reset();
timing_->Reset();
- frame->SetRenderTime(timing_->RenderTimeMs(frame->Timestamp(), now_ms));
+ frame->SetRenderTime(timing_->RenderTimeMs(frame->timestamp, now_ms));
}
UpdateJitterDelay();
@@ -178,17 +177,17 @@
const VideoLayerFrameId& frame_key = next_frame_it_->first;
const bool frame_is_higher_spatial_layer_of_last_decoded_frame =
- last_decoded_frame_timestamp_ == frame->Timestamp() &&
+ last_decoded_frame_timestamp_ == frame->timestamp &&
last_decoded_frame_key.picture_id == frame_key.picture_id &&
last_decoded_frame_key.spatial_layer < frame_key.spatial_layer;
- if (AheadOrAt(last_decoded_frame_timestamp_, frame->Timestamp()) &&
+ if (AheadOrAt(last_decoded_frame_timestamp_, frame->timestamp) &&
!frame_is_higher_spatial_layer_of_last_decoded_frame) {
// TODO(brandtr): Consider clearing the entire buffer when we hit
// these conditions.
RTC_LOG(LS_WARNING)
<< "Frame with (timestamp:picture_id:spatial_id) ("
- << frame->Timestamp() << ":" << frame->id.picture_id << ":"
+ << frame->timestamp << ":" << frame->id.picture_id << ":"
<< static_cast<int>(frame->id.spatial_layer) << ")"
<< " sent to decoder after frame with"
<< " (timestamp:picture_id:spatial_id) ("
@@ -199,7 +198,7 @@
}
AdvanceLastDecodedFrame(next_frame_it_);
- last_decoded_frame_timestamp_ = frame->Timestamp();
+ last_decoded_frame_timestamp_ = frame->timestamp;
*frame_out = std::move(frame);
return kFrameFound;
}
@@ -298,7 +297,7 @@
timing_->set_max_playout_delay(playout_delay.max_ms);
if (!frame.delayed_by_retransmission())
- timing_->IncomingTimestamp(frame.Timestamp(), frame.ReceivedTime());
+ timing_->IncomingTimestamp(frame.timestamp, frame.ReceivedTime());
}
int64_t FrameBuffer::InsertFrame(std::unique_ptr<EncodedFrame> frame) {
@@ -344,7 +343,7 @@
if (last_decoded_frame_it_ != frames_.end() &&
id <= last_decoded_frame_it_->first) {
- if (AheadOf(frame->Timestamp(), last_decoded_frame_timestamp_) &&
+ if (AheadOf(frame->timestamp, last_decoded_frame_timestamp_) &&
frame->is_keyframe()) {
// If this frame has a newer timestamp but an earlier picture id then we
// assume there has been a jump in the picture id due to some encoder
diff --git a/modules/video_coding/frame_buffer2_unittest.cc b/modules/video_coding/frame_buffer2_unittest.cc
index 357ba86..1378be5 100644
--- a/modules/video_coding/frame_buffer2_unittest.cc
+++ b/modules/video_coding/frame_buffer2_unittest.cc
@@ -90,6 +90,8 @@
public:
bool GetBitstream(uint8_t* destination) const override { return true; }
+ uint32_t Timestamp() const override { return timestamp; }
+
int64_t ReceivedTime() const override { return 0; }
int64_t RenderTime() const override { return _renderTimeMs; }
@@ -163,7 +165,7 @@
std::unique_ptr<FrameObjectFake> frame(new FrameObjectFake());
frame->id.picture_id = picture_id;
frame->id.spatial_layer = spatial_layer;
- frame->SetTimestamp(ts_ms * 90);
+ frame->timestamp = ts_ms * 90;
frame->num_references = references.size();
frame->inter_layer_predicted = inter_layer_predicted;
for (size_t r = 0; r < references.size(); ++r)
@@ -518,7 +520,7 @@
frame->SetSize(kFrameSize);
frame->id.picture_id = pid;
frame->id.spatial_layer = 0;
- frame->SetTimestamp(ts);
+ frame->timestamp = ts;
frame->num_references = 0;
frame->inter_layer_predicted = false;
diff --git a/modules/video_coding/frame_object.cc b/modules/video_coding/frame_object.cc
index 20e7565..a3fc0d1 100644
--- a/modules/video_coding/frame_object.cc
+++ b/modules/video_coding/frame_object.cc
@@ -26,6 +26,7 @@
: packet_buffer_(packet_buffer),
first_seq_num_(first_seq_num),
last_seq_num_(last_seq_num),
+ timestamp_(0),
received_time_(received_time),
times_nacked_(times_nacked) {
VCMPacket* first_packet = packet_buffer_->GetPacket(first_seq_num);
@@ -68,7 +69,7 @@
_encodedHeight = first_packet->height;
// EncodedFrame members
- SetTimestamp(first_packet->timestamp);
+ timestamp = first_packet->timestamp;
VCMPacket* last_packet = packet_buffer_->GetPacket(last_seq_num);
RTC_CHECK(last_packet);
@@ -139,6 +140,10 @@
return packet_buffer_->GetBitstream(*this, destination);
}
+uint32_t RtpFrameObject::Timestamp() const {
+ return timestamp_;
+}
+
int64_t RtpFrameObject::ReceivedTime() const {
return received_time_;
}
diff --git a/modules/video_coding/frame_object.h b/modules/video_coding/frame_object.h
index 6c6480a..8980984 100644
--- a/modules/video_coding/frame_object.h
+++ b/modules/video_coding/frame_object.h
@@ -37,6 +37,7 @@
enum FrameType frame_type() const;
VideoCodecType codec_type() const;
bool GetBitstream(uint8_t* destination) const override;
+ uint32_t Timestamp() const override;
int64_t ReceivedTime() const override;
int64_t RenderTime() const override;
bool delayed_by_retransmission() const override;
@@ -48,6 +49,7 @@
VideoCodecType codec_type_;
uint16_t first_seq_num_;
uint16_t last_seq_num_;
+ uint32_t timestamp_;
int64_t received_time_;
// Equal to times nacked of the packet with the highet times nacked
diff --git a/modules/video_coding/generic_decoder.cc b/modules/video_coding/generic_decoder.cc
index 44610ad..01500e7 100644
--- a/modules/video_coding/generic_decoder.cc
+++ b/modules/video_coding/generic_decoder.cc
@@ -225,7 +225,7 @@
} else {
_frameInfos[_nextFrameInfoIdx].content_type = _last_keyframe_content_type;
}
- _callback->Map(frame.Timestamp(), &_frameInfos[_nextFrameInfoIdx]);
+ _callback->Map(frame.TimeStamp(), &_frameInfos[_nextFrameInfoIdx]);
_nextFrameInfoIdx = (_nextFrameInfoIdx + 1) % kDecoderFrameMemoryLength;
int32_t ret = decoder_->Decode(frame.EncodedImage(), frame.MissingFrame(),
@@ -234,13 +234,13 @@
_callback->OnDecoderImplementationName(decoder_->ImplementationName());
if (ret < WEBRTC_VIDEO_CODEC_OK) {
RTC_LOG(LS_WARNING) << "Failed to decode frame with timestamp "
- << frame.Timestamp() << ", error code: " << ret;
- _callback->Pop(frame.Timestamp());
+ << frame.TimeStamp() << ", error code: " << ret;
+ _callback->Pop(frame.TimeStamp());
return ret;
} else if (ret == WEBRTC_VIDEO_CODEC_NO_OUTPUT ||
ret == WEBRTC_VIDEO_CODEC_REQUEST_SLI) {
// No output
- _callback->Pop(frame.Timestamp());
+ _callback->Pop(frame.TimeStamp());
}
return ret;
}
diff --git a/modules/video_coding/jitter_buffer.cc b/modules/video_coding/jitter_buffer.cc
index 0699e3b..5f45ece 100644
--- a/modules/video_coding/jitter_buffer.cc
+++ b/modules/video_coding/jitter_buffer.cc
@@ -54,7 +54,7 @@
}
void FrameList::InsertFrame(VCMFrameBuffer* frame) {
- insert(rbegin().base(), FrameListPair(frame->Timestamp(), frame));
+ insert(rbegin().base(), FrameListPair(frame->TimeStamp(), frame));
}
VCMFrameBuffer* FrameList::PopFrame(uint32_t timestamp) {
@@ -110,7 +110,7 @@
}
free_frames->push_back(oldest_frame);
TRACE_EVENT_INSTANT1("webrtc", "JB::OldOrEmptyFrameDropped", "timestamp",
- oldest_frame->Timestamp());
+ oldest_frame->TimeStamp());
erase(begin());
}
}
@@ -206,7 +206,7 @@
continue;
}
SsMap::iterator ss_it;
- if (Find(frame_it.second->Timestamp(), &ss_it)) {
+ if (Find(frame_it.second->TimeStamp(), &ss_it)) {
if (gof_idx >= ss_it->second.num_frames_in_gof) {
continue; // Assume corresponding SS not yet received.
}
@@ -522,7 +522,7 @@
}
}
- *timestamp = oldest_frame->Timestamp();
+ *timestamp = oldest_frame->TimeStamp();
return true;
}
@@ -558,7 +558,7 @@
// Wait for this one to get complete.
waiting_for_completion_.frame_size = frame->Length();
waiting_for_completion_.latest_packet_time = frame->LatestPacketTimeMs();
- waiting_for_completion_.timestamp = frame->Timestamp();
+ waiting_for_completion_.timestamp = frame->TimeStamp();
}
}
@@ -709,8 +709,8 @@
frame->InsertPacket(packet, now_ms, decode_error_mode_, frame_data);
if (previous_state != kStateComplete) {
- TRACE_EVENT_ASYNC_BEGIN1("webrtc", "Video", frame->Timestamp(), "timestamp",
- frame->Timestamp());
+ TRACE_EVENT_ASYNC_BEGIN1("webrtc", "Video", frame->TimeStamp(), "timestamp",
+ frame->TimeStamp());
}
if (buffer_state > 0) {
@@ -825,7 +825,7 @@
for (FrameList::const_iterator it = decodable_frames_.begin();
it != decodable_frames_.end(); ++it) {
VCMFrameBuffer* decodable_frame = it->second;
- if (IsNewerTimestamp(decodable_frame->Timestamp(), frame.Timestamp())) {
+ if (IsNewerTimestamp(decodable_frame->TimeStamp(), frame.TimeStamp())) {
break;
}
decoding_state.SetState(decodable_frame);
@@ -859,7 +859,7 @@
it != incomplete_frames_.end();) {
VCMFrameBuffer* frame = it->second;
if (IsNewerTimestamp(original_decoded_state.time_stamp(),
- frame->Timestamp())) {
+ frame->TimeStamp())) {
++it;
continue;
}
@@ -941,11 +941,11 @@
if (incomplete_frames_.empty()) {
return 0;
}
- uint32_t start_timestamp = incomplete_frames_.Front()->Timestamp();
+ uint32_t start_timestamp = incomplete_frames_.Front()->TimeStamp();
if (!decodable_frames_.empty()) {
- start_timestamp = decodable_frames_.Back()->Timestamp();
+ start_timestamp = decodable_frames_.Back()->TimeStamp();
}
- return incomplete_frames_.Back()->Timestamp() - start_timestamp;
+ return incomplete_frames_.Back()->TimeStamp() - start_timestamp;
}
uint16_t VCMJitterBuffer::EstimatedLowSequenceNumber(
@@ -1178,10 +1178,10 @@
incoming_frame_count_++;
if (frame.FrameType() == kVideoFrameKey) {
- TRACE_EVENT_ASYNC_STEP0("webrtc", "Video", frame.Timestamp(),
+ TRACE_EVENT_ASYNC_STEP0("webrtc", "Video", frame.TimeStamp(),
"KeyComplete");
} else {
- TRACE_EVENT_ASYNC_STEP0("webrtc", "Video", frame.Timestamp(),
+ TRACE_EVENT_ASYNC_STEP0("webrtc", "Video", frame.TimeStamp(),
"DeltaComplete");
}
@@ -1257,7 +1257,7 @@
}
// No retransmitted frames should be a part of the jitter
// estimate.
- UpdateJitterEstimate(frame.LatestPacketTimeMs(), frame.Timestamp(),
+ UpdateJitterEstimate(frame.LatestPacketTimeMs(), frame.TimeStamp(),
frame.Length(), incomplete_frame);
}
diff --git a/modules/video_coding/jitter_buffer_unittest.cc b/modules/video_coding/jitter_buffer_unittest.cc
index b40b8ba..71c17ea 100644
--- a/modules/video_coding/jitter_buffer_unittest.cc
+++ b/modules/video_coding/jitter_buffer_unittest.cc
@@ -250,7 +250,7 @@
VCMEncodedFrame* found_frame = jitter_buffer_->NextCompleteFrame(10);
if (!found_frame)
return nullptr;
- return jitter_buffer_->ExtractAndSetDecode(found_frame->Timestamp());
+ return jitter_buffer_->ExtractAndSetDecode(found_frame->TimeStamp());
}
VCMEncodedFrame* DecodeIncompleteFrame() {
@@ -405,7 +405,7 @@
return false;
VCMEncodedFrame* frame =
- jitter_buffer_->ExtractAndSetDecode(found_frame->Timestamp());
+ jitter_buffer_->ExtractAndSetDecode(found_frame->TimeStamp());
bool ret = (frame != NULL);
jitter_buffer_->ReleaseFrame(frame);
return ret;
@@ -952,12 +952,12 @@
EXPECT_EQ(kCompleteSession, jitter_buffer_->InsertPacket(*packet_, &re));
VCMEncodedFrame* frame_out = DecodeCompleteFrame();
- EXPECT_EQ(1000U, frame_out->Timestamp());
+ EXPECT_EQ(1000U, frame_out->TimeStamp());
EXPECT_EQ(kVideoFrameKey, frame_out->FrameType());
jitter_buffer_->ReleaseFrame(frame_out);
frame_out = DecodeCompleteFrame();
- EXPECT_EQ(13000U, frame_out->Timestamp());
+ EXPECT_EQ(13000U, frame_out->TimeStamp());
EXPECT_EQ(kVideoFrameDelta, frame_out->FrameType());
jitter_buffer_->ReleaseFrame(frame_out);
}
@@ -1014,7 +1014,7 @@
EXPECT_EQ(kCompleteSession, jitter_buffer_->InsertPacket(*packet_, &re));
VCMEncodedFrame* frame_out = DecodeCompleteFrame();
- EXPECT_EQ(3000U, frame_out->Timestamp());
+ EXPECT_EQ(3000U, frame_out->TimeStamp());
EXPECT_EQ(kVideoFrameKey, frame_out->FrameType());
EXPECT_EQ(0, frame_out->CodecSpecific()->codecSpecific.VP9.temporal_idx);
EXPECT_FALSE(
@@ -1022,14 +1022,14 @@
jitter_buffer_->ReleaseFrame(frame_out);
frame_out = DecodeCompleteFrame();
- EXPECT_EQ(6000U, frame_out->Timestamp());
+ EXPECT_EQ(6000U, frame_out->TimeStamp());
EXPECT_EQ(kVideoFrameDelta, frame_out->FrameType());
EXPECT_EQ(2, frame_out->CodecSpecific()->codecSpecific.VP9.temporal_idx);
EXPECT_TRUE(frame_out->CodecSpecific()->codecSpecific.VP9.temporal_up_switch);
jitter_buffer_->ReleaseFrame(frame_out);
frame_out = DecodeCompleteFrame();
- EXPECT_EQ(9000U, frame_out->Timestamp());
+ EXPECT_EQ(9000U, frame_out->TimeStamp());
EXPECT_EQ(kVideoFrameDelta, frame_out->FrameType());
EXPECT_EQ(1, frame_out->CodecSpecific()->codecSpecific.VP9.temporal_idx);
EXPECT_TRUE(frame_out->CodecSpecific()->codecSpecific.VP9.temporal_up_switch);
@@ -1105,7 +1105,7 @@
EXPECT_EQ(kCompleteSession, jitter_buffer_->InsertPacket(*packet_, &re));
VCMEncodedFrame* frame_out = DecodeCompleteFrame();
- EXPECT_EQ(3000U, frame_out->Timestamp());
+ EXPECT_EQ(3000U, frame_out->TimeStamp());
EXPECT_EQ(kVideoFrameKey, frame_out->FrameType());
EXPECT_EQ(0, frame_out->CodecSpecific()->codecSpecific.VP9.temporal_idx);
EXPECT_FALSE(
@@ -1113,7 +1113,7 @@
jitter_buffer_->ReleaseFrame(frame_out);
frame_out = DecodeCompleteFrame();
- EXPECT_EQ(6000U, frame_out->Timestamp());
+ EXPECT_EQ(6000U, frame_out->TimeStamp());
EXPECT_EQ(kVideoFrameDelta, frame_out->FrameType());
EXPECT_EQ(1, frame_out->CodecSpecific()->codecSpecific.VP9.temporal_idx);
EXPECT_TRUE(frame_out->CodecSpecific()->codecSpecific.VP9.temporal_up_switch);
@@ -1461,8 +1461,8 @@
uint32_t next_timestamp;
VCMEncodedFrame* frame = jitter_buffer_->NextCompleteFrame(0);
EXPECT_NE(frame, nullptr);
- EXPECT_EQ(packet_->timestamp, frame->Timestamp());
- frame = jitter_buffer_->ExtractAndSetDecode(frame->Timestamp());
+ EXPECT_EQ(packet_->timestamp, frame->TimeStamp());
+ frame = jitter_buffer_->ExtractAndSetDecode(frame->TimeStamp());
EXPECT_TRUE(frame != NULL);
jitter_buffer_->ReleaseFrame(frame);
@@ -1708,7 +1708,7 @@
jitter_buffer_->InsertPacket(*packet_, &retransmitted));
VCMEncodedFrame* frame_out = DecodeCompleteFrame();
- EXPECT_EQ(3000u, frame_out->Timestamp());
+ EXPECT_EQ(3000u, frame_out->TimeStamp());
CheckOutFrame(frame_out, size_, false);
EXPECT_EQ(kVideoFrameKey, frame_out->FrameType());
jitter_buffer_->ReleaseFrame(frame_out);
@@ -1743,7 +1743,7 @@
jitter_buffer_->InsertPacket(*packet_, &retransmitted));
VCMEncodedFrame* frame_out = DecodeCompleteFrame();
- EXPECT_EQ(timestamp_, frame_out->Timestamp());
+ EXPECT_EQ(timestamp_, frame_out->TimeStamp());
CheckOutFrame(frame_out, size_, false);
@@ -1853,13 +1853,13 @@
jitter_buffer_->InsertPacket(*packet_, &retransmitted));
VCMEncodedFrame* frame_out = DecodeCompleteFrame();
- EXPECT_EQ(0xffffff00, frame_out->Timestamp());
+ EXPECT_EQ(0xffffff00, frame_out->TimeStamp());
CheckOutFrame(frame_out, size_, false);
EXPECT_EQ(kVideoFrameKey, frame_out->FrameType());
jitter_buffer_->ReleaseFrame(frame_out);
VCMEncodedFrame* frame_out2 = DecodeCompleteFrame();
- EXPECT_EQ(2700u, frame_out2->Timestamp());
+ EXPECT_EQ(2700u, frame_out2->TimeStamp());
CheckOutFrame(frame_out2, size_, false);
EXPECT_EQ(kVideoFrameDelta, frame_out2->FrameType());
jitter_buffer_->ReleaseFrame(frame_out2);
@@ -1896,13 +1896,13 @@
jitter_buffer_->InsertPacket(*packet_, &retransmitted));
VCMEncodedFrame* frame_out = DecodeCompleteFrame();
- EXPECT_EQ(0xffffff00, frame_out->Timestamp());
+ EXPECT_EQ(0xffffff00, frame_out->TimeStamp());
CheckOutFrame(frame_out, size_, false);
EXPECT_EQ(kVideoFrameKey, frame_out->FrameType());
jitter_buffer_->ReleaseFrame(frame_out);
VCMEncodedFrame* frame_out2 = DecodeCompleteFrame();
- EXPECT_EQ(2700u, frame_out2->Timestamp());
+ EXPECT_EQ(2700u, frame_out2->TimeStamp());
CheckOutFrame(frame_out2, size_, false);
EXPECT_EQ(kVideoFrameDelta, frame_out2->FrameType());
jitter_buffer_->ReleaseFrame(frame_out2);
@@ -1997,7 +1997,7 @@
jitter_buffer_->InsertPacket(*packet_, &retransmitted));
VCMEncodedFrame* frame_out = DecodeCompleteFrame();
- EXPECT_EQ(first_key_frame_timestamp, frame_out->Timestamp());
+ EXPECT_EQ(first_key_frame_timestamp, frame_out->TimeStamp());
CheckOutFrame(frame_out, size_, false);
EXPECT_EQ(kVideoFrameKey, frame_out->FrameType());
jitter_buffer_->ReleaseFrame(frame_out);
@@ -2023,7 +2023,7 @@
VCMEncodedFrame* testFrame = DecodeIncompleteFrame();
// Timestamp should never be the last TS inserted.
if (testFrame != NULL) {
- EXPECT_TRUE(testFrame->Timestamp() < timestamp_);
+ EXPECT_TRUE(testFrame->TimeStamp() < timestamp_);
jitter_buffer_->ReleaseFrame(testFrame);
}
}
diff --git a/modules/video_coding/receiver.cc b/modules/video_coding/receiver.cc
index 4ed61da..a1eeded 100644
--- a/modules/video_coding/receiver.cc
+++ b/modules/video_coding/receiver.cc
@@ -140,7 +140,7 @@
jitter_buffer_.NextCompleteFrame(max_wait_time_ms);
if (found_frame) {
- frame_timestamp = found_frame->Timestamp();
+ frame_timestamp = found_frame->TimeStamp();
min_playout_delay_ms = found_frame->EncodedImage().playout_delay_.min_ms;
max_playout_delay_ms = found_frame->EncodedImage().playout_delay_.max_ms;
} else {
@@ -212,7 +212,7 @@
return NULL;
}
frame->SetRenderTime(render_time_ms);
- TRACE_EVENT_ASYNC_STEP1("webrtc", "Video", frame->Timestamp(), "SetRenderTS",
+ TRACE_EVENT_ASYNC_STEP1("webrtc", "Video", frame->TimeStamp(), "SetRenderTS",
"render_time", frame->RenderTimeMs());
if (!frame->Complete()) {
// Update stats for incomplete frames.
diff --git a/test/fuzzers/frame_buffer2_fuzzer.cc b/test/fuzzers/frame_buffer2_fuzzer.cc
index 2d58309..57f0c74 100644
--- a/test/fuzzers/frame_buffer2_fuzzer.cc
+++ b/test/fuzzers/frame_buffer2_fuzzer.cc
@@ -57,6 +57,7 @@
~FuzzyFrameObject() {}
bool GetBitstream(uint8_t* destination) const override { return false; }
+ uint32_t Timestamp() const override { return timestamp; }
int64_t ReceivedTime() const override { return 0; }
int64_t RenderTime() const override { return _renderTimeMs; }
};
@@ -75,7 +76,7 @@
std::unique_ptr<FuzzyFrameObject> frame(new FuzzyFrameObject());
frame->id.picture_id = reader.GetNum<int64_t>();
frame->id.spatial_layer = reader.GetNum<uint8_t>();
- frame->SetTimestamp(reader.GetNum<uint32_t>());
+ frame->timestamp = reader.GetNum<uint32_t>();
frame->num_references = reader.GetNum<uint8_t>() %
video_coding::EncodedFrame::kMaxFrameReferences;
diff --git a/video/video_stream_decoder_impl.cc b/video/video_stream_decoder_impl.cc
index ef2d969..19e75a8 100644
--- a/video/video_stream_decoder_impl.cc
+++ b/video/video_stream_decoder_impl.cc
@@ -186,7 +186,7 @@
}
int64_t decode_start_time_ms = rtc::TimeMillis();
- int64_t timestamp = frame->Timestamp();
+ int64_t timestamp = frame->timestamp;
int64_t render_time_us = frame->RenderTimeMs() * 1000;
bookkeeping_queue_.PostTask(
[this, decode_start_time_ms, timestamp, render_time_us]() {