OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2004 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 |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include "pc/videocapturertracksource.h" | 39 #include "pc/videocapturertracksource.h" |
40 #include "pc/videotrack.h" | 40 #include "pc/videotrack.h" |
41 | 41 |
42 namespace webrtc { | 42 namespace webrtc { |
43 | 43 |
44 rtc::scoped_refptr<PeerConnectionFactoryInterface> | 44 rtc::scoped_refptr<PeerConnectionFactoryInterface> |
45 CreateModularPeerConnectionFactory( | 45 CreateModularPeerConnectionFactory( |
46 rtc::Thread* network_thread, | 46 rtc::Thread* network_thread, |
47 rtc::Thread* worker_thread, | 47 rtc::Thread* worker_thread, |
48 rtc::Thread* signaling_thread, | 48 rtc::Thread* signaling_thread, |
49 AudioDeviceModule* default_adm, | |
50 rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory, | |
51 rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory, | |
52 cricket::WebRtcVideoEncoderFactory* video_encoder_factory, | 49 cricket::WebRtcVideoEncoderFactory* video_encoder_factory, |
53 cricket::WebRtcVideoDecoderFactory* video_decoder_factory, | 50 cricket::WebRtcVideoDecoderFactory* video_decoder_factory, |
54 rtc::scoped_refptr<AudioMixer> audio_mixer, | |
55 std::unique_ptr<cricket::MediaEngineInterface> media_engine, | 51 std::unique_ptr<cricket::MediaEngineInterface> media_engine, |
56 std::unique_ptr<CallFactoryInterface> call_factory, | 52 std::unique_ptr<CallFactoryInterface> call_factory, |
57 std::unique_ptr<RtcEventLogFactoryInterface> event_log_factory) { | 53 std::unique_ptr<RtcEventLogFactoryInterface> event_log_factory) { |
58 rtc::scoped_refptr<PeerConnectionFactory> pc_factory( | 54 rtc::scoped_refptr<PeerConnectionFactory> pc_factory( |
59 new rtc::RefCountedObject<PeerConnectionFactory>( | 55 new rtc::RefCountedObject<PeerConnectionFactory>( |
60 network_thread, worker_thread, signaling_thread, default_adm, | 56 network_thread, worker_thread, signaling_thread, |
61 audio_encoder_factory, audio_decoder_factory, video_encoder_factory, | 57 video_encoder_factory, video_decoder_factory, std::move(media_engine), |
62 video_decoder_factory, audio_mixer, std::move(media_engine), | |
63 std::move(call_factory), std::move(event_log_factory))); | 58 std::move(call_factory), std::move(event_log_factory))); |
64 | 59 |
65 // Call Initialize synchronously but make sure it is executed on | 60 // Call Initialize synchronously but make sure it is executed on |
66 // |signaling_thread|. | 61 // |signaling_thread|. |
67 MethodCall0<PeerConnectionFactory, bool> call( | 62 MethodCall0<PeerConnectionFactory, bool> call( |
68 pc_factory.get(), &PeerConnectionFactory::Initialize); | 63 pc_factory.get(), &PeerConnectionFactory::Initialize); |
69 bool result = call.Marshal(RTC_FROM_HERE, pc_factory->signaling_thread()); | 64 bool result = call.Marshal(RTC_FROM_HERE, pc_factory->signaling_thread()); |
70 | 65 |
71 if (!result) { | 66 if (!result) { |
72 return nullptr; | 67 return nullptr; |
73 } | 68 } |
74 return PeerConnectionFactoryProxy::Create(pc_factory->signaling_thread(), | 69 return PeerConnectionFactoryProxy::Create(pc_factory->signaling_thread(), |
75 pc_factory); | 70 pc_factory); |
76 } | 71 } |
77 | 72 |
78 PeerConnectionFactory::PeerConnectionFactory( | 73 PeerConnectionFactory::PeerConnectionFactory( |
79 rtc::Thread* network_thread, | 74 rtc::Thread* network_thread, |
80 rtc::Thread* worker_thread, | 75 rtc::Thread* worker_thread, |
81 rtc::Thread* signaling_thread, | 76 rtc::Thread* signaling_thread, |
82 AudioDeviceModule* default_adm, | |
83 rtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory, | |
84 rtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory, | |
85 cricket::WebRtcVideoEncoderFactory* video_encoder_factory, | 77 cricket::WebRtcVideoEncoderFactory* video_encoder_factory, |
86 cricket::WebRtcVideoDecoderFactory* video_decoder_factory, | 78 cricket::WebRtcVideoDecoderFactory* video_decoder_factory, |
87 rtc::scoped_refptr<AudioMixer> audio_mixer, | |
88 std::unique_ptr<cricket::MediaEngineInterface> media_engine, | 79 std::unique_ptr<cricket::MediaEngineInterface> media_engine, |
89 std::unique_ptr<webrtc::CallFactoryInterface> call_factory, | 80 std::unique_ptr<webrtc::CallFactoryInterface> call_factory, |
90 std::unique_ptr<RtcEventLogFactoryInterface> event_log_factory) | 81 std::unique_ptr<RtcEventLogFactoryInterface> event_log_factory) |
91 : wraps_current_thread_(false), | 82 : wraps_current_thread_(false), |
92 network_thread_(network_thread), | 83 network_thread_(network_thread), |
93 worker_thread_(worker_thread), | 84 worker_thread_(worker_thread), |
94 signaling_thread_(signaling_thread), | 85 signaling_thread_(signaling_thread), |
95 default_adm_(default_adm), | |
96 audio_encoder_factory_(audio_encoder_factory), | |
97 audio_decoder_factory_(audio_decoder_factory), | |
98 video_encoder_factory_(video_encoder_factory), | 86 video_encoder_factory_(video_encoder_factory), |
99 video_decoder_factory_(video_decoder_factory), | 87 video_decoder_factory_(video_decoder_factory), |
100 external_audio_mixer_(audio_mixer), | |
101 media_engine_(std::move(media_engine)), | 88 media_engine_(std::move(media_engine)), |
102 call_factory_(std::move(call_factory)), | 89 call_factory_(std::move(call_factory)), |
103 event_log_factory_(std::move(event_log_factory)) { | 90 event_log_factory_(std::move(event_log_factory)) { |
104 if (!network_thread_) { | 91 if (!network_thread_) { |
105 owned_network_thread_ = rtc::Thread::CreateWithSocketServer(); | 92 owned_network_thread_ = rtc::Thread::CreateWithSocketServer(); |
106 owned_network_thread_->Start(); | 93 owned_network_thread_->Start(); |
107 network_thread_ = owned_network_thread_.get(); | 94 network_thread_ = owned_network_thread_.get(); |
108 } | 95 } |
109 | 96 |
110 if (!worker_thread_) { | 97 if (!worker_thread_) { |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 } | 339 } |
353 call_config.audio_state = channel_manager_->media_engine()->GetAudioState(); | 340 call_config.audio_state = channel_manager_->media_engine()->GetAudioState(); |
354 call_config.bitrate_config.min_bitrate_bps = kMinBandwidthBps; | 341 call_config.bitrate_config.min_bitrate_bps = kMinBandwidthBps; |
355 call_config.bitrate_config.start_bitrate_bps = kStartBandwidthBps; | 342 call_config.bitrate_config.start_bitrate_bps = kStartBandwidthBps; |
356 call_config.bitrate_config.max_bitrate_bps = kMaxBandwidthBps; | 343 call_config.bitrate_config.max_bitrate_bps = kMaxBandwidthBps; |
357 | 344 |
358 return std::unique_ptr<Call>(call_factory_->CreateCall(call_config)); | 345 return std::unique_ptr<Call>(call_factory_->CreateCall(call_config)); |
359 } | 346 } |
360 | 347 |
361 } // namespace webrtc | 348 } // namespace webrtc |
OLD | NEW |