Propagate base minimum delay from video jitter buffer to webrtc/api.
On api level two methods were added to api/media_stream_interface.cc on VideoSourceInterface,
GetLatency and SetLatency. Latency is measured in seconds, delay in milliseconds but both describes
the same concept.
Bug: webrtc:10287
Change-Id: Ib8dc62a4d73f63fab7e10b82c716096ee6199957
Reviewed-on: https://webrtc-review.googlesource.com/c/123482
Commit-Queue: Ruslan Burakov <kuddai@google.com>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26877}
diff --git a/modules/video_coding/frame_buffer2.cc b/modules/video_coding/frame_buffer2.cc
index 6401117..e4def86 100644
--- a/modules/video_coding/frame_buffer2.cc
+++ b/modules/video_coding/frame_buffer2.cc
@@ -347,19 +347,6 @@
return true;
}
-void FrameBuffer::UpdatePlayoutDelays(const EncodedFrame& frame) {
- TRACE_EVENT0("webrtc", "FrameBuffer::UpdatePlayoutDelays");
- PlayoutDelay playout_delay = frame.EncodedImage().playout_delay_;
- if (playout_delay.min_ms >= 0)
- timing_->set_min_playout_delay(playout_delay.min_ms);
-
- if (playout_delay.max_ms >= 0)
- timing_->set_max_playout_delay(playout_delay.max_ms);
-
- if (!frame.delayed_by_retransmission())
- timing_->IncomingTimestamp(frame.Timestamp(), frame.ReceivedTime());
-}
-
int64_t FrameBuffer::InsertFrame(std::unique_ptr<EncodedFrame> frame) {
TRACE_EVENT0("webrtc", "FrameBuffer::InsertFrame");
RTC_DCHECK(frame);
@@ -449,7 +436,9 @@
if (!UpdateFrameInfoWithIncomingFrame(*frame, info))
return last_continuous_picture_id;
- UpdatePlayoutDelays(*frame);
+
+ if (!frame->delayed_by_retransmission())
+ timing_->IncomingTimestamp(frame->Timestamp(), frame->ReceivedTime());
info->second.frame = std::move(frame);
diff --git a/modules/video_coding/frame_buffer2.h b/modules/video_coding/frame_buffer2.h
index c71c19f..2421c36 100644
--- a/modules/video_coding/frame_buffer2.h
+++ b/modules/video_coding/frame_buffer2.h
@@ -118,11 +118,6 @@
// Check that the references of |frame| are valid.
bool ValidReferences(const EncodedFrame& frame) const;
- // Updates the minimal and maximal playout delays
- // depending on the frame.
- void UpdatePlayoutDelays(const EncodedFrame& frame)
- RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
-
// Update all directly dependent and indirectly dependent frames and mark
// them as continuous if all their references has been fulfilled.
void PropagateContinuity(FrameMap::iterator start)
diff --git a/modules/video_coding/frame_buffer2_unittest.cc b/modules/video_coding/frame_buffer2_unittest.cc
index 94a5551..7dc8cb2 100644
--- a/modules/video_coding/frame_buffer2_unittest.cc
+++ b/modules/video_coding/frame_buffer2_unittest.cc
@@ -271,16 +271,6 @@
CheckFrame(0, pid, 1);
}
-TEST_F(TestFrameBuffer2, SetPlayoutDelay) {
- const PlayoutDelay kPlayoutDelayMs = {123, 321};
- std::unique_ptr<FrameObjectFake> test_frame(new FrameObjectFake());
- test_frame->id.picture_id = 0;
- test_frame->SetPlayoutDelay(kPlayoutDelayMs);
- buffer_->InsertFrame(std::move(test_frame));
- EXPECT_EQ(kPlayoutDelayMs.min_ms, timing_.min_playout_delay());
- EXPECT_EQ(kPlayoutDelayMs.max_ms, timing_.max_playout_delay());
-}
-
TEST_F(TestFrameBuffer2, ZeroPlayoutDelay) {
VCMTiming timing(&clock_);
buffer_.reset(