From 1b0eae3c81aaa741a7cc076c92cd13151d43618e Mon Sep 17 00:00:00 2001 From: Karl Wiberg Date: Tue, 17 Oct 2017 14:48:54 +0200 Subject: [PATCH] Don't call deprecated CreatePeerConnectionFactory() overloads They're about to be removed. BUG=webrtc:8396 Change-Id: Ie9a45f4c0dccb4414d2a2f939aa5f142edc6e4b6 Reviewed-on: https://webrtc-review.googlesource.com/12280 Reviewed-by: Taylor Brandstetter Commit-Queue: Karl Wiberg Cr-Commit-Position: refs/heads/master@{#20328} --- examples/BUILD.gn | 2 ++ examples/peerconnection/client/conductor.cc | 6 +++++- pc/peerconnection_crypto_unittest.cc | 5 ++++- pc/peerconnection_ice_unittest.cc | 5 ++++- pc/peerconnection_integrationtest.cc | 5 ++++- pc/peerconnection_rtp_unittest.cc | 7 +++++-- pc/peerconnectionfactory_unittest.cc | 10 ++++++++-- pc/peerconnectioninterface_unittest.cc | 12 ++++++++---- 8 files changed, 40 insertions(+), 12 deletions(-) diff --git a/examples/BUILD.gn b/examples/BUILD.gn index ae6bdb7f94..0041d04876 100644 --- a/examples/BUILD.gn +++ b/examples/BUILD.gn @@ -540,6 +540,8 @@ if (is_linux || is_win) { deps += [ "../api:libjingle_peerconnection_test_api", "../api:video_frame_api", + "../api/audio_codecs:builtin_audio_decoder_factory", + "../api/audio_codecs:builtin_audio_encoder_factory", "../media:rtc_media", "../modules/video_capture:video_capture_module", "../pc:libjingle_peerconnection", diff --git a/examples/peerconnection/client/conductor.cc b/examples/peerconnection/client/conductor.cc index 90feed8f0a..3e3bfdab9d 100644 --- a/examples/peerconnection/client/conductor.cc +++ b/examples/peerconnection/client/conductor.cc @@ -14,6 +14,8 @@ #include #include +#include "api/audio_codecs/builtin_audio_decoder_factory.h" +#include "api/audio_codecs/builtin_audio_encoder_factory.h" #include "api/test/fakeconstraints.h" #include "examples/peerconnection/client/defaults.h" #include "media/engine/webrtcvideocapturerfactory.h" @@ -79,7 +81,9 @@ bool Conductor::InitializePeerConnection() { RTC_DCHECK(peer_connection_factory_.get() == NULL); RTC_DCHECK(peer_connection_.get() == NULL); - peer_connection_factory_ = webrtc::CreatePeerConnectionFactory(); + peer_connection_factory_ = webrtc::CreatePeerConnectionFactory( + webrtc::CreateBuiltinAudioEncoderFactory(), + webrtc::CreateBuiltinAudioDecoderFactory()); if (!peer_connection_factory_.get()) { main_wnd_->MessageBox("Error", diff --git a/pc/peerconnection_crypto_unittest.cc b/pc/peerconnection_crypto_unittest.cc index 0f5499509b..081e11ac6e 100644 --- a/pc/peerconnection_crypto_unittest.cc +++ b/pc/peerconnection_crypto_unittest.cc @@ -8,6 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include "api/audio_codecs/builtin_audio_decoder_factory.h" +#include "api/audio_codecs/builtin_audio_encoder_factory.h" #include "p2p/base/fakeportallocator.h" #include "pc/mediasession.h" #include "pc/peerconnectionwrapper.h" @@ -40,7 +42,8 @@ class PeerConnectionCryptoUnitTest : public ::testing::Test { #endif pc_factory_ = CreatePeerConnectionFactory( rtc::Thread::Current(), rtc::Thread::Current(), rtc::Thread::Current(), - FakeAudioCaptureModule::Create(), nullptr, nullptr); + FakeAudioCaptureModule::Create(), CreateBuiltinAudioEncoderFactory(), + CreateBuiltinAudioDecoderFactory(), nullptr, nullptr); } WrapperPtr CreatePeerConnection(const RTCConfiguration& config) { diff --git a/pc/peerconnection_ice_unittest.cc b/pc/peerconnection_ice_unittest.cc index 3a1950d900..088001841d 100644 --- a/pc/peerconnection_ice_unittest.cc +++ b/pc/peerconnection_ice_unittest.cc @@ -17,6 +17,8 @@ #ifdef WEBRTC_ANDROID #include "pc/test/androidtestinitializer.h" #endif +#include "api/audio_codecs/builtin_audio_decoder_factory.h" +#include "api/audio_codecs/builtin_audio_encoder_factory.h" #include "pc/test/fakeaudiocapturemodule.h" #include "rtc_base/fakenetwork.h" #include "rtc_base/gunit.h" @@ -82,7 +84,8 @@ class PeerConnectionIceUnitTest : public ::testing::Test { #endif pc_factory_ = CreatePeerConnectionFactory( rtc::Thread::Current(), rtc::Thread::Current(), rtc::Thread::Current(), - FakeAudioCaptureModule::Create(), nullptr, nullptr); + FakeAudioCaptureModule::Create(), CreateBuiltinAudioEncoderFactory(), + CreateBuiltinAudioDecoderFactory(), nullptr, nullptr); } WrapperPtr CreatePeerConnection() { diff --git a/pc/peerconnection_integrationtest.cc b/pc/peerconnection_integrationtest.cc index 21701cedde..9453567cb0 100644 --- a/pc/peerconnection_integrationtest.cc +++ b/pc/peerconnection_integrationtest.cc @@ -22,6 +22,8 @@ #include #include +#include "api/audio_codecs/builtin_audio_decoder_factory.h" +#include "api/audio_codecs/builtin_audio_encoder_factory.h" #include "api/fakemetricsobserver.h" #include "api/mediastreaminterface.h" #include "api/peerconnectioninterface.h" @@ -588,7 +590,8 @@ class PeerConnectionWrapper : public webrtc::PeerConnectionObserver, rtc::Thread* const signaling_thread = rtc::Thread::Current(); peer_connection_factory_ = webrtc::CreatePeerConnectionFactory( network_thread, worker_thread, signaling_thread, - fake_audio_capture_module_, fake_video_encoder_factory_, + fake_audio_capture_module_, webrtc::CreateBuiltinAudioEncoderFactory(), + webrtc::CreateBuiltinAudioDecoderFactory(), fake_video_encoder_factory_, fake_video_decoder_factory_); if (!peer_connection_factory_) { return false; diff --git a/pc/peerconnection_rtp_unittest.cc b/pc/peerconnection_rtp_unittest.cc index 38ba5fbd67..0261b1a36f 100644 --- a/pc/peerconnection_rtp_unittest.cc +++ b/pc/peerconnection_rtp_unittest.cc @@ -11,6 +11,8 @@ #include #include +#include "api/audio_codecs/builtin_audio_decoder_factory.h" +#include "api/audio_codecs/builtin_audio_encoder_factory.h" #include "api/jsep.h" #include "api/mediastreaminterface.h" #include "api/peerconnectioninterface.h" @@ -34,12 +36,13 @@ namespace { class PeerConnectionRtpTest : public testing::Test { public: PeerConnectionRtpTest() - : - pc_factory_(webrtc::CreatePeerConnectionFactory( + : pc_factory_(webrtc::CreatePeerConnectionFactory( rtc::Thread::Current(), rtc::Thread::Current(), rtc::Thread::Current(), FakeAudioCaptureModule::Create(), + webrtc::CreateBuiltinAudioEncoderFactory(), + webrtc::CreateBuiltinAudioDecoderFactory(), nullptr, nullptr)) {} diff --git a/pc/peerconnectionfactory_unittest.cc b/pc/peerconnectionfactory_unittest.cc index 59f6cde707..6fba8fa6dd 100644 --- a/pc/peerconnectionfactory_unittest.cc +++ b/pc/peerconnectionfactory_unittest.cc @@ -12,6 +12,8 @@ #include #include +#include "api/audio_codecs/builtin_audio_decoder_factory.h" +#include "api/audio_codecs/builtin_audio_encoder_factory.h" #include "api/mediastreaminterface.h" #include "media/base/fakevideocapturer.h" #include "p2p/base/fakeportallocator.h" @@ -91,7 +93,9 @@ class PeerConnectionFactoryTest : public testing::Test { // parallel. factory_ = webrtc::CreatePeerConnectionFactory( rtc::Thread::Current(), rtc::Thread::Current(), - FakeAudioCaptureModule::Create(), nullptr, nullptr); + FakeAudioCaptureModule::Create(), + webrtc::CreateBuiltinAudioEncoderFactory(), + webrtc::CreateBuiltinAudioDecoderFactory(), nullptr, nullptr); ASSERT_TRUE(factory_.get() != NULL); port_allocator_.reset( @@ -141,7 +145,9 @@ TEST(PeerConnectionFactoryTestInternal, DISABLED_CreatePCUsingInternalModules) { #endif rtc::scoped_refptr factory( - webrtc::CreatePeerConnectionFactory()); + webrtc::CreatePeerConnectionFactory( + webrtc::CreateBuiltinAudioEncoderFactory(), + webrtc::CreateBuiltinAudioDecoderFactory())); NullPeerConnectionObserver observer; webrtc::PeerConnectionInterface::RTCConfiguration config; diff --git a/pc/peerconnectioninterface_unittest.cc b/pc/peerconnectioninterface_unittest.cc index 084126b2ee..99f3301f82 100644 --- a/pc/peerconnectioninterface_unittest.cc +++ b/pc/peerconnectioninterface_unittest.cc @@ -608,7 +608,8 @@ class PeerConnectionInterfaceTest : public testing::Test { fake_audio_capture_module_ = FakeAudioCaptureModule::Create(); pc_factory_ = webrtc::CreatePeerConnectionFactory( rtc::Thread::Current(), rtc::Thread::Current(), rtc::Thread::Current(), - fake_audio_capture_module_, nullptr, nullptr); + fake_audio_capture_module_, webrtc::CreateBuiltinAudioEncoderFactory(), + webrtc::CreateBuiltinAudioDecoderFactory(), nullptr, nullptr); ASSERT_TRUE(pc_factory_); pc_factory_for_test_ = PeerConnectionFactoryForTest::CreatePeerConnectionFactoryForTest(); @@ -1265,8 +1266,9 @@ TEST_F(PeerConnectionInterfaceTest, rtc::scoped_refptr pc_factory( webrtc::CreatePeerConnectionFactory( rtc::Thread::Current(), rtc::Thread::Current(), - rtc::Thread::Current(), fake_audio_capture_module_, nullptr, - nullptr)); + rtc::Thread::Current(), fake_audio_capture_module_, + webrtc::CreateBuiltinAudioEncoderFactory(), + webrtc::CreateBuiltinAudioDecoderFactory(), nullptr, nullptr)); rtc::scoped_refptr pc( pc_factory->CreatePeerConnection( config, nullptr, std::move(port_allocator), nullptr, &observer_)); @@ -1292,7 +1294,9 @@ TEST_F(PeerConnectionInterfaceTest, rtc::scoped_refptr pc_factory( webrtc::CreatePeerConnectionFactory( network_thread.get(), rtc::Thread::Current(), rtc::Thread::Current(), - fake_audio_capture_module_, nullptr, nullptr)); + fake_audio_capture_module_, + webrtc::CreateBuiltinAudioEncoderFactory(), + webrtc::CreateBuiltinAudioDecoderFactory(), nullptr, nullptr)); std::unique_ptr port_allocator( new cricket::FakePortAllocator(network_thread.get(), nullptr)); cricket::FakePortAllocator* raw_port_allocator = port_allocator.get();