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

Unified Diff: media/cast/sender/audio_sender.cc

Issue 562653004: Cast: First stab at implementing adaptive latency (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 6 years, 3 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/cast_sender_impl.cc ('k') | media/cast/sender/frame_sender.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/sender/audio_sender.cc
diff --git a/media/cast/sender/audio_sender.cc b/media/cast/sender/audio_sender.cc
index e79be079ce5e7dc8756d34b3aa39101a646fc98f..4dc7de411ffec4acb37756fcbda1810461d4fa07 100644
--- a/media/cast/sender/audio_sender.cc
+++ b/media/cast/sender/audio_sender.cc
@@ -33,7 +33,8 @@ AudioSender::AudioSender(scoped_refptr<CastEnvironment> cast_environment,
audio_config.frequency,
audio_config.ssrc,
kAudioFrameRate * 2.0, // We lie to increase max outstanding frames.
- audio_config.target_playout_delay,
+ audio_config.min_playout_delay,
+ audio_config.max_playout_delay,
NewFixedCongestionControl(audio_config.bitrate)),
samples_in_encoder_(0),
weak_factory_(this) {
@@ -61,9 +62,11 @@ AudioSender::AudioSender(scoped_refptr<CastEnvironment> cast_environment,
transport_config.ssrc = audio_config.ssrc;
transport_config.feedback_ssrc = audio_config.incoming_feedback_ssrc;
transport_config.rtp_payload_type = audio_config.rtp_payload_type;
- // TODO(miu): AudioSender needs to be like VideoSender in providing an upper
- // limit on the number of in-flight frames.
- transport_config.stored_frames = max_unacked_frames_;
+ transport_config.stored_frames =
+ std::min(kMaxUnackedFrames,
+ 1 + static_cast<int>(max_playout_delay_ *
+ max_frame_rate_ /
+ base::TimeDelta::FromSeconds(1)));
transport_config.aes_key = audio_config.aes_key;
transport_config.aes_iv_mask = audio_config.aes_iv_mask;
« no previous file with comments | « media/cast/cast_sender_impl.cc ('k') | media/cast/sender/frame_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698