Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Side by Side Diff: webrtc/api/peerconnectionfactory.cc

Issue 1975453002: Add PeerConnection IsClosed check. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Inject the TransportController to PeerConnection. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/api/peerconnectionfactory.h ('k') | webrtc/api/peerconnectioninterface_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 181
182 channel_manager_->SetVideoRtxEnabled(true); 182 channel_manager_->SetVideoRtxEnabled(true);
183 if (!channel_manager_->Init()) { 183 if (!channel_manager_->Init()) {
184 return false; 184 return false;
185 } 185 }
186 186
187 dtls_identity_store_ = 187 dtls_identity_store_ =
188 new RefCountedDtlsIdentityStore(signaling_thread_, network_thread_); 188 new RefCountedDtlsIdentityStore(signaling_thread_, network_thread_);
189 189
190 return true; 190 return true;
191 } 191 }
zhihuang1 2016/06/01 21:11:21 This empty line should not be deleted.
192
193 rtc::scoped_refptr<AudioSourceInterface> 192 rtc::scoped_refptr<AudioSourceInterface>
194 PeerConnectionFactory::CreateAudioSource( 193 PeerConnectionFactory::CreateAudioSource(
195 const MediaConstraintsInterface* constraints) { 194 const MediaConstraintsInterface* constraints) {
196 RTC_DCHECK(signaling_thread_->IsCurrent()); 195 RTC_DCHECK(signaling_thread_->IsCurrent());
197 rtc::scoped_refptr<LocalAudioSource> source( 196 rtc::scoped_refptr<LocalAudioSource> source(
198 LocalAudioSource::Create(options_, constraints)); 197 LocalAudioSource::Create(options_, constraints));
199 return source; 198 return source;
200 } 199 }
201 200
202 rtc::scoped_refptr<AudioSourceInterface> 201 rtc::scoped_refptr<AudioSourceInterface>
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 return AudioTrackProxy::Create(signaling_thread_, track); 324 return AudioTrackProxy::Create(signaling_thread_, track);
326 } 325 }
327 326
328 webrtc::MediaControllerInterface* PeerConnectionFactory::CreateMediaController( 327 webrtc::MediaControllerInterface* PeerConnectionFactory::CreateMediaController(
329 const cricket::MediaConfig& config) const { 328 const cricket::MediaConfig& config) const {
330 RTC_DCHECK(signaling_thread_->IsCurrent()); 329 RTC_DCHECK(signaling_thread_->IsCurrent());
331 return MediaControllerInterface::Create(config, worker_thread_, 330 return MediaControllerInterface::Create(config, worker_thread_,
332 channel_manager_.get()); 331 channel_manager_.get());
333 } 332 }
334 333
334 cricket::TransportController* PeerConnectionFactory::CreateTransportController(
335 cricket::PortAllocator* port_allocator) {
336 RTC_DCHECK(signaling_thread_->IsCurrent());
337 return new cricket::TransportController(signaling_thread_, network_thread_,
338 port_allocator);
339 }
340
335 rtc::Thread* PeerConnectionFactory::signaling_thread() { 341 rtc::Thread* PeerConnectionFactory::signaling_thread() {
336 // This method can be called on a different thread when the factory is 342 // This method can be called on a different thread when the factory is
337 // created in CreatePeerConnectionFactory(). 343 // created in CreatePeerConnectionFactory().
338 return signaling_thread_; 344 return signaling_thread_;
339 } 345 }
340 346
341 rtc::Thread* PeerConnectionFactory::worker_thread() { 347 rtc::Thread* PeerConnectionFactory::worker_thread() {
342 RTC_DCHECK(signaling_thread_->IsCurrent()); 348 RTC_DCHECK(signaling_thread_->IsCurrent());
343 return worker_thread_; 349 return worker_thread_;
344 } 350 }
345 351
346 rtc::Thread* PeerConnectionFactory::network_thread() { 352 rtc::Thread* PeerConnectionFactory::network_thread() {
347 return network_thread_; 353 return network_thread_;
348 } 354 }
349 355
350 cricket::MediaEngineInterface* PeerConnectionFactory::CreateMediaEngine_w() { 356 cricket::MediaEngineInterface* PeerConnectionFactory::CreateMediaEngine_w() {
351 ASSERT(worker_thread_ == rtc::Thread::Current()); 357 ASSERT(worker_thread_ == rtc::Thread::Current());
352 return cricket::WebRtcMediaEngineFactory::Create( 358 return cricket::WebRtcMediaEngineFactory::Create(
353 default_adm_.get(), video_encoder_factory_.get(), 359 default_adm_.get(), video_encoder_factory_.get(),
354 video_decoder_factory_.get()); 360 video_decoder_factory_.get());
355 } 361 }
356 362
357 } // namespace webrtc 363 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/api/peerconnectionfactory.h ('k') | webrtc/api/peerconnectioninterface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698