| 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 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 LOG(LS_INFO) << "Session: " << id() << " is destroyed."; | 577 LOG(LS_INFO) << "Session: " << id() << " is destroyed."; |
| 578 } | 578 } |
| 579 | 579 |
| 580 bool WebRtcSession::Initialize( | 580 bool WebRtcSession::Initialize( |
| 581 const PeerConnectionFactoryInterface::Options& options, | 581 const PeerConnectionFactoryInterface::Options& options, |
| 582 const MediaConstraintsInterface* constraints, | 582 const MediaConstraintsInterface* constraints, |
| 583 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, | 583 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
| 584 const PeerConnectionInterface::RTCConfiguration& rtc_configuration) { | 584 const PeerConnectionInterface::RTCConfiguration& rtc_configuration) { |
| 585 bundle_policy_ = rtc_configuration.bundle_policy; | 585 bundle_policy_ = rtc_configuration.bundle_policy; |
| 586 rtcp_mux_policy_ = rtc_configuration.rtcp_mux_policy; | 586 rtcp_mux_policy_ = rtc_configuration.rtcp_mux_policy; |
| 587 video_options_.disable_prerenderer_smoothing = | |
| 588 rtc::Optional<bool>(rtc_configuration.disable_prerenderer_smoothing); | |
| 589 transport_controller_->SetSslMaxProtocolVersion(options.ssl_max_version); | 587 transport_controller_->SetSslMaxProtocolVersion(options.ssl_max_version); |
| 590 | 588 |
| 591 // Obtain a certificate from RTCConfiguration if any were provided (optional). | 589 // Obtain a certificate from RTCConfiguration if any were provided (optional). |
| 592 rtc::scoped_refptr<rtc::RTCCertificate> certificate; | 590 rtc::scoped_refptr<rtc::RTCCertificate> certificate; |
| 593 if (!rtc_configuration.certificates.empty()) { | 591 if (!rtc_configuration.certificates.empty()) { |
| 594 // TODO(hbos,torbjorng): Decide on certificate-selection strategy instead of | 592 // TODO(hbos,torbjorng): Decide on certificate-selection strategy instead of |
| 595 // just picking the first one. The decision should be made based on the DTLS | 593 // just picking the first one. The decision should be made based on the DTLS |
| 596 // handshake. The DTLS negotiations need to know about all certificates. | 594 // handshake. The DTLS negotiations need to know about all certificates. |
| 597 certificate = rtc_configuration.certificates[0]; | 595 certificate = rtc_configuration.certificates[0]; |
| 598 } | 596 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 625 LOG(LS_INFO) << "Allowing RTP data engine."; | 623 LOG(LS_INFO) << "Allowing RTP data engine."; |
| 626 data_channel_type_ = cricket::DCT_RTP; | 624 data_channel_type_ = cricket::DCT_RTP; |
| 627 } else { | 625 } else { |
| 628 // DTLS has to be enabled to use SCTP. | 626 // DTLS has to be enabled to use SCTP. |
| 629 if (!options.disable_sctp_data_channels && dtls_enabled_) { | 627 if (!options.disable_sctp_data_channels && dtls_enabled_) { |
| 630 LOG(LS_INFO) << "Allowing SCTP data engine."; | 628 LOG(LS_INFO) << "Allowing SCTP data engine."; |
| 631 data_channel_type_ = cricket::DCT_SCTP; | 629 data_channel_type_ = cricket::DCT_SCTP; |
| 632 } | 630 } |
| 633 } | 631 } |
| 634 | 632 |
| 635 // Find DSCP constraint. | |
| 636 if (FindConstraint( | |
| 637 constraints, | |
| 638 MediaConstraintsInterface::kEnableDscp, | |
| 639 &value, NULL)) { | |
| 640 audio_options_.dscp = rtc::Optional<bool>(value); | |
| 641 video_options_.dscp = rtc::Optional<bool>(value); | |
| 642 } | |
| 643 | |
| 644 // Find Suspend Below Min Bitrate constraint. | 633 // Find Suspend Below Min Bitrate constraint. |
| 645 if (FindConstraint( | 634 if (FindConstraint( |
| 646 constraints, | 635 constraints, |
| 647 MediaConstraintsInterface::kEnableVideoSuspendBelowMinBitrate, | 636 MediaConstraintsInterface::kEnableVideoSuspendBelowMinBitrate, |
| 648 &value, | 637 &value, |
| 649 NULL)) { | 638 NULL)) { |
| 650 video_options_.suspend_below_min_bitrate = rtc::Optional<bool>(value); | 639 video_options_.suspend_below_min_bitrate = rtc::Optional<bool>(value); |
| 651 } | 640 } |
| 652 | 641 |
| 653 SetOptionFromOptionalConstraint(constraints, | 642 SetOptionFromOptionalConstraint(constraints, |
| 654 MediaConstraintsInterface::kScreencastMinBitrate, | 643 MediaConstraintsInterface::kScreencastMinBitrate, |
| 655 &video_options_.screencast_min_bitrate_kbps); | 644 &video_options_.screencast_min_bitrate_kbps); |
| 656 | 645 |
| 657 // Find constraints for cpu overuse detection. | |
| 658 SetOptionFromOptionalConstraint(constraints, | |
| 659 MediaConstraintsInterface::kCpuOveruseDetection, | |
| 660 &video_options_.cpu_overuse_detection); | |
| 661 | |
| 662 SetOptionFromOptionalConstraint(constraints, | 646 SetOptionFromOptionalConstraint(constraints, |
| 663 MediaConstraintsInterface::kCombinedAudioVideoBwe, | 647 MediaConstraintsInterface::kCombinedAudioVideoBwe, |
| 664 &audio_options_.combined_audio_video_bwe); | 648 &audio_options_.combined_audio_video_bwe); |
| 665 | 649 |
| 666 audio_options_.audio_jitter_buffer_max_packets = | 650 audio_options_.audio_jitter_buffer_max_packets = |
| 667 rtc::Optional<int>(rtc_configuration.audio_jitter_buffer_max_packets); | 651 rtc::Optional<int>(rtc_configuration.audio_jitter_buffer_max_packets); |
| 668 | 652 |
| 669 audio_options_.audio_jitter_buffer_fast_accelerate = rtc::Optional<bool>( | 653 audio_options_.audio_jitter_buffer_fast_accelerate = rtc::Optional<bool>( |
| 670 rtc_configuration.audio_jitter_buffer_fast_accelerate); | 654 rtc_configuration.audio_jitter_buffer_fast_accelerate); |
| 671 | 655 |
| (...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2159 } | 2143 } |
| 2160 } | 2144 } |
| 2161 | 2145 |
| 2162 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, | 2146 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, |
| 2163 const rtc::SentPacket& sent_packet) { | 2147 const rtc::SentPacket& sent_packet) { |
| 2164 RTC_DCHECK(worker_thread()->IsCurrent()); | 2148 RTC_DCHECK(worker_thread()->IsCurrent()); |
| 2165 media_controller_->call_w()->OnSentPacket(sent_packet); | 2149 media_controller_->call_w()->OnSentPacket(sent_packet); |
| 2166 } | 2150 } |
| 2167 | 2151 |
| 2168 } // namespace webrtc | 2152 } // namespace webrtc |
| OLD | NEW |