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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 rtc::scoped_refptr<PeerConnectionFactory> pc_factory( | 59 rtc::scoped_refptr<PeerConnectionFactory> pc_factory( |
60 new rtc::RefCountedObject<PeerConnectionFactory>( | 60 new rtc::RefCountedObject<PeerConnectionFactory>( |
61 network_thread, worker_thread, signaling_thread, default_adm, | 61 network_thread, worker_thread, signaling_thread, default_adm, |
62 encoder_factory, decoder_factory)); | 62 encoder_factory, decoder_factory)); |
63 | 63 |
64 // Call Initialize synchronously but make sure its executed on | 64 // Call Initialize synchronously but make sure its executed on |
65 // |signaling_thread|. | 65 // |signaling_thread|. |
66 MethodCall0<PeerConnectionFactory, bool> call( | 66 MethodCall0<PeerConnectionFactory, bool> call( |
67 pc_factory.get(), | 67 pc_factory.get(), |
68 &PeerConnectionFactory::Initialize); | 68 &PeerConnectionFactory::Initialize); |
69 bool result = call.Marshal(signaling_thread); | 69 bool result = call.Marshal(RTC_FROM_HERE, signaling_thread); |
70 | 70 |
71 if (!result) { | 71 if (!result) { |
72 return nullptr; | 72 return nullptr; |
73 } | 73 } |
74 return PeerConnectionFactoryProxy::Create(signaling_thread, pc_factory); | 74 return PeerConnectionFactoryProxy::Create(signaling_thread, pc_factory); |
75 } | 75 } |
76 | 76 |
77 PeerConnectionFactory::PeerConnectionFactory() | 77 PeerConnectionFactory::PeerConnectionFactory() |
78 : owns_ptrs_(true), | 78 : owns_ptrs_(true), |
79 wraps_current_thread_(false), | 79 wraps_current_thread_(false), |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 default_socket_factory_.reset( | 140 default_socket_factory_.reset( |
141 new rtc::BasicPacketSocketFactory(network_thread_)); | 141 new rtc::BasicPacketSocketFactory(network_thread_)); |
142 if (!default_socket_factory_) { | 142 if (!default_socket_factory_) { |
143 return false; | 143 return false; |
144 } | 144 } |
145 | 145 |
146 // TODO: Need to make sure only one VoE is created inside | 146 // TODO: Need to make sure only one VoE is created inside |
147 // WebRtcMediaEngine. | 147 // WebRtcMediaEngine. |
148 cricket::MediaEngineInterface* media_engine = | 148 cricket::MediaEngineInterface* media_engine = |
149 worker_thread_->Invoke<cricket::MediaEngineInterface*>(rtc::Bind( | 149 worker_thread_->Invoke<cricket::MediaEngineInterface*>( |
150 &PeerConnectionFactory::CreateMediaEngine_w, this)); | 150 RTC_FROM_HERE, |
| 151 rtc::Bind(&PeerConnectionFactory::CreateMediaEngine_w, this)); |
151 | 152 |
152 channel_manager_.reset(new cricket::ChannelManager( | 153 channel_manager_.reset(new cricket::ChannelManager( |
153 media_engine, worker_thread_, network_thread_)); | 154 media_engine, worker_thread_, network_thread_)); |
154 | 155 |
155 channel_manager_->SetVideoRtxEnabled(true); | 156 channel_manager_->SetVideoRtxEnabled(true); |
156 if (!channel_manager_->Init()) { | 157 if (!channel_manager_->Init()) { |
157 return false; | 158 return false; |
158 } | 159 } |
159 | 160 |
160 return true; | 161 return true; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 // No certificate generator specified, use the default one. | 250 // No certificate generator specified, use the default one. |
250 cert_generator.reset( | 251 cert_generator.reset( |
251 new rtc::RTCCertificateGenerator(signaling_thread_, network_thread_)); | 252 new rtc::RTCCertificateGenerator(signaling_thread_, network_thread_)); |
252 } | 253 } |
253 | 254 |
254 if (!allocator) { | 255 if (!allocator) { |
255 allocator.reset(new cricket::BasicPortAllocator( | 256 allocator.reset(new cricket::BasicPortAllocator( |
256 default_network_manager_.get(), default_socket_factory_.get())); | 257 default_network_manager_.get(), default_socket_factory_.get())); |
257 } | 258 } |
258 network_thread_->Invoke<void>( | 259 network_thread_->Invoke<void>( |
259 rtc::Bind(&cricket::PortAllocator::SetNetworkIgnoreMask, allocator.get(), | 260 RTC_FROM_HERE, rtc::Bind(&cricket::PortAllocator::SetNetworkIgnoreMask, |
260 options_.network_ignore_mask)); | 261 allocator.get(), options_.network_ignore_mask)); |
261 | 262 |
262 rtc::scoped_refptr<PeerConnection> pc( | 263 rtc::scoped_refptr<PeerConnection> pc( |
263 new rtc::RefCountedObject<PeerConnection>(this)); | 264 new rtc::RefCountedObject<PeerConnection>(this)); |
264 | 265 |
265 if (!pc->Initialize(configuration, std::move(allocator), | 266 if (!pc->Initialize(configuration, std::move(allocator), |
266 std::move(cert_generator), observer)) { | 267 std::move(cert_generator), observer)) { |
267 return nullptr; | 268 return nullptr; |
268 } | 269 } |
269 return PeerConnectionProxy::Create(signaling_thread(), pc); | 270 return PeerConnectionProxy::Create(signaling_thread(), pc); |
270 } | 271 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 } | 317 } |
317 | 318 |
318 cricket::MediaEngineInterface* PeerConnectionFactory::CreateMediaEngine_w() { | 319 cricket::MediaEngineInterface* PeerConnectionFactory::CreateMediaEngine_w() { |
319 ASSERT(worker_thread_ == rtc::Thread::Current()); | 320 ASSERT(worker_thread_ == rtc::Thread::Current()); |
320 return cricket::WebRtcMediaEngineFactory::Create( | 321 return cricket::WebRtcMediaEngineFactory::Create( |
321 default_adm_.get(), video_encoder_factory_.get(), | 322 default_adm_.get(), video_encoder_factory_.get(), |
322 video_decoder_factory_.get()); | 323 video_decoder_factory_.get()); |
323 } | 324 } |
324 | 325 |
325 } // namespace webrtc | 326 } // namespace webrtc |
OLD | NEW |