From d122464b6a38452b96e271d58c35e6b716925848 Mon Sep 17 00:00:00 2001 From: Danil Chapovalov Date: Thu, 16 May 2024 11:41:12 +0200 Subject: [PATCH] Remove default field trials and task queue factory in CreatePeerConnectionFactory function When they are unset, internally same defaults will be created by Environment, i.e., creating them in CreatePeerConnectionFactory is redundant (https://webrtc.googlesource.com/src/+/refs/heads/main/api/environment/environment_factory.cc#96) This would simplify changing the default in the future, and demonstrates that by default it is better to leave these dependencies unset. Bug: webrtc:42226001 Change-Id: I8bf8614b9e8ca4062939e71d45e67cf2da1558c6 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/350742 Reviewed-by: Harald Alvestrand Commit-Queue: Danil Chapovalov Cr-Commit-Position: refs/heads/main@{#42322} --- api/BUILD.gn | 2 -- api/create_peerconnection_factory.cc | 8 -------- 2 files changed, 10 deletions(-) diff --git a/api/BUILD.gn b/api/BUILD.gn index b71430956e..464e1be3bf 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -89,8 +89,6 @@ if (!build_with_chromium) { "audio:audio_mixer_api", "audio:audio_processing", "audio_codecs:audio_codecs_api", - "task_queue:default_task_queue_factory", - "transport:field_trial_based_config", "video_codecs:video_codecs_api", ] } diff --git a/api/create_peerconnection_factory.cc b/api/create_peerconnection_factory.cc index 46105a2021..e5ba20f53a 100644 --- a/api/create_peerconnection_factory.cc +++ b/api/create_peerconnection_factory.cc @@ -19,8 +19,6 @@ #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 "rtc_base/thread.h" namespace webrtc { @@ -38,16 +36,10 @@ rtc::scoped_refptr CreatePeerConnectionFactory( rtc::scoped_refptr audio_processing, std::unique_ptr audio_frame_processor, std::unique_ptr field_trials) { - if (!field_trials) { - field_trials = std::make_unique(); - } - PeerConnectionFactoryDependencies dependencies; dependencies.network_thread = network_thread; dependencies.worker_thread = worker_thread; dependencies.signaling_thread = signaling_thread; - dependencies.task_queue_factory = - CreateDefaultTaskQueueFactory(field_trials.get()); dependencies.event_log_factory = std::make_unique(); dependencies.trials = std::move(field_trials);