OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include "api/audio_codecs/builtin_audio_decoder_factory.h" | 11 #include "api/audio_codecs/builtin_audio_decoder_factory.h" |
12 #include "api/audio_codecs/builtin_audio_encoder_factory.h" | 12 #include "api/audio_codecs/builtin_audio_encoder_factory.h" |
13 #include "api/peerconnectioninterface.h" | 13 #include "api/peerconnectioninterface.h" |
| 14 #include "api/video_codecs/video_decoder_factory.h" |
| 15 #include "api/video_codecs/video_encoder_factory.h" |
14 #include "call/callfactoryinterface.h" | 16 #include "call/callfactoryinterface.h" |
15 #include "logging/rtc_event_log/rtc_event_log_factory_interface.h" | 17 #include "logging/rtc_event_log/rtc_event_log_factory_interface.h" |
16 #include "media/engine/webrtcmediaengine.h" | 18 #include "media/engine/webrtcmediaengine.h" |
| 19 #include "modules/audio_device/include/audio_device.h" |
17 #include "modules/audio_processing/include/audio_processing.h" | 20 #include "modules/audio_processing/include/audio_processing.h" |
18 #include "rtc_base/bind.h" | 21 #include "rtc_base/bind.h" |
19 #include "rtc_base/scoped_ref_ptr.h" | 22 #include "rtc_base/scoped_ref_ptr.h" |
20 #include "rtc_base/thread.h" | 23 #include "rtc_base/thread.h" |
21 | 24 |
22 namespace webrtc { | 25 namespace webrtc { |
23 | 26 |
24 rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory( | 27 rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory( |
25 rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory, | 28 rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory, |
26 rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory) { | 29 rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory) { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 std::unique_ptr<RtcEventLogFactoryInterface> event_log_factory = | 70 std::unique_ptr<RtcEventLogFactoryInterface> event_log_factory = |
68 CreateRtcEventLogFactory(); | 71 CreateRtcEventLogFactory(); |
69 | 72 |
70 return CreateModularPeerConnectionFactory( | 73 return CreateModularPeerConnectionFactory( |
71 network_thread, worker_thread, signaling_thread, default_adm, | 74 network_thread, worker_thread, signaling_thread, default_adm, |
72 audio_encoder_factory, audio_decoder_factory, video_encoder_factory, | 75 audio_encoder_factory, audio_decoder_factory, video_encoder_factory, |
73 video_decoder_factory, audio_mixer, std::move(media_engine), | 76 video_decoder_factory, audio_mixer, std::move(media_engine), |
74 std::move(call_factory), std::move(event_log_factory)); | 77 std::move(call_factory), std::move(event_log_factory)); |
75 } | 78 } |
76 | 79 |
| 80 rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory( |
| 81 rtc::Thread* network_thread, |
| 82 rtc::Thread* worker_thread, |
| 83 rtc::Thread* signaling_thread, |
| 84 rtc::scoped_refptr<AudioDeviceModule> default_adm, |
| 85 rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory, |
| 86 rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory, |
| 87 std::unique_ptr<VideoEncoderFactory> video_encoder_factory, |
| 88 std::unique_ptr<VideoDecoderFactory> video_decoder_factory, |
| 89 rtc::scoped_refptr<AudioMixer> audio_mixer, |
| 90 rtc::scoped_refptr<AudioProcessing> audio_processing) { |
| 91 if (!audio_processing) |
| 92 audio_processing = AudioProcessing::Create(); |
| 93 |
| 94 std::unique_ptr<cricket::MediaEngineInterface> media_engine = |
| 95 cricket::WebRtcMediaEngineFactory::Create( |
| 96 default_adm, audio_encoder_factory, audio_decoder_factory, |
| 97 std::move(video_encoder_factory), std::move(video_decoder_factory), |
| 98 audio_mixer, audio_processing); |
| 99 |
| 100 std::unique_ptr<CallFactoryInterface> call_factory = CreateCallFactory(); |
| 101 |
| 102 std::unique_ptr<RtcEventLogFactoryInterface> event_log_factory = |
| 103 CreateRtcEventLogFactory(); |
| 104 |
| 105 return CreateModularPeerConnectionFactory( |
| 106 network_thread, worker_thread, signaling_thread, default_adm, |
| 107 audio_encoder_factory, audio_decoder_factory, |
| 108 nullptr /* external_video_encoder_factory */, |
| 109 nullptr /* external_video_decoder_factory */, audio_mixer, |
| 110 std::move(media_engine), std::move(call_factory), |
| 111 std::move(event_log_factory)); |
| 112 } |
| 113 |
77 rtc::scoped_refptr<PeerConnectionFactoryInterface> | 114 rtc::scoped_refptr<PeerConnectionFactoryInterface> |
78 CreatePeerConnectionFactoryWithAudioMixer( | 115 CreatePeerConnectionFactoryWithAudioMixer( |
79 rtc::Thread* network_thread, | 116 rtc::Thread* network_thread, |
80 rtc::Thread* worker_thread, | 117 rtc::Thread* worker_thread, |
81 rtc::Thread* signaling_thread, | 118 rtc::Thread* signaling_thread, |
82 AudioDeviceModule* default_adm, | 119 AudioDeviceModule* default_adm, |
83 rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory, | 120 rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory, |
84 rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory, | 121 rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory, |
85 cricket::WebRtcVideoEncoderFactory* video_encoder_factory, | 122 cricket::WebRtcVideoEncoderFactory* video_encoder_factory, |
86 cricket::WebRtcVideoDecoderFactory* video_decoder_factory, | 123 cricket::WebRtcVideoDecoderFactory* video_decoder_factory, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory, | 164 rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory, |
128 cricket::WebRtcVideoEncoderFactory* video_encoder_factory, | 165 cricket::WebRtcVideoEncoderFactory* video_encoder_factory, |
129 cricket::WebRtcVideoDecoderFactory* video_decoder_factory) { | 166 cricket::WebRtcVideoDecoderFactory* video_decoder_factory) { |
130 return CreatePeerConnectionFactoryWithAudioMixer( | 167 return CreatePeerConnectionFactoryWithAudioMixer( |
131 network_thread, worker_thread, signaling_thread, default_adm, | 168 network_thread, worker_thread, signaling_thread, default_adm, |
132 audio_encoder_factory, audio_decoder_factory, video_encoder_factory, | 169 audio_encoder_factory, audio_decoder_factory, video_encoder_factory, |
133 video_decoder_factory, nullptr); | 170 video_decoder_factory, nullptr); |
134 } | 171 } |
135 | 172 |
136 } // namespace webrtc | 173 } // namespace webrtc |
OLD | NEW |