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

Unified Diff: webrtc/media/engine/webrtcvoiceengine.cc

Issue 2775483004: Set max bitrate for audio send stream based on RtpParameters. (Closed)
Patch Set: Created 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/webrtcvoiceengine.cc
diff --git a/webrtc/media/engine/webrtcvoiceengine.cc b/webrtc/media/engine/webrtcvoiceengine.cc
index 7c6d7940f685cd9e11aa4f90227b93582ccf6ce0..49ec50fdec5a9f951f831e6a0ff2e52f85a462b9 100644
--- a/webrtc/media/engine/webrtcvoiceengine.cc
+++ b/webrtc/media/engine/webrtcvoiceengine.cc
@@ -1388,7 +1388,14 @@ class WebRtcVoiceMediaChannel::WebRtcAudioSendStream
RTC_DCHECK(!stream_);
if (webrtc::field_trial::IsEnabled("WebRTC-Audio-SendSideBwe")) {
config_.min_bitrate_bps = kOpusMinBitrateBps;
- config_.max_bitrate_bps = kOpusBitrateFbBps;
+
+ // This means that when RtpParameters is reset, we may change the
+ // encoder's bit rate immediately (through call_->CreateAudioSendStream),
+ // meanwhile change the cap to the output of BWE.
+ // TODO(minyue): remove dependency on RtpParameters when the signaling to
+ // BWE is done through a dedicated API.
stefan-webrtc 2017/03/24 15:09:14 I think this is something that should be here even
minyue-webrtc 2017/03/24 21:13:59 right, I will remove this todo now.
+ config_.max_bitrate_bps = rtp_parameters_.encodings[0].max_bitrate_bps ?
+ *rtp_parameters_.encodings[0].max_bitrate_bps : kOpusBitrateFbBps;
// TODO(mflodman): Keep testing this and set proper values.
// Note: This is an early experiment currently only supported by Opus.
if (send_side_bwe_with_overhead_) {
@@ -1421,8 +1428,8 @@ class WebRtcVoiceMediaChannel::WebRtcAudioSendStream
int max_overhead_bps =
kOverheadPerPacket * 8 * 1000 / min_packet_size_ms;
- config_.min_bitrate_bps = kOpusMinBitrateBps + min_overhead_bps;
- config_.max_bitrate_bps = kOpusBitrateFbBps + max_overhead_bps;
+ config_.min_bitrate_bps += min_overhead_bps;
+ config_.max_bitrate_bps += max_overhead_bps;
minyue-webrtc 2017/03/24 21:13:59 I see a problem here. To make sure that the payloa
stefan-webrtc 2017/03/27 12:11:46 Sounds good to me. As long as the max BWE is set h
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698