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

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

Issue 1818033002: Embed a cricket::MediaConfig in RTCConfiguration. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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
OLDNEW
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 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 // since it's about to be destroyed. 555 // since it's about to be destroyed.
556 for (const auto& sender : senders_) { 556 for (const auto& sender : senders_) {
557 sender->Stop(); 557 sender->Stop();
558 } 558 }
559 for (const auto& receiver : receivers_) { 559 for (const auto& receiver : receivers_) {
560 receiver->Stop(); 560 receiver->Stop();
561 } 561 }
562 } 562 }
563 563
564 bool PeerConnection::Initialize( 564 bool PeerConnection::Initialize(
565 const cricket::MediaConfig& media_config,
566 const PeerConnectionInterface::RTCConfiguration& configuration, 565 const PeerConnectionInterface::RTCConfiguration& configuration,
567 rtc::scoped_ptr<cricket::PortAllocator> allocator, 566 rtc::scoped_ptr<cricket::PortAllocator> allocator,
568 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, 567 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store,
569 PeerConnectionObserver* observer) { 568 PeerConnectionObserver* observer) {
570 TRACE_EVENT0("webrtc", "PeerConnection::Initialize"); 569 TRACE_EVENT0("webrtc", "PeerConnection::Initialize");
571 RTC_DCHECK(observer != nullptr); 570 RTC_DCHECK(observer != nullptr);
572 if (!observer) { 571 if (!observer) {
573 return false; 572 return false;
574 } 573 }
575 observer_ = observer; 574 observer_ = observer;
(...skipping 23 matching lines...) Expand all
599 598
600 if (configuration.tcp_candidate_policy == kTcpCandidatePolicyDisabled) { 599 if (configuration.tcp_candidate_policy == kTcpCandidatePolicyDisabled) {
601 portallocator_flags |= cricket::PORTALLOCATOR_DISABLE_TCP; 600 portallocator_flags |= cricket::PORTALLOCATOR_DISABLE_TCP;
602 LOG(LS_INFO) << "TCP candidates are disabled."; 601 LOG(LS_INFO) << "TCP candidates are disabled.";
603 } 602 }
604 603
605 port_allocator_->set_flags(portallocator_flags); 604 port_allocator_->set_flags(portallocator_flags);
606 // No step delay is used while allocating ports. 605 // No step delay is used while allocating ports.
607 port_allocator_->set_step_delay(cricket::kMinimumStepDelay); 606 port_allocator_->set_step_delay(cricket::kMinimumStepDelay);
608 607
609 media_controller_.reset(factory_->CreateMediaController(media_config)); 608 media_controller_.reset(
609 factory_->CreateMediaController(configuration.media_config));
610 610
611 remote_stream_factory_.reset( 611 remote_stream_factory_.reset(
612 new RemoteMediaStreamFactory(factory_->signaling_thread())); 612 new RemoteMediaStreamFactory(factory_->signaling_thread()));
613 613
614 session_.reset( 614 session_.reset(
615 new WebRtcSession(media_controller_.get(), factory_->signaling_thread(), 615 new WebRtcSession(media_controller_.get(), factory_->signaling_thread(),
616 factory_->worker_thread(), port_allocator_.get())); 616 factory_->worker_thread(), port_allocator_.get()));
617 stats_.reset(new StatsCollector(this)); 617 stats_.reset(new StatsCollector(this));
618 618
619 // Initialize the WebRtcSession. It creates transport channels etc. 619 // Initialize the WebRtcSession. It creates transport channels etc.
(...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after
2121 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { 2121 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const {
2122 for (const auto& channel : sctp_data_channels_) { 2122 for (const auto& channel : sctp_data_channels_) {
2123 if (channel->id() == sid) { 2123 if (channel->id() == sid) {
2124 return channel; 2124 return channel;
2125 } 2125 }
2126 } 2126 }
2127 return nullptr; 2127 return nullptr;
2128 } 2128 }
2129 2129
2130 } // namespace webrtc 2130 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698