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

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

Issue 1991233004: Moved creation of AudioDecoderFactory to inside PeerConnectionFactory. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@audio-decoder-factory-injections-3
Patch Set: Parental Advisory: Explicit Content Created 4 years, 6 months 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 95b08e71587e2aa970834b9c60b9fe41d9907d66..b78d73ad0b0ffa10f4f03a1b6a3bd6813dce02ad 100644
--- a/webrtc/media/engine/webrtcvoiceengine.cc
+++ b/webrtc/media/engine/webrtcvoiceengine.cc
@@ -520,14 +520,18 @@ bool WebRtcVoiceEngine::ToCodecInst(const AudioCodec& in,
return WebRtcVoiceCodecs::ToCodecInst(in, out);
}
-WebRtcVoiceEngine::WebRtcVoiceEngine(webrtc::AudioDeviceModule* adm)
- : WebRtcVoiceEngine(adm, new VoEWrapper()) {
+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()));
}
-WebRtcVoiceEngine::WebRtcVoiceEngine(webrtc::AudioDeviceModule* adm,
- VoEWrapper* voe_wrapper)
- : adm_(adm), voe_wrapper_(voe_wrapper) {
+WebRtcVoiceEngine::WebRtcVoiceEngine(
+ webrtc::AudioDeviceModule* adm,
+ const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory,
+ VoEWrapper* voe_wrapper)
+ : adm_(adm), decoder_factory_(decoder_factory), voe_wrapper_(voe_wrapper) {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
LOG(LS_INFO) << "WebRtcVoiceEngine::WebRtcVoiceEngine";
RTC_DCHECK(voe_wrapper);
@@ -547,7 +551,8 @@ WebRtcVoiceEngine::WebRtcVoiceEngine(webrtc::AudioDeviceModule* adm,
webrtc::Trace::SetTraceCallback(this);
webrtc::Trace::set_level_filter(kElevatedTraceFilter);
LOG(LS_INFO) << webrtc::VoiceEngine::GetVersionString();
- RTC_CHECK_EQ(0, voe_wrapper_->base()->Init(adm_.get()));
+ RTC_CHECK_EQ(0, voe_wrapper_->base()->Init(adm_.get(), nullptr,
+ decoder_factory_));
webrtc::Trace::set_level_filter(kDefaultTraceFilter);
// No ADM supplied? Get the default one from VoE.
@@ -1275,14 +1280,16 @@ class WebRtcVoiceMediaChannel::WebRtcAudioSendStream
class WebRtcVoiceMediaChannel::WebRtcAudioReceiveStream {
public:
- WebRtcAudioReceiveStream(int ch,
- uint32_t remote_ssrc,
- uint32_t local_ssrc,
- bool use_transport_cc,
- const std::string& sync_group,
- const std::vector<webrtc::RtpExtension>& extensions,
- webrtc::Call* call,
- webrtc::Transport* rtcp_send_transport)
+ WebRtcAudioReceiveStream(
+ int ch,
+ uint32_t remote_ssrc,
+ uint32_t local_ssrc,
+ bool use_transport_cc,
+ const std::string& sync_group,
+ const std::vector<webrtc::RtpExtension>& extensions,
+ webrtc::Call* call,
+ webrtc::Transport* rtcp_send_transport,
+ const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory)
: call_(call), config_() {
RTC_DCHECK_GE(ch, 0);
RTC_DCHECK(call);
@@ -1291,6 +1298,7 @@ class WebRtcVoiceMediaChannel::WebRtcAudioReceiveStream {
config_.rtcp_send_transport = rtcp_send_transport;
config_.voe_channel_id = ch;
config_.sync_group = sync_group;
+ config_.decoder_factory = decoder_factory;
RecreateAudioReceiveStream(use_transport_cc, extensions);
}
@@ -2168,7 +2176,8 @@ bool WebRtcVoiceMediaChannel::AddRecvStream(const StreamParams& sp) {
ssrc, new WebRtcAudioReceiveStream(channel, ssrc, receiver_reports_ssrc_,
recv_transport_cc_enabled_,
sp.sync_label, recv_rtp_extensions_,
- call_, this)));
+ call_, this,
+ engine()->decoder_factory_)));
SetNack(channel, send_codec_spec_.nack_enabled);
SetPlayout(channel, playout_);
« 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