Index: talk/media/webrtc/webrtcvoiceengine.cc |
diff --git a/talk/media/webrtc/webrtcvoiceengine.cc b/talk/media/webrtc/webrtcvoiceengine.cc |
index c4f5f99c989b23c00e4866ee1f933a39fb007145..f71a1c90a6130187656d7536e6a22e7e75a7739b 100644 |
--- a/talk/media/webrtc/webrtcvoiceengine.cc |
+++ b/talk/media/webrtc/webrtcvoiceengine.cc |
@@ -592,10 +592,12 @@ rtc::scoped_refptr<webrtc::AudioState> |
return audio_state_; |
} |
-VoiceMediaChannel* WebRtcVoiceEngine::CreateChannel(webrtc::Call* call, |
- const AudioOptions& options) { |
+VoiceMediaChannel* WebRtcVoiceEngine::CreateChannel( |
+ webrtc::Call* call, |
+ const MediaChannelOptions& options, |
+ const AudioOptions& audio_options) { |
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
- return new WebRtcVoiceMediaChannel(this, options, call); |
+ return new WebRtcVoiceMediaChannel(this, options, audio_options, call); |
} |
bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) { |
@@ -1289,14 +1291,16 @@ class WebRtcVoiceMediaChannel::WebRtcAudioReceiveStream { |
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcAudioReceiveStream); |
}; |
-WebRtcVoiceMediaChannel::WebRtcVoiceMediaChannel(WebRtcVoiceEngine* engine, |
- const AudioOptions& options, |
- webrtc::Call* call) |
- : engine_(engine), call_(call) { |
+WebRtcVoiceMediaChannel::WebRtcVoiceMediaChannel( |
+ WebRtcVoiceEngine* engine, |
+ const MediaChannelOptions& options, |
+ const AudioOptions& audio_options, |
+ webrtc::Call* call) |
+ : VoiceMediaChannel(options), engine_(engine), call_(call) { |
LOG(LS_VERBOSE) << "WebRtcVoiceMediaChannel::WebRtcVoiceMediaChannel"; |
RTC_DCHECK(call); |
engine->RegisterChannel(this); |
- SetOptions(options); |
+ SetOptions(audio_options); |
} |
WebRtcVoiceMediaChannel::~WebRtcVoiceMediaChannel() { |
@@ -1314,6 +1318,10 @@ WebRtcVoiceMediaChannel::~WebRtcVoiceMediaChannel() { |
engine()->UnregisterChannel(this); |
} |
+rtc::DiffServCodePoint WebRtcVoiceMediaChannel::DscpValue() const { |
+ return kAudioDscpValue; |
+} |
+ |
bool WebRtcVoiceMediaChannel::SetSendParameters( |
const AudioSendParameters& params) { |
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
@@ -1378,9 +1386,6 @@ bool WebRtcVoiceMediaChannel::SetOptions(const AudioOptions& options) { |
LOG(LS_INFO) << "Setting voice channel options: " |
<< options.ToString(); |
- // Check if DSCP value is changed from previous. |
- bool dscp_option_changed = (options_.dscp != options.dscp); |
- |
// We retain all of the existing options, and apply the given ones |
// on top. This means there is no way to "clear" options such that |
// they go back to the engine default. |
@@ -1391,16 +1396,6 @@ bool WebRtcVoiceMediaChannel::SetOptions(const AudioOptions& options) { |
return false; |
} |
- if (dscp_option_changed) { |
- rtc::DiffServCodePoint dscp = rtc::DSCP_DEFAULT; |
- if (options_.dscp.value_or(false)) { |
- dscp = kAudioDscpValue; |
- } |
- if (MediaChannel::SetDscp(dscp) != 0) { |
- LOG(LS_WARNING) << "Failed to set DSCP settings for audio channel"; |
- } |
- } |
- |
// TODO(solenberg): Don't recreate unless options changed. |
for (auto& it : recv_streams_) { |
it.second->RecreateAudioReceiveStream( |