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

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

Issue 1670153003: Introduce struct MediaConfig, with construction-time settings. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed test nit; use reference. Created 4 years, 10 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/mediacontroller.cc ('k') | webrtc/api/peerconnectionfactory.h » ('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 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 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 609
610 if (configuration.tcp_candidate_policy == kTcpCandidatePolicyDisabled) { 610 if (configuration.tcp_candidate_policy == kTcpCandidatePolicyDisabled) {
611 portallocator_flags |= cricket::PORTALLOCATOR_DISABLE_TCP; 611 portallocator_flags |= cricket::PORTALLOCATOR_DISABLE_TCP;
612 LOG(LS_INFO) << "TCP candidates are disabled."; 612 LOG(LS_INFO) << "TCP candidates are disabled.";
613 } 613 }
614 614
615 port_allocator_->set_flags(portallocator_flags); 615 port_allocator_->set_flags(portallocator_flags);
616 // No step delay is used while allocating ports. 616 // No step delay is used while allocating ports.
617 port_allocator_->set_step_delay(cricket::kMinimumStepDelay); 617 port_allocator_->set_step_delay(cricket::kMinimumStepDelay);
618 618
619 media_controller_.reset(factory_->CreateMediaController()); 619 // We rely on default values when constraints aren't found.
620 cricket::MediaConfig media_config;
621
622 media_config.disable_prerenderer_smoothing =
623 configuration.disable_prerenderer_smoothing;
624
625 // Find DSCP constraint.
626 FindConstraint(constraints, MediaConstraintsInterface::kEnableDscp,
627 &media_config.enable_dscp, NULL);
628 // Find constraints for cpu overuse detection.
629 FindConstraint(constraints, MediaConstraintsInterface::kCpuOveruseDetection,
630 &media_config.enable_cpu_overuse_detection, NULL);
631
632 media_controller_.reset(factory_->CreateMediaController(media_config));
620 633
621 remote_stream_factory_.reset(new RemoteMediaStreamFactory( 634 remote_stream_factory_.reset(new RemoteMediaStreamFactory(
622 factory_->signaling_thread(), media_controller_->channel_manager())); 635 factory_->signaling_thread(), media_controller_->channel_manager()));
623 636
624 session_.reset( 637 session_.reset(
625 new WebRtcSession(media_controller_.get(), factory_->signaling_thread(), 638 new WebRtcSession(media_controller_.get(), factory_->signaling_thread(),
626 factory_->worker_thread(), port_allocator_.get())); 639 factory_->worker_thread(), port_allocator_.get()));
627 stats_.reset(new StatsCollector(this)); 640 stats_.reset(new StatsCollector(this));
628 641
629 // Initialize the WebRtcSession. It creates transport channels etc. 642 // Initialize the WebRtcSession. It creates transport channels etc.
(...skipping 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after
2065 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { 2078 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const {
2066 for (const auto& channel : sctp_data_channels_) { 2079 for (const auto& channel : sctp_data_channels_) {
2067 if (channel->id() == sid) { 2080 if (channel->id() == sid) {
2068 return channel; 2081 return channel;
2069 } 2082 }
2070 } 2083 }
2071 return nullptr; 2084 return nullptr;
2072 } 2085 }
2073 2086
2074 } // namespace webrtc 2087 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/api/mediacontroller.cc ('k') | webrtc/api/peerconnectionfactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698