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

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

Issue 2539213003: Support external audio mixer. (Closed)
Patch Set: try to fix OSX build issue Created 4 years 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 | « webrtc/media/engine/webrtcvoiceengine.h ('k') | webrtc/media/engine/webrtcvoiceengine_unittest.cc » ('j') | 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 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());
« no previous file with comments | « webrtc/media/engine/webrtcvoiceengine.h ('k') | webrtc/media/engine/webrtcvoiceengine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698