Index: webrtc/media/engine/webrtcmediaengine.cc |
diff --git a/webrtc/media/engine/webrtcmediaengine.cc b/webrtc/media/engine/webrtcmediaengine.cc |
index 9b5fef2478f3e26805b9959774ca45928e079796..1d0e42616897de2ced761a2db8bbf33d8d3999c1 100644 |
--- a/webrtc/media/engine/webrtcmediaengine.cc |
+++ b/webrtc/media/engine/webrtcmediaengine.cc |
@@ -13,6 +13,7 @@ |
#include <algorithm> |
#include "webrtc/api/audio_codecs/builtin_audio_decoder_factory.h" |
+#include "webrtc/api/audio_codecs/builtin_audio_encoder_factory.h" |
#include "webrtc/media/engine/webrtcvoiceengine.h" |
#ifdef HAVE_WEBRTC_VIDEO |
@@ -31,6 +32,8 @@ class WebRtcMediaEngine2 |
#endif |
public: |
WebRtcMediaEngine2(webrtc::AudioDeviceModule* adm, |
+ const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& |
+ audio_encoder_factory, |
const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& |
audio_decoder_factory, |
WebRtcVideoEncoderFactory* video_encoder_factory, |
@@ -39,16 +42,18 @@ class WebRtcMediaEngine2 |
#ifdef HAVE_WEBRTC_VIDEO |
: CompositeMediaEngine<WebRtcVoiceEngine, WebRtcVideoEngine2>( |
adm, |
+ audio_encoder_factory, |
audio_decoder_factory, |
audio_mixer){ |
#else |
: CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine>( |
adm, |
+ audio_encoder_factory, |
audio_decoder_factory, |
audio_mixer) { |
#endif |
video_.SetExternalDecoderFactory(video_decoder_factory); |
- video_.SetExternalEncoderFactory(video_encoder_factory); |
+ video_.SetExternalEncoderFactory(video_encoder_factory); |
} |
}; |
@@ -56,14 +61,16 @@ class WebRtcMediaEngine2 |
cricket::MediaEngineInterface* CreateWebRtcMediaEngine( |
webrtc::AudioDeviceModule* adm, |
+ const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& |
+ audio_encoder_factory, |
const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& |
audio_decoder_factory, |
cricket::WebRtcVideoEncoderFactory* video_encoder_factory, |
cricket::WebRtcVideoDecoderFactory* video_decoder_factory, |
rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer) { |
- return new cricket::WebRtcMediaEngine2(adm, audio_decoder_factory, |
- video_encoder_factory, |
- video_decoder_factory, audio_mixer); |
+ return new cricket::WebRtcMediaEngine2( |
+ adm, audio_encoder_factory, audio_decoder_factory, video_encoder_factory, |
+ video_decoder_factory, audio_mixer); |
} |
void DestroyWebRtcMediaEngine(cricket::MediaEngineInterface* media_engine) { |
@@ -80,7 +87,8 @@ MediaEngineInterface* WebRtcMediaEngineFactory::Create( |
WebRtcVideoEncoderFactory* video_encoder_factory, |
WebRtcVideoDecoderFactory* video_decoder_factory) { |
return CreateWebRtcMediaEngine( |
- adm, webrtc::CreateBuiltinAudioDecoderFactory(), video_encoder_factory, |
+ adm, webrtc::CreateBuiltinAudioEncoderFactory(), |
+ webrtc::CreateBuiltinAudioDecoderFactory(), video_encoder_factory, |
video_decoder_factory, nullptr); |
} |
@@ -90,9 +98,9 @@ MediaEngineInterface* WebRtcMediaEngineFactory::Create( |
audio_decoder_factory, |
WebRtcVideoEncoderFactory* video_encoder_factory, |
WebRtcVideoDecoderFactory* video_decoder_factory) { |
- return CreateWebRtcMediaEngine(adm, audio_decoder_factory, |
- video_encoder_factory, video_decoder_factory, |
- nullptr); |
+ return CreateWebRtcMediaEngine( |
+ adm, webrtc::CreateBuiltinAudioEncoderFactory(), audio_decoder_factory, |
+ video_encoder_factory, video_decoder_factory, nullptr); |
} |
// Used by PeerConnectionFactory to create a media engine passed into |
@@ -104,9 +112,36 @@ MediaEngineInterface* WebRtcMediaEngineFactory::Create( |
WebRtcVideoEncoderFactory* video_encoder_factory, |
WebRtcVideoDecoderFactory* video_decoder_factory, |
rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer) { |
- return CreateWebRtcMediaEngine(adm, audio_decoder_factory, |
- video_encoder_factory, video_decoder_factory, |
- audio_mixer); |
+ return CreateWebRtcMediaEngine( |
+ adm, webrtc::CreateBuiltinAudioEncoderFactory(), audio_decoder_factory, |
+ video_encoder_factory, video_decoder_factory, audio_mixer); |
+} |
+ |
+MediaEngineInterface* WebRtcMediaEngineFactory::Create( |
+ webrtc::AudioDeviceModule* adm, |
+ const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& |
+ audio_encoder_factory, |
+ const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& |
+ audio_decoder_factory, |
+ WebRtcVideoEncoderFactory* video_encoder_factory, |
+ WebRtcVideoDecoderFactory* video_decoder_factory) { |
+ return CreateWebRtcMediaEngine(adm, audio_encoder_factory, |
+ audio_decoder_factory, video_encoder_factory, |
+ video_decoder_factory, nullptr); |
+} |
+ |
+MediaEngineInterface* WebRtcMediaEngineFactory::Create( |
+ webrtc::AudioDeviceModule* adm, |
+ const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& |
+ audio_encoder_factory, |
+ const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& |
+ audio_decoder_factory, |
+ WebRtcVideoEncoderFactory* video_encoder_factory, |
+ WebRtcVideoDecoderFactory* video_decoder_factory, |
+ rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer) { |
+ return CreateWebRtcMediaEngine(adm, audio_encoder_factory, |
+ audio_decoder_factory, video_encoder_factory, |
+ video_decoder_factory, audio_mixer); |
} |
namespace { |