Index: webrtc/media/engine/webrtcvoiceengine.cc |
diff --git a/webrtc/media/engine/webrtcvoiceengine.cc b/webrtc/media/engine/webrtcvoiceengine.cc |
index 96f9ed70d403c6c464cc9b015f83190630a0b331..0a30d0c23ca0684a0eb86c6319bef2efd11497b0 100644 |
--- a/webrtc/media/engine/webrtcvoiceengine.cc |
+++ b/webrtc/media/engine/webrtcvoiceengine.cc |
@@ -277,10 +277,16 @@ void GetOpusConfig(const AudioCodec& codec, |
voe_codec->rate = GetOpusBitrate(codec, *max_playback_rate); |
} |
-webrtc::AudioState::Config MakeAudioStateConfig(VoEWrapper* voe_wrapper) { |
+webrtc::AudioState::Config MakeAudioStateConfig( |
+ VoEWrapper* voe_wrapper, |
+ rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer) { |
webrtc::AudioState::Config config; |
config.voice_engine = voe_wrapper->engine(); |
- config.audio_mixer = webrtc::AudioMixerImpl::Create(); |
+ if (audio_mixer) { |
+ config.audio_mixer = audio_mixer; |
+ } else { |
+ config.audio_mixer = webrtc::AudioMixerImpl::Create(); |
+ } |
return config; |
} |
@@ -540,14 +546,17 @@ bool WebRtcVoiceEngine::ToCodecInst(const AudioCodec& in, |
WebRtcVoiceEngine::WebRtcVoiceEngine( |
webrtc::AudioDeviceModule* adm, |
- const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory) |
- : WebRtcVoiceEngine(adm, decoder_factory, new VoEWrapper()) { |
- audio_state_ = webrtc::AudioState::Create(MakeAudioStateConfig(voe())); |
+ const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory, |
+ rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer) |
+ : WebRtcVoiceEngine(adm, decoder_factory, audio_mixer, new VoEWrapper()) { |
+ audio_state_ = |
+ webrtc::AudioState::Create(MakeAudioStateConfig(voe(), audio_mixer)); |
} |
WebRtcVoiceEngine::WebRtcVoiceEngine( |
webrtc::AudioDeviceModule* adm, |
const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory, |
+ rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer, |
VoEWrapper* voe_wrapper) |
: adm_(adm), decoder_factory_(decoder_factory), voe_wrapper_(voe_wrapper) { |
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |