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 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |