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 <hta@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42322}
This commit is contained in:
parent
e0e5e3f727
commit
d122464b6a
@ -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",
|
||||
]
|
||||
}
|
||||
|
||||
@ -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<PeerConnectionFactoryInterface> CreatePeerConnectionFactory(
|
||||
rtc::scoped_refptr<AudioProcessing> audio_processing,
|
||||
std::unique_ptr<AudioFrameProcessor> audio_frame_processor,
|
||||
std::unique_ptr<FieldTrialsView> field_trials) {
|
||||
if (!field_trials) {
|
||||
field_trials = std::make_unique<webrtc::FieldTrialBasedConfig>();
|
||||
}
|
||||
|
||||
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<RtcEventLogFactory>();
|
||||
dependencies.trials = std::move(field_trials);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user