Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 594 LOG(LS_INFO) << "Session: " << id() << " is destroyed."; | 594 LOG(LS_INFO) << "Session: " << id() << " is destroyed."; |
| 595 } | 595 } |
| 596 | 596 |
| 597 bool WebRtcSession::Initialize( | 597 bool WebRtcSession::Initialize( |
| 598 const PeerConnectionFactoryInterface::Options& options, | 598 const PeerConnectionFactoryInterface::Options& options, |
| 599 const MediaConstraintsInterface* constraints, | 599 const MediaConstraintsInterface* constraints, |
| 600 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, | 600 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
| 601 const PeerConnectionInterface::RTCConfiguration& rtc_configuration) { | 601 const PeerConnectionInterface::RTCConfiguration& rtc_configuration) { |
| 602 bundle_policy_ = rtc_configuration.bundle_policy; | 602 bundle_policy_ = rtc_configuration.bundle_policy; |
| 603 rtcp_mux_policy_ = rtc_configuration.rtcp_mux_policy; | 603 rtcp_mux_policy_ = rtc_configuration.rtcp_mux_policy; |
| 604 video_options_.disable_prerenderer_smoothing = | 604 |
| 605 rtc::Optional<bool>(rtc_configuration.disable_prerenderer_smoothing); | |
|
perkj_webrtc
2016/02/09 15:35:37
where do you set disable_prerenderer_smoothing now
nisse-webrtc
2016/02/10 08:53:00
It's copied from RTCConfiguration to MediaConfig.
| |
| 606 transport_controller_->SetSslMaxProtocolVersion(options.ssl_max_version); | 605 transport_controller_->SetSslMaxProtocolVersion(options.ssl_max_version); |
| 607 | 606 |
| 608 // Obtain a certificate from RTCConfiguration if any were provided (optional). | 607 // Obtain a certificate from RTCConfiguration if any were provided (optional). |
| 609 rtc::scoped_refptr<rtc::RTCCertificate> certificate; | 608 rtc::scoped_refptr<rtc::RTCCertificate> certificate; |
| 610 if (!rtc_configuration.certificates.empty()) { | 609 if (!rtc_configuration.certificates.empty()) { |
| 611 // TODO(hbos,torbjorng): Decide on certificate-selection strategy instead of | 610 // TODO(hbos,torbjorng): Decide on certificate-selection strategy instead of |
| 612 // just picking the first one. The decision should be made based on the DTLS | 611 // just picking the first one. The decision should be made based on the DTLS |
| 613 // handshake. The DTLS negotiations need to know about all certificates. | 612 // handshake. The DTLS negotiations need to know about all certificates. |
| 614 certificate = rtc_configuration.certificates[0]; | 613 certificate = rtc_configuration.certificates[0]; |
| 615 } | 614 } |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 642 LOG(LS_INFO) << "Allowing RTP data engine."; | 641 LOG(LS_INFO) << "Allowing RTP data engine."; |
| 643 data_channel_type_ = cricket::DCT_RTP; | 642 data_channel_type_ = cricket::DCT_RTP; |
| 644 } else { | 643 } else { |
| 645 // DTLS has to be enabled to use SCTP. | 644 // DTLS has to be enabled to use SCTP. |
| 646 if (!options.disable_sctp_data_channels && dtls_enabled_) { | 645 if (!options.disable_sctp_data_channels && dtls_enabled_) { |
| 647 LOG(LS_INFO) << "Allowing SCTP data engine."; | 646 LOG(LS_INFO) << "Allowing SCTP data engine."; |
| 648 data_channel_type_ = cricket::DCT_SCTP; | 647 data_channel_type_ = cricket::DCT_SCTP; |
| 649 } | 648 } |
| 650 } | 649 } |
| 651 | 650 |
| 652 // Find DSCP constraint. | |
| 653 if (FindConstraint( | |
| 654 constraints, | |
| 655 MediaConstraintsInterface::kEnableDscp, | |
| 656 &value, NULL)) { | |
| 657 audio_options_.dscp = rtc::Optional<bool>(value); | |
| 658 video_options_.dscp = rtc::Optional<bool>(value); | |
| 659 } | |
| 660 | |
| 661 // Find Suspend Below Min Bitrate constraint. | 651 // Find Suspend Below Min Bitrate constraint. |
| 662 if (FindConstraint( | 652 if (FindConstraint( |
| 663 constraints, | 653 constraints, |
| 664 MediaConstraintsInterface::kEnableVideoSuspendBelowMinBitrate, | 654 MediaConstraintsInterface::kEnableVideoSuspendBelowMinBitrate, |
| 665 &value, | 655 &value, |
| 666 NULL)) { | 656 NULL)) { |
| 667 video_options_.suspend_below_min_bitrate = rtc::Optional<bool>(value); | 657 video_options_.suspend_below_min_bitrate = rtc::Optional<bool>(value); |
| 668 } | 658 } |
| 669 | 659 |
| 670 SetOptionFromOptionalConstraint(constraints, | 660 SetOptionFromOptionalConstraint(constraints, |
| 671 MediaConstraintsInterface::kScreencastMinBitrate, | 661 MediaConstraintsInterface::kScreencastMinBitrate, |
| 672 &video_options_.screencast_min_bitrate_kbps); | 662 &video_options_.screencast_min_bitrate_kbps); |
| 673 | 663 |
| 674 // Find constraints for cpu overuse detection. | |
| 675 SetOptionFromOptionalConstraint(constraints, | |
|
perkj_webrtc
2016/02/09 15:35:37
Add test for this as well?
| |
| 676 MediaConstraintsInterface::kCpuOveruseDetection, | |
| 677 &video_options_.cpu_overuse_detection); | |
| 678 | |
| 679 SetOptionFromOptionalConstraint(constraints, | 664 SetOptionFromOptionalConstraint(constraints, |
| 680 MediaConstraintsInterface::kCombinedAudioVideoBwe, | 665 MediaConstraintsInterface::kCombinedAudioVideoBwe, |
| 681 &audio_options_.combined_audio_video_bwe); | 666 &audio_options_.combined_audio_video_bwe); |
| 682 | 667 |
| 683 audio_options_.audio_jitter_buffer_max_packets = | 668 audio_options_.audio_jitter_buffer_max_packets = |
| 684 rtc::Optional<int>(rtc_configuration.audio_jitter_buffer_max_packets); | 669 rtc::Optional<int>(rtc_configuration.audio_jitter_buffer_max_packets); |
| 685 | 670 |
| 686 audio_options_.audio_jitter_buffer_fast_accelerate = rtc::Optional<bool>( | 671 audio_options_.audio_jitter_buffer_fast_accelerate = rtc::Optional<bool>( |
| 687 rtc_configuration.audio_jitter_buffer_fast_accelerate); | 672 rtc_configuration.audio_jitter_buffer_fast_accelerate); |
| 688 | 673 |
| (...skipping 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2177 } | 2162 } |
| 2178 } | 2163 } |
| 2179 | 2164 |
| 2180 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, | 2165 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, |
| 2181 const rtc::SentPacket& sent_packet) { | 2166 const rtc::SentPacket& sent_packet) { |
| 2182 RTC_DCHECK(worker_thread()->IsCurrent()); | 2167 RTC_DCHECK(worker_thread()->IsCurrent()); |
| 2183 media_controller_->call_w()->OnSentPacket(sent_packet); | 2168 media_controller_->call_w()->OnSentPacket(sent_packet); |
| 2184 } | 2169 } |
| 2185 | 2170 |
| 2186 } // namespace webrtc | 2171 } // namespace webrtc |
| OLD | NEW |