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

Unified Diff: webrtc/pc/peerconnectionfactory.cc

Issue 2653343003: Add CreatePeerConnectionFactory overloads that take audio codec factory args (Closed)
Patch Set: Don't save the audio encoder factory, since it's just a fake Created 3 years, 11 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/pc/peerconnectionfactory.h ('k') | webrtc/pc/peerconnectioninterface_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/peerconnectionfactory.cc
diff --git a/webrtc/pc/peerconnectionfactory.cc b/webrtc/pc/peerconnectionfactory.cc
index 99a1daaa2e2ed9400771f98e2765abb890cb5890..16e9ff9ded49478b6e1908c57142e60c2f578226 100644
--- a/webrtc/pc/peerconnectionfactory.cc
+++ b/webrtc/pc/peerconnectionfactory.cc
@@ -36,10 +36,12 @@
namespace webrtc {
-rtc::scoped_refptr<PeerConnectionFactoryInterface>
-CreatePeerConnectionFactory() {
+rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory(
+ rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory,
+ rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory) {
rtc::scoped_refptr<PeerConnectionFactory> pc_factory(
- new rtc::RefCountedObject<PeerConnectionFactory>());
+ new rtc::RefCountedObject<PeerConnectionFactory>(audio_encoder_factory,
+ audio_decoder_factory));
RTC_CHECK(rtc::Thread::Current() == pc_factory->signaling_thread());
// The signaling thread is the current thread so we can
@@ -51,6 +53,27 @@ CreatePeerConnectionFactory() {
pc_factory);
}
+rtc::scoped_refptr<PeerConnectionFactoryInterface>
+CreatePeerConnectionFactory() {
+ return CreatePeerConnectionFactory(CreateBuiltinAudioEncoderFactory(),
+ CreateBuiltinAudioDecoderFactory());
+}
+
+rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory(
+ rtc::Thread* network_thread,
+ rtc::Thread* worker_thread,
+ rtc::Thread* signaling_thread,
+ AudioDeviceModule* default_adm,
+ rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory,
+ rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory,
+ cricket::WebRtcVideoEncoderFactory* video_encoder_factory,
+ cricket::WebRtcVideoDecoderFactory* video_decoder_factory) {
+ return CreatePeerConnectionFactoryWithAudioMixer(
+ network_thread, worker_thread, signaling_thread, default_adm,
+ audio_encoder_factory, audio_decoder_factory, video_encoder_factory,
+ video_decoder_factory, nullptr);
+}
+
rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory(
rtc::Thread* network_thread,
rtc::Thread* worker_thread,
@@ -63,35 +86,22 @@ rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory(
encoder_factory, decoder_factory, nullptr);
}
-PeerConnectionFactory::PeerConnectionFactory()
- : owns_ptrs_(true),
- wraps_current_thread_(false),
- network_thread_(rtc::Thread::CreateWithSocketServer().release()),
- worker_thread_(rtc::Thread::Create().release()),
- signaling_thread_(rtc::Thread::Current()),
- audio_decoder_factory_(CreateBuiltinAudioDecoderFactory()) {
- if (!signaling_thread_) {
- signaling_thread_ = rtc::ThreadManager::Instance()->WrapCurrentThread();
- wraps_current_thread_ = true;
- }
- network_thread_->Start();
- worker_thread_->Start();
-}
-
rtc::scoped_refptr<PeerConnectionFactoryInterface>
CreatePeerConnectionFactoryWithAudioMixer(
rtc::Thread* network_thread,
rtc::Thread* worker_thread,
rtc::Thread* signaling_thread,
AudioDeviceModule* default_adm,
- cricket::WebRtcVideoEncoderFactory* encoder_factory,
- cricket::WebRtcVideoDecoderFactory* decoder_factory,
+ rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory,
+ rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory,
+ cricket::WebRtcVideoEncoderFactory* video_encoder_factory,
+ cricket::WebRtcVideoDecoderFactory* video_decoder_factory,
rtc::scoped_refptr<AudioMixer> audio_mixer) {
rtc::scoped_refptr<PeerConnectionFactory> pc_factory(
new rtc::RefCountedObject<PeerConnectionFactory>(
network_thread, worker_thread, signaling_thread, default_adm,
- CreateBuiltinAudioDecoderFactory(), encoder_factory, decoder_factory,
- audio_mixer));
+ audio_encoder_factory, audio_decoder_factory, video_encoder_factory,
+ video_decoder_factory, audio_mixer));
// Call Initialize synchronously but make sure it is executed on
// |signaling_thread|.
@@ -105,13 +115,45 @@ CreatePeerConnectionFactoryWithAudioMixer(
return PeerConnectionFactoryProxy::Create(signaling_thread, pc_factory);
}
+rtc::scoped_refptr<PeerConnectionFactoryInterface>
+CreatePeerConnectionFactoryWithAudioMixer(
+ rtc::Thread* network_thread,
+ rtc::Thread* worker_thread,
+ rtc::Thread* signaling_thread,
+ AudioDeviceModule* default_adm,
+ cricket::WebRtcVideoEncoderFactory* encoder_factory,
+ cricket::WebRtcVideoDecoderFactory* decoder_factory,
+ rtc::scoped_refptr<AudioMixer> audio_mixer) {
+ return CreatePeerConnectionFactoryWithAudioMixer(
+ network_thread, worker_thread, signaling_thread, default_adm,
+ CreateBuiltinAudioEncoderFactory(), CreateBuiltinAudioDecoderFactory(),
+ encoder_factory, decoder_factory, audio_mixer);
+}
+
+PeerConnectionFactory::PeerConnectionFactory(
+ rtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory,
+ rtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory)
+ : owns_ptrs_(true),
+ wraps_current_thread_(false),
+ network_thread_(rtc::Thread::CreateWithSocketServer().release()),
+ worker_thread_(rtc::Thread::Create().release()),
+ signaling_thread_(rtc::Thread::Current()),
+ audio_decoder_factory_(audio_decoder_factory) {
+ if (!signaling_thread_) {
ossu 2017/01/30 13:58:02 Perhaps add a TODO or similar comment here, indica
kwiberg-webrtc 2017/01/30 20:55:25 Done.
+ signaling_thread_ = rtc::ThreadManager::Instance()->WrapCurrentThread();
+ wraps_current_thread_ = true;
+ }
+ network_thread_->Start();
+ worker_thread_->Start();
+}
+
PeerConnectionFactory::PeerConnectionFactory(
rtc::Thread* network_thread,
rtc::Thread* worker_thread,
rtc::Thread* signaling_thread,
AudioDeviceModule* default_adm,
- const rtc::scoped_refptr<webrtc::AudioDecoderFactory>&
- audio_decoder_factory,
+ rtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory,
+ rtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory,
cricket::WebRtcVideoEncoderFactory* video_encoder_factory,
cricket::WebRtcVideoDecoderFactory* video_decoder_factory,
rtc::scoped_refptr<AudioMixer> audio_mixer)
« no previous file with comments | « webrtc/pc/peerconnectionfactory.h ('k') | webrtc/pc/peerconnectioninterface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698