Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1028)

Unified Diff: webrtc/modules/video_coding/receiver.cc

Issue 2007743003: Add sender controlled playout delay limits (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@cleanup_rtp_hdr_extensions
Patch Set: Rename OnReceivedRtcpReport to OnReceivedRtcpReportBlocks Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/video_coding/receiver.cc
diff --git a/webrtc/modules/video_coding/receiver.cc b/webrtc/modules/video_coding/receiver.cc
index 1954df94e73356128b04330856ea6c70e5478308..b51669411953db47c001337ca3428c8b7836294a 100644
--- a/webrtc/modules/video_coding/receiver.cc
+++ b/webrtc/modules/video_coding/receiver.cc
@@ -144,15 +144,26 @@ VCMEncodedFrame* VCMReceiver::FrameForDecoding(uint16_t max_wait_time_ms,
bool prefer_late_decoding) {
const int64_t start_time_ms = clock_->TimeInMilliseconds();
uint32_t frame_timestamp = 0;
+ int min_playout_delay_ms = -1;
+ int max_playout_delay_ms = -1;
// Exhaust wait time to get a complete frame for decoding.
- bool found_frame =
- jitter_buffer_.NextCompleteTimestamp(max_wait_time_ms, &frame_timestamp);
+ VCMEncodedFrame* found_frame =
+ jitter_buffer_.NextCompleteFrame(max_wait_time_ms);
- if (!found_frame)
- found_frame = jitter_buffer_.NextMaybeIncompleteTimestamp(&frame_timestamp);
+ if (found_frame) {
+ 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 {
+ if (!jitter_buffer_.NextMaybeIncompleteTimestamp(&frame_timestamp))
+ return nullptr;
+ }
- if (!found_frame)
- return NULL;
+ if (min_playout_delay_ms >= 0)
+ timing_->set_min_playout_delay(min_playout_delay_ms);
+
+ if (max_playout_delay_ms >= 0)
+ timing_->set_max_playout_delay(max_playout_delay_ms);
// We have a frame - Set timing and render timestamp.
timing_->SetJitterDelay(jitter_buffer_.EstimatedJitterMs());

Powered by Google App Engine
This is Rietveld 408576698