OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 // since it's about to be destroyed. | 518 // since it's about to be destroyed. |
519 for (const auto& sender : senders_) { | 519 for (const auto& sender : senders_) { |
520 sender->Stop(); | 520 sender->Stop(); |
521 } | 521 } |
522 for (const auto& receiver : receivers_) { | 522 for (const auto& receiver : receivers_) { |
523 receiver->Stop(); | 523 receiver->Stop(); |
524 } | 524 } |
525 } | 525 } |
526 | 526 |
527 bool PeerConnection::Initialize( | 527 bool PeerConnection::Initialize( |
528 const cricket::MediaConfig& media_config, | |
529 const PeerConnectionInterface::RTCConfiguration& configuration, | 528 const PeerConnectionInterface::RTCConfiguration& configuration, |
530 rtc::scoped_ptr<cricket::PortAllocator> allocator, | 529 rtc::scoped_ptr<cricket::PortAllocator> allocator, |
531 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, | 530 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
532 PeerConnectionObserver* observer) { | 531 PeerConnectionObserver* observer) { |
533 TRACE_EVENT0("webrtc", "PeerConnection::Initialize"); | 532 TRACE_EVENT0("webrtc", "PeerConnection::Initialize"); |
534 RTC_DCHECK(observer != nullptr); | 533 RTC_DCHECK(observer != nullptr); |
535 if (!observer) { | 534 if (!observer) { |
536 return false; | 535 return false; |
537 } | 536 } |
538 observer_ = observer; | 537 observer_ = observer; |
(...skipping 23 matching lines...) Expand all Loading... |
562 | 561 |
563 if (configuration.tcp_candidate_policy == kTcpCandidatePolicyDisabled) { | 562 if (configuration.tcp_candidate_policy == kTcpCandidatePolicyDisabled) { |
564 portallocator_flags |= cricket::PORTALLOCATOR_DISABLE_TCP; | 563 portallocator_flags |= cricket::PORTALLOCATOR_DISABLE_TCP; |
565 LOG(LS_INFO) << "TCP candidates are disabled."; | 564 LOG(LS_INFO) << "TCP candidates are disabled."; |
566 } | 565 } |
567 | 566 |
568 port_allocator_->set_flags(portallocator_flags); | 567 port_allocator_->set_flags(portallocator_flags); |
569 // No step delay is used while allocating ports. | 568 // No step delay is used while allocating ports. |
570 port_allocator_->set_step_delay(cricket::kMinimumStepDelay); | 569 port_allocator_->set_step_delay(cricket::kMinimumStepDelay); |
571 | 570 |
572 media_controller_.reset(factory_->CreateMediaController(media_config)); | 571 media_controller_.reset( |
| 572 factory_->CreateMediaController(configuration.media_config)); |
573 | 573 |
574 session_.reset( | 574 session_.reset( |
575 new WebRtcSession(media_controller_.get(), factory_->signaling_thread(), | 575 new WebRtcSession(media_controller_.get(), factory_->signaling_thread(), |
576 factory_->worker_thread(), port_allocator_.get())); | 576 factory_->worker_thread(), port_allocator_.get())); |
577 stats_.reset(new StatsCollector(this)); | 577 stats_.reset(new StatsCollector(this)); |
578 | 578 |
579 // Initialize the WebRtcSession. It creates transport channels etc. | 579 // Initialize the WebRtcSession. It creates transport channels etc. |
580 if (!session_->Initialize(factory_->options(), std::move(dtls_identity_store), | 580 if (!session_->Initialize(factory_->options(), std::move(dtls_identity_store), |
581 configuration)) { | 581 configuration)) { |
582 return false; | 582 return false; |
(...skipping 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2058 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { | 2058 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { |
2059 for (const auto& channel : sctp_data_channels_) { | 2059 for (const auto& channel : sctp_data_channels_) { |
2060 if (channel->id() == sid) { | 2060 if (channel->id() == sid) { |
2061 return channel; | 2061 return channel; |
2062 } | 2062 } |
2063 } | 2063 } |
2064 return nullptr; | 2064 return nullptr; |
2065 } | 2065 } |
2066 | 2066 |
2067 } // namespace webrtc | 2067 } // namespace webrtc |
OLD | NEW |