Index: webrtc/media/webrtc/webrtcvoiceengine.cc |
diff --git a/webrtc/media/webrtc/webrtcvoiceengine.cc b/webrtc/media/webrtc/webrtcvoiceengine.cc |
index 82aa12ef0671919b9b5884401e1a18b97c68a434..5060605383972b15fcfb6cd47f346172dc40442a 100644 |
--- a/webrtc/media/webrtc/webrtcvoiceengine.cc |
+++ b/webrtc/media/webrtc/webrtcvoiceengine.cc |
@@ -649,10 +649,12 @@ rtc::scoped_refptr<webrtc::AudioState> |
return audio_state_; |
} |
-VoiceMediaChannel* WebRtcVoiceEngine::CreateChannel(webrtc::Call* call, |
+VoiceMediaChannel* WebRtcVoiceEngine::CreateChannel( |
+ webrtc::Call* call, |
+ const MediaConfig& config, |
const AudioOptions& options) { |
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
- return new WebRtcVoiceMediaChannel(this, options, call); |
+ return new WebRtcVoiceMediaChannel(this, config, options, call); |
} |
bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) { |
@@ -1365,10 +1367,12 @@ 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 MediaConfig& config, |
+ const AudioOptions& options, |
+ webrtc::Call* call) |
+ : VoiceMediaChannel(config), engine_(engine), call_(call) { |
LOG(LS_VERBOSE) << "WebRtcVoiceMediaChannel::WebRtcVoiceMediaChannel"; |
RTC_DCHECK(call); |
engine->RegisterChannel(this); |
@@ -1390,6 +1394,10 @@ WebRtcVoiceMediaChannel::~WebRtcVoiceMediaChannel() { |
engine()->UnregisterChannel(this); |
} |
+rtc::DiffServCodePoint WebRtcVoiceMediaChannel::PreferredDscp() const { |
+ return kAudioDscpValue; |
+} |
+ |
bool WebRtcVoiceMediaChannel::SetSendParameters( |
const AudioSendParameters& params) { |
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
@@ -1453,9 +1461,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. |
@@ -1465,17 +1470,6 @@ bool WebRtcVoiceMediaChannel::SetOptions(const AudioOptions& options) { |
"Failed to apply engine options during channel SetOptions."; |
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"; |
- } |
- } |
- |
LOG(LS_INFO) << "Set voice channel options. Current options: " |
<< options_.ToString(); |
return true; |