Chromium Code Reviews

Unified Diff: webrtc/voice_engine/voe_base_impl.cc

Issue 1949533002: WIP: Move the creation of AudioCodecFactory into PeerConnectionFactory. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« webrtc/voice_engine/channel.cc ('K') | « webrtc/voice_engine/voe_base_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/voice_engine/voe_base_impl.cc
diff --git a/webrtc/voice_engine/voe_base_impl.cc b/webrtc/voice_engine/voe_base_impl.cc
index c9d5e178e9a984e3840baa2f5971b2e9582693b2..5f38e558da18443a086788e821b809da19e50cba 100644
--- a/webrtc/voice_engine/voe_base_impl.cc
+++ b/webrtc/voice_engine/voe_base_impl.cc
@@ -14,6 +14,7 @@
#include "webrtc/base/logging.h"
#include "webrtc/common.h"
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
+#include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h"
#include "webrtc/modules/audio_coding/include/audio_coding_module.h"
#include "webrtc/modules/audio_device/audio_device_impl.h"
#include "webrtc/modules/audio_processing/include/audio_processing.h"
@@ -212,7 +213,8 @@ int VoEBaseImpl::DeRegisterVoiceEngineObserver() {
}
int VoEBaseImpl::Init(AudioDeviceModule* external_adm,
- AudioProcessing* audioproc) {
+ AudioProcessing* audioproc,
+ std::shared_ptr<AudioDecoderFactory> decoder_factory) {
rtc::CritScope cs(shared_->crit_sec());
WebRtcSpl_Init();
if (shared_->statistics().Initialized()) {
@@ -375,6 +377,11 @@ int VoEBaseImpl::Init(AudioDeviceModule* external_adm,
}
#endif
+ if (decoder_factory)
+ decoder_factory_ = std::move(decoder_factory);
+ else
+ decoder_factory_ = CreateBuiltinAudioDecoderFactory();
+
return shared_->statistics().SetInitialized();
}
@@ -390,7 +397,8 @@ int VoEBaseImpl::CreateChannel() {
return -1;
}
- voe::ChannelOwner channel_owner = shared_->channel_manager().CreateChannel();
+ voe::ChannelOwner channel_owner =
+ shared_->channel_manager().CreateChannel(decoder_factory_);
return InitializeChannel(&channel_owner);
}
@@ -401,7 +409,7 @@ int VoEBaseImpl::CreateChannel(const Config& config) {
return -1;
}
voe::ChannelOwner channel_owner =
- shared_->channel_manager().CreateChannel(config);
+ shared_->channel_manager().CreateChannel(config, decoder_factory_);
return InitializeChannel(&channel_owner);
}
« webrtc/voice_engine/channel.cc ('K') | « webrtc/voice_engine/voe_base_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine