diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /third_party/libwebrtc/test/pc/e2e/test_peer_factory.cc | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/test/pc/e2e/test_peer_factory.cc')
-rw-r--r-- | third_party/libwebrtc/test/pc/e2e/test_peer_factory.cc | 50 |
1 files changed, 16 insertions, 34 deletions
diff --git a/third_party/libwebrtc/test/pc/e2e/test_peer_factory.cc b/third_party/libwebrtc/test/pc/e2e/test_peer_factory.cc index 41f7533c3a..dd900027ee 100644 --- a/third_party/libwebrtc/test/pc/e2e/test_peer_factory.cc +++ b/third_party/libwebrtc/test/pc/e2e/test_peer_factory.cc @@ -13,6 +13,7 @@ #include "absl/memory/memory.h" #include "absl/strings/string_view.h" +#include "api/enable_media_with_defaults.h" #include "api/task_queue/default_task_queue_factory.h" #include "api/test/create_time_controller.h" #include "api/test/pclf/media_configuration.h" @@ -21,8 +22,6 @@ #include "api/transport/field_trial_based_config.h" #include "api/video_codecs/builtin_video_decoder_factory.h" #include "api/video_codecs/builtin_video_encoder_factory.h" -#include "media/engine/webrtc_media_engine.h" -#include "media/engine/webrtc_media_engine_defaults.h" #include "modules/audio_processing/aec_dump/aec_dump_factory.h" #include "p2p/client/basic_port_allocator.h" #include "rtc_base/thread.h" @@ -146,28 +145,6 @@ rtc::scoped_refptr<AudioDeviceModule> CreateAudioDeviceModule( std::move(renderer), /*speed=*/1.f); } -std::unique_ptr<cricket::MediaEngineInterface> CreateMediaEngine( - TaskQueueFactory* task_queue_factory, - PeerConnectionFactoryComponents* pcf_dependencies, - rtc::scoped_refptr<AudioDeviceModule> audio_device_module) { - cricket::MediaEngineDependencies media_deps; - media_deps.task_queue_factory = task_queue_factory; - media_deps.adm = audio_device_module; - media_deps.audio_processing = pcf_dependencies->audio_processing; - media_deps.audio_mixer = pcf_dependencies->audio_mixer; - media_deps.video_encoder_factory = - std::move(pcf_dependencies->video_encoder_factory); - media_deps.video_decoder_factory = - std::move(pcf_dependencies->video_decoder_factory); - media_deps.audio_encoder_factory = pcf_dependencies->audio_encoder_factory; - media_deps.audio_decoder_factory = pcf_dependencies->audio_decoder_factory; - webrtc::SetMediaEngineDefaults(&media_deps); - RTC_DCHECK(pcf_dependencies->trials); - media_deps.trials = pcf_dependencies->trials.get(); - - return cricket::CreateMediaEngine(std::move(media_deps)); -} - void WrapVideoEncoderFactory( absl::string_view peer_name, double bitrate_multiplier, @@ -206,7 +183,7 @@ void WrapVideoDecoderFactory( PeerConnectionFactoryDependencies CreatePCFDependencies( std::unique_ptr<PeerConnectionFactoryComponents> pcf_dependencies, TimeController& time_controller, - std::unique_ptr<cricket::MediaEngineInterface> media_engine, + rtc::scoped_refptr<AudioDeviceModule> audio_device_module, rtc::Thread* signaling_thread, rtc::Thread* worker_thread, rtc::Thread* network_thread) { @@ -214,10 +191,7 @@ PeerConnectionFactoryDependencies CreatePCFDependencies( pcf_deps.signaling_thread = signaling_thread; pcf_deps.worker_thread = worker_thread; pcf_deps.network_thread = network_thread; - pcf_deps.media_engine = std::move(media_engine); - pcf_deps.call_factory = - CreateTimeControllerBasedCallFactory(&time_controller); pcf_deps.event_log_factory = std::move(pcf_dependencies->event_log_factory); pcf_deps.task_queue_factory = time_controller.CreateTaskQueueFactory(); @@ -236,6 +210,18 @@ PeerConnectionFactoryDependencies CreatePCFDependencies( pcf_deps.trials = std::move(pcf_dependencies->trials); } + // Media dependencies + pcf_deps.adm = std::move(audio_device_module); + pcf_deps.audio_processing = pcf_dependencies->audio_processing; + pcf_deps.audio_mixer = pcf_dependencies->audio_mixer; + pcf_deps.video_encoder_factory = + std::move(pcf_dependencies->video_encoder_factory); + pcf_deps.video_decoder_factory = + std::move(pcf_dependencies->video_decoder_factory); + pcf_deps.audio_encoder_factory = pcf_dependencies->audio_encoder_factory; + pcf_deps.audio_decoder_factory = pcf_dependencies->audio_decoder_factory; + EnableMediaWithDefaultsAndTimeController(time_controller, pcf_deps); + return pcf_deps; } @@ -324,10 +310,6 @@ std::unique_ptr<TestPeer> TestPeerFactory::CreateTestPeer( WrapVideoDecoderFactory(params->name.value(), components->pcf_dependencies.get(), video_analyzer_helper_); - std::unique_ptr<cricket::MediaEngineInterface> media_engine = - CreateMediaEngine(time_controller_.GetTaskQueueFactory(), - components->pcf_dependencies.get(), - audio_device_module); std::unique_ptr<rtc::Thread> owned_worker_thread = components->worker_thread != nullptr @@ -343,8 +325,8 @@ std::unique_ptr<TestPeer> TestPeerFactory::CreateTestPeer( components->pcf_dependencies->audio_processing; PeerConnectionFactoryDependencies pcf_deps = CreatePCFDependencies( std::move(components->pcf_dependencies), time_controller_, - std::move(media_engine), signaling_thread_, components->worker_thread, - components->network_thread); + std::move(audio_device_module), signaling_thread_, + components->worker_thread, components->network_thread); rtc::scoped_refptr<PeerConnectionFactoryInterface> peer_connection_factory = CreateModularPeerConnectionFactory(std::move(pcf_deps)); |