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

Unified Diff: media/cast/video_sender/video_sender.cc

Issue 192843002: Cast:Adding signaling and infrastructure for adjustable delay (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 6 years, 9 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
« no previous file with comments | « media/cast/video_sender/video_sender.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/video_sender/video_sender.cc
diff --git a/media/cast/video_sender/video_sender.cc b/media/cast/video_sender/video_sender.cc
index 7e4f97f93bbd26d5b8d0cb4bdca5e33b175ef806..6f6c64902244d27bac9bbe2ab31cfc7785c4c960 100644
--- a/media/cast/video_sender/video_sender.cc
+++ b/media/cast/video_sender/video_sender.cc
@@ -117,9 +117,8 @@ VideoSender::VideoSender(
active_session_(false),
weak_factory_(this) {
max_unacked_frames_ =
- static_cast<uint8>(video_config.rtp_config.max_delay_ms *
- video_config.max_frame_rate / 1000) +
- 1;
+ 1 + static_cast<uint8>(video_config.rtp_config.max_delay_ms *
+ max_frame_rate_ / 1000);
VLOG(1) << "max_unacked_frames " << static_cast<int>(max_unacked_frames_);
DCHECK_GT(max_unacked_frames_, 0) << "Invalid argument";
@@ -382,6 +381,12 @@ void VideoSender::OnReceivedCastFeedback(const RtcpCastMessage& cast_feedback) {
base::TimeDelta max_rtt;
base::TimeTicks now = cast_environment_->Clock()->NowTicks();
+ // Update delay and max number of frames in flight based on the the new
+ // received target delay.
+ rtp_max_delay_ =
+ base::TimeDelta::FromMilliseconds(cast_feedback.target_delay_ms_);
+ max_unacked_frames_ = 1 + static_cast<uint8>(cast_feedback.target_delay_ms_ *
+ max_frame_rate_ / 1000);
if (rtcp_->Rtt(&rtt, &avg_rtt, &min_rtt, &max_rtt)) {
cast_environment_->Logging()->InsertGenericEvent(
now, kRttMs, rtt.InMilliseconds());
« no previous file with comments | « media/cast/video_sender/video_sender.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698