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

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

Issue 2410903002: Set min and max rate on caller and on callee side. (Closed)
Patch Set: Respond to comments of the sun Created 4 years, 2 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 71803cbee38c845e1cf4afbfa90c15ca94f062e3..169ff38f558428efcb6e357d1e5e80ec1f0b1fcc 100644
--- a/webrtc/media/engine/webrtcvoiceengine.cc
+++ b/webrtc/media/engine/webrtcvoiceengine.cc
@@ -1171,38 +1171,16 @@ class WebRtcVoiceMediaChannel::WebRtcAudioSendStream
void RecreateAudioSendStream(const SendCodecSpec& send_codec_spec) {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
- if (stream_) {
- call_->DestroyAudioSendStream(stream_);
- stream_ = nullptr;
- }
config_.rtp.nack.rtp_history_ms =
send_codec_spec.nack_enabled ? kNackRtpHistoryMs : 0;
- RTC_DCHECK(!stream_);
- stream_ = call_->CreateAudioSendStream(config_);
- RTC_CHECK(stream_);
- UpdateSendState();
+ RecreateAudioSendStream();
}
void RecreateAudioSendStream(
const std::vector<webrtc::RtpExtension>& extensions) {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
- if (stream_) {
- call_->DestroyAudioSendStream(stream_);
- stream_ = nullptr;
- }
config_.rtp.extensions = extensions;
- if (webrtc::field_trial::FindFullName("WebRTC-AdaptAudioBitrate") ==
- "Enabled") {
- // TODO(mflodman): Keep testing this and set proper values.
- // Note: This is an early experiment currently only supported by Opus.
- config_.min_bitrate_kbps = kOpusMinBitrate;
- config_.max_bitrate_kbps = kOpusBitrateFb;
- }
-
- RTC_DCHECK(!stream_);
- stream_ = call_->CreateAudioSendStream(config_);
- RTC_CHECK(stream_);
- UpdateSendState();
+ RecreateAudioSendStream();
}
bool SendTelephoneEvent(int payload_type, int event, int duration_ms) {
@@ -1316,6 +1294,25 @@ class WebRtcVoiceMediaChannel::WebRtcAudioSendStream
}
}
+ void RecreateAudioSendStream() {
+ RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
+ if (stream_) {
+ call_->DestroyAudioSendStream(stream_);
+ stream_ = nullptr;
+ }
+ RTC_DCHECK(!stream_);
+ if (webrtc::field_trial::FindFullName("WebRTC-AdaptAudioBitrate") ==
+ "Enabled") {
+ // TODO(mflodman): Keep testing this and set proper values.
+ // Note: This is an early experiment currently only supported by Opus.
+ config_.min_bitrate_kbps = kOpusMinBitrate;
+ config_.max_bitrate_kbps = kOpusBitrateFb;
+ }
+ stream_ = call_->CreateAudioSendStream(config_);
+ RTC_CHECK(stream_);
+ UpdateSendState();
+ }
+
rtc::ThreadChecker worker_thread_checker_;
rtc::RaceChecker audio_capture_race_checker_;
webrtc::AudioTransport* const voe_audio_transport_ = nullptr;
« 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