Commit c24d5a95 authored by Danil Chapovalov's avatar Danil Chapovalov Committed by Commit Bot

Create webrtc PeerConnectionFactory with the modular factory

That allows to use chromium's implementation of the webrtc::TaskQueueFactory
explicitly instead of through the global variable

Bug: webrtc:10284
Change-Id: Id79d63fd9710d72cfe17497ef91b615999350cfe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1627381Reviewed-by: default avatarFlorent Castelli <orphis@chromium.org>
Commit-Queue: Danil Chapovalov <danilchap@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662993}
parent b898e2fe
...@@ -633,7 +633,7 @@ target(link_target_type, "renderer") { ...@@ -633,7 +633,7 @@ target(link_target_type, "renderer") {
"//third_party/libyuv", "//third_party/libyuv",
"//third_party/opus", "//third_party/opus",
"//third_party/sqlite", "//third_party/sqlite",
"//third_party/webrtc/api:create_peerconnection_factory", "//third_party/webrtc/api:callfactory_api",
"//third_party/webrtc/api:libjingle_logging_api", "//third_party/webrtc/api:libjingle_logging_api",
"//third_party/webrtc/api:libjingle_peerconnection_api", "//third_party/webrtc/api:libjingle_peerconnection_api",
"//third_party/webrtc/api:rtc_stats_api", "//third_party/webrtc/api:rtc_stats_api",
...@@ -654,12 +654,14 @@ target(link_target_type, "renderer") { ...@@ -654,12 +654,14 @@ target(link_target_type, "renderer") {
"//third_party/webrtc/api/audio_codecs/opus:audio_decoder_opus", "//third_party/webrtc/api/audio_codecs/opus:audio_decoder_opus",
"//third_party/webrtc/api/audio_codecs/opus:audio_encoder_multiopus", "//third_party/webrtc/api/audio_codecs/opus:audio_encoder_multiopus",
"//third_party/webrtc/api/audio_codecs/opus:audio_encoder_opus", "//third_party/webrtc/api/audio_codecs/opus:audio_encoder_opus",
"//third_party/webrtc/api/rtc_event_log:rtc_event_log_factory",
"//third_party/webrtc/api/video:video_bitrate_allocation", "//third_party/webrtc/api/video:video_bitrate_allocation",
"//third_party/webrtc/api/video:video_frame", "//third_party/webrtc/api/video:video_frame",
"//third_party/webrtc/api/video:video_frame_i420", "//third_party/webrtc/api/video:video_frame_i420",
"//third_party/webrtc/api/video_codecs:rtc_software_fallback_wrappers", "//third_party/webrtc/api/video_codecs:rtc_software_fallback_wrappers",
"//third_party/webrtc/api/video_codecs:video_codecs_api", "//third_party/webrtc/api/video_codecs:video_codecs_api",
"//third_party/webrtc/common_video:common_video", "//third_party/webrtc/common_video:common_video",
"//third_party/webrtc/media:rtc_audio_video",
"//third_party/webrtc/media:rtc_internal_video_codecs", "//third_party/webrtc/media:rtc_internal_video_codecs",
"//third_party/webrtc/media:rtc_media", "//third_party/webrtc/media:rtc_media",
"//third_party/webrtc/media:rtc_media_base", "//third_party/webrtc/media:rtc_media_base",
......
...@@ -59,13 +59,18 @@ ...@@ -59,13 +59,18 @@
#include "third_party/blink/public/web/modules/mediastream/media_stream_video_track.h" #include "third_party/blink/public/web/modules/mediastream/media_stream_video_track.h"
#include "third_party/blink/public/web/web_document.h" #include "third_party/blink/public/web/web_document.h"
#include "third_party/blink/public/web/web_local_frame.h" #include "third_party/blink/public/web/web_local_frame.h"
#include "third_party/webrtc/api/create_peerconnection_factory.h" #include "third_party/webrtc/api/call/call_factory_interface.h"
#include "third_party/webrtc/api/peer_connection_interface.h"
#include "third_party/webrtc/api/rtc_event_log/rtc_event_log_factory.h"
#include "third_party/webrtc/api/video_track_source_proxy.h" #include "third_party/webrtc/api/video_track_source_proxy.h"
#include "third_party/webrtc/media/engine/fake_video_codec_factory.h" #include "third_party/webrtc/media/engine/fake_video_codec_factory.h"
#include "third_party/webrtc/media/engine/multiplex_codec_factory.h" #include "third_party/webrtc/media/engine/multiplex_codec_factory.h"
#include "third_party/webrtc/media/engine/webrtc_media_engine.h"
#include "third_party/webrtc/modules/audio_processing/include/audio_processing.h"
#include "third_party/webrtc/modules/video_coding/codecs/h264/include/h264.h" #include "third_party/webrtc/modules/video_coding/codecs/h264/include/h264.h"
#include "third_party/webrtc/rtc_base/ref_counted_object.h" #include "third_party/webrtc/rtc_base/ref_counted_object.h"
#include "third_party/webrtc/rtc_base/ssl_adapter.h" #include "third_party/webrtc/rtc_base/ssl_adapter.h"
#include "third_party/webrtc_overrides/task_queue_factory.h"
namespace content { namespace content {
...@@ -313,12 +318,24 @@ void PeerConnectionDependencyFactory::InitializeSignalingThread( ...@@ -313,12 +318,24 @@ void PeerConnectionDependencyFactory::InitializeSignalingThread(
std::make_unique<webrtc::FakeVideoDecoderFactory>(); std::make_unique<webrtc::FakeVideoDecoderFactory>();
} }
pc_factory_ = webrtc::CreatePeerConnectionFactory( webrtc::PeerConnectionFactoryDependencies pcf_deps;
worker_thread_ /* network thread */, worker_thread_, signaling_thread_, pcf_deps.worker_thread = worker_thread_;
audio_device_.get(), CreateWebrtcAudioEncoderFactory(), pcf_deps.network_thread = worker_thread_;
CreateWebrtcAudioDecoderFactory(), std::move(webrtc_encoder_factory), pcf_deps.signaling_thread = signaling_thread_;
std::move(webrtc_decoder_factory), nullptr /* audio_mixer */, pcf_deps.task_queue_factory = CreateWebRtcTaskQueueFactory();
nullptr /* audio_processing */); pcf_deps.call_factory = webrtc::CreateCallFactory();
pcf_deps.event_log_factory = std::make_unique<webrtc::RtcEventLogFactory>(
pcf_deps.task_queue_factory.get());
cricket::MediaEngineDependencies media_deps;
media_deps.task_queue_factory = pcf_deps.task_queue_factory.get();
media_deps.adm = audio_device_.get();
media_deps.audio_encoder_factory = CreateWebrtcAudioEncoderFactory();
media_deps.audio_decoder_factory = CreateWebrtcAudioDecoderFactory();
media_deps.video_encoder_factory = std::move(webrtc_encoder_factory);
media_deps.video_decoder_factory = std::move(webrtc_decoder_factory);
media_deps.audio_processing = webrtc::AudioProcessingBuilder().Create();
pcf_deps.media_engine = cricket::CreateMediaEngine(std::move(media_deps));
pc_factory_ = webrtc::CreateModularPeerConnectionFactory(std::move(pcf_deps));
CHECK(pc_factory_.get()); CHECK(pc_factory_.get());
webrtc::PeerConnectionFactoryInterface::Options factory_options; webrtc::PeerConnectionFactoryInterface::Options factory_options;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment