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/api/create_peerconnection_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/api/create_peerconnection_factory.cc')
-rw-r--r-- | third_party/libwebrtc/api/create_peerconnection_factory.cc | 77 |
1 files changed, 12 insertions, 65 deletions
diff --git a/third_party/libwebrtc/api/create_peerconnection_factory.cc b/third_party/libwebrtc/api/create_peerconnection_factory.cc index b7f9eb7f30..5d3aace05f 100644 --- a/third_party/libwebrtc/api/create_peerconnection_factory.cc +++ b/third_party/libwebrtc/api/create_peerconnection_factory.cc @@ -13,14 +13,12 @@ #include <memory> #include <utility> -#include "api/call/call_factory_interface.h" +#include "api/enable_media.h" #include "api/peer_connection_interface.h" #include "api/rtc_event_log/rtc_event_log_factory.h" #include "api/scoped_refptr.h" #include "api/task_queue/default_task_queue_factory.h" #include "api/transport/field_trial_based_config.h" -#include "media/base/media_engine.h" -#include "media/engine/webrtc_media_engine.h" #include "modules/audio_device/include/audio_device.h" #include "modules/audio_processing/include/audio_processing.h" #include "rtc_base/thread.h" @@ -38,8 +36,7 @@ rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory( std::unique_ptr<VideoDecoderFactory> video_decoder_factory, rtc::scoped_refptr<AudioMixer> audio_mixer, rtc::scoped_refptr<AudioProcessing> audio_processing, - AudioFrameProcessor* audio_frame_processor, - std::unique_ptr<AudioFrameProcessor> owned_audio_frame_processor, + std::unique_ptr<AudioFrameProcessor> audio_frame_processor, std::unique_ptr<FieldTrialsView> field_trials) { if (!field_trials) { field_trials = std::make_unique<webrtc::FieldTrialBasedConfig>(); @@ -51,7 +48,6 @@ rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory( dependencies.signaling_thread = signaling_thread; dependencies.task_queue_factory = CreateDefaultTaskQueueFactory(field_trials.get()); - dependencies.call_factory = CreateCallFactory(); dependencies.event_log_factory = std::make_unique<RtcEventLogFactory>( dependencies.task_queue_factory.get()); dependencies.trials = std::move(field_trials); @@ -60,70 +56,21 @@ rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory( // TODO(bugs.webrtc.org/13145): Add an rtc::SocketFactory* argument. dependencies.socket_factory = network_thread->socketserver(); } - cricket::MediaEngineDependencies media_dependencies; - media_dependencies.task_queue_factory = dependencies.task_queue_factory.get(); - media_dependencies.adm = std::move(default_adm); - media_dependencies.audio_encoder_factory = std::move(audio_encoder_factory); - media_dependencies.audio_decoder_factory = std::move(audio_decoder_factory); - if (audio_frame_processor) { - media_dependencies.audio_frame_processor = audio_frame_processor; - } else if (owned_audio_frame_processor) { - media_dependencies.owned_audio_frame_processor = - std::move(owned_audio_frame_processor); - } + dependencies.adm = std::move(default_adm); + dependencies.audio_encoder_factory = std::move(audio_encoder_factory); + dependencies.audio_decoder_factory = std::move(audio_decoder_factory); + dependencies.audio_frame_processor = std::move(audio_frame_processor); if (audio_processing) { - media_dependencies.audio_processing = std::move(audio_processing); + dependencies.audio_processing = std::move(audio_processing); } else { - media_dependencies.audio_processing = AudioProcessingBuilder().Create(); + dependencies.audio_processing = AudioProcessingBuilder().Create(); } - media_dependencies.audio_mixer = std::move(audio_mixer); - media_dependencies.video_encoder_factory = std::move(video_encoder_factory); - media_dependencies.video_decoder_factory = std::move(video_decoder_factory); - media_dependencies.trials = dependencies.trials.get(); - dependencies.media_engine = - cricket::CreateMediaEngine(std::move(media_dependencies)); + dependencies.audio_mixer = std::move(audio_mixer); + dependencies.video_encoder_factory = std::move(video_encoder_factory); + dependencies.video_decoder_factory = std::move(video_decoder_factory); + EnableMedia(dependencies); return CreateModularPeerConnectionFactory(std::move(dependencies)); } -rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory( - rtc::Thread* network_thread, - rtc::Thread* worker_thread, - rtc::Thread* signaling_thread, - rtc::scoped_refptr<AudioDeviceModule> default_adm, - rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory, - rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory, - std::unique_ptr<VideoEncoderFactory> video_encoder_factory, - std::unique_ptr<VideoDecoderFactory> video_decoder_factory, - rtc::scoped_refptr<AudioMixer> audio_mixer, - rtc::scoped_refptr<AudioProcessing> audio_processing, - AudioFrameProcessor* audio_frame_processor) { - return CreatePeerConnectionFactory( - network_thread, worker_thread, signaling_thread, default_adm, - audio_encoder_factory, audio_decoder_factory, - std::move(video_encoder_factory), std::move(video_decoder_factory), - audio_mixer, audio_processing, audio_frame_processor, nullptr, nullptr); -} - -rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory( - rtc::Thread* network_thread, - rtc::Thread* worker_thread, - rtc::Thread* signaling_thread, - rtc::scoped_refptr<AudioDeviceModule> default_adm, - rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory, - rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory, - std::unique_ptr<VideoEncoderFactory> video_encoder_factory, - std::unique_ptr<VideoDecoderFactory> video_decoder_factory, - rtc::scoped_refptr<AudioMixer> audio_mixer, - rtc::scoped_refptr<AudioProcessing> audio_processing, - std::unique_ptr<AudioFrameProcessor> owned_audio_frame_processor, - std::unique_ptr<FieldTrialsView> field_trials) { - return CreatePeerConnectionFactory( - network_thread, worker_thread, signaling_thread, default_adm, - audio_encoder_factory, audio_decoder_factory, - std::move(video_encoder_factory), std::move(video_decoder_factory), - audio_mixer, audio_processing, nullptr, - std::move(owned_audio_frame_processor), std::move(field_trials)); -} - } // namespace webrtc |