| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 "Called with SDP without SDES crypto."; | 85 "Called with SDP without SDES crypto."; |
| 86 const char kSdpWithoutIceUfragPwd[] = | 86 const char kSdpWithoutIceUfragPwd[] = |
| 87 "Called with SDP without ice-ufrag and ice-pwd."; | 87 "Called with SDP without ice-ufrag and ice-pwd."; |
| 88 const char kSessionError[] = "Session error code: "; | 88 const char kSessionError[] = "Session error code: "; |
| 89 const char kSessionErrorDesc[] = "Session error description: "; | 89 const char kSessionErrorDesc[] = "Session error description: "; |
| 90 const char kDtlsSetupFailureRtp[] = | 90 const char kDtlsSetupFailureRtp[] = |
| 91 "Couldn't set up DTLS-SRTP on RTP channel."; | 91 "Couldn't set up DTLS-SRTP on RTP channel."; |
| 92 const char kDtlsSetupFailureRtcp[] = | 92 const char kDtlsSetupFailureRtcp[] = |
| 93 "Couldn't set up DTLS-SRTP on RTCP channel."; | 93 "Couldn't set up DTLS-SRTP on RTCP channel."; |
| 94 const char kEnableBundleFailed[] = "Failed to enable BUNDLE."; | 94 const char kEnableBundleFailed[] = "Failed to enable BUNDLE."; |
| 95 const int kMaxUnsignalledRecvStreams = 20; | |
| 96 | 95 |
| 97 IceCandidatePairType GetIceCandidatePairCounter( | 96 IceCandidatePairType GetIceCandidatePairCounter( |
| 98 const cricket::Candidate& local, | 97 const cricket::Candidate& local, |
| 99 const cricket::Candidate& remote) { | 98 const cricket::Candidate& remote) { |
| 100 const auto& l = local.type(); | 99 const auto& l = local.type(); |
| 101 const auto& r = remote.type(); | 100 const auto& r = remote.type(); |
| 102 const auto& host = LOCAL_PORT_TYPE; | 101 const auto& host = LOCAL_PORT_TYPE; |
| 103 const auto& srflx = STUN_PORT_TYPE; | 102 const auto& srflx = STUN_PORT_TYPE; |
| 104 const auto& relay = RELAY_PORT_TYPE; | 103 const auto& relay = RELAY_PORT_TYPE; |
| 105 const auto& prflx = PRFLX_PORT_TYPE; | 104 const auto& prflx = PRFLX_PORT_TYPE; |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 if (FindConstraint( | 662 if (FindConstraint( |
| 664 constraints, | 663 constraints, |
| 665 MediaConstraintsInterface::kEnableVideoSuspendBelowMinBitrate, | 664 MediaConstraintsInterface::kEnableVideoSuspendBelowMinBitrate, |
| 666 &value, | 665 &value, |
| 667 NULL)) { | 666 NULL)) { |
| 668 video_options_.suspend_below_min_bitrate = rtc::Optional<bool>(value); | 667 video_options_.suspend_below_min_bitrate = rtc::Optional<bool>(value); |
| 669 } | 668 } |
| 670 | 669 |
| 671 SetOptionFromOptionalConstraint(constraints, | 670 SetOptionFromOptionalConstraint(constraints, |
| 672 MediaConstraintsInterface::kScreencastMinBitrate, | 671 MediaConstraintsInterface::kScreencastMinBitrate, |
| 673 &video_options_.screencast_min_bitrate); | 672 &video_options_.screencast_min_bitrate_kbps); |
| 674 | 673 |
| 675 // Find constraints for cpu overuse detection. | 674 // Find constraints for cpu overuse detection. |
| 676 SetOptionFromOptionalConstraint(constraints, | 675 SetOptionFromOptionalConstraint(constraints, |
| 677 MediaConstraintsInterface::kCpuUnderuseThreshold, | |
| 678 &video_options_.cpu_underuse_threshold); | |
| 679 SetOptionFromOptionalConstraint(constraints, | |
| 680 MediaConstraintsInterface::kCpuOveruseThreshold, | |
| 681 &video_options_.cpu_overuse_threshold); | |
| 682 SetOptionFromOptionalConstraint(constraints, | |
| 683 MediaConstraintsInterface::kCpuOveruseDetection, | 676 MediaConstraintsInterface::kCpuOveruseDetection, |
| 684 &video_options_.cpu_overuse_detection); | 677 &video_options_.cpu_overuse_detection); |
| 685 SetOptionFromOptionalConstraint(constraints, | |
| 686 MediaConstraintsInterface::kCpuOveruseEncodeUsage, | |
| 687 &video_options_.cpu_overuse_encode_usage); | |
| 688 SetOptionFromOptionalConstraint(constraints, | |
| 689 MediaConstraintsInterface::kCpuUnderuseEncodeRsdThreshold, | |
| 690 &video_options_.cpu_underuse_encode_rsd_threshold); | |
| 691 SetOptionFromOptionalConstraint(constraints, | |
| 692 MediaConstraintsInterface::kCpuOveruseEncodeRsdThreshold, | |
| 693 &video_options_.cpu_overuse_encode_rsd_threshold); | |
| 694 | |
| 695 SetOptionFromOptionalConstraint(constraints, | |
| 696 MediaConstraintsInterface::kNumUnsignalledRecvStreams, | |
| 697 &video_options_.unsignalled_recv_stream_limit); | |
| 698 if (video_options_.unsignalled_recv_stream_limit) { | |
| 699 video_options_.unsignalled_recv_stream_limit = rtc::Optional<int>( | |
| 700 std::max(0, std::min(kMaxUnsignalledRecvStreams, | |
| 701 *video_options_.unsignalled_recv_stream_limit))); | |
| 702 } | |
| 703 | |
| 704 SetOptionFromOptionalConstraint(constraints, | |
| 705 MediaConstraintsInterface::kHighStartBitrate, | |
| 706 &video_options_.video_start_bitrate); | |
| 707 | 678 |
| 708 SetOptionFromOptionalConstraint(constraints, | 679 SetOptionFromOptionalConstraint(constraints, |
| 709 MediaConstraintsInterface::kCombinedAudioVideoBwe, | 680 MediaConstraintsInterface::kCombinedAudioVideoBwe, |
| 710 &audio_options_.combined_audio_video_bwe); | 681 &audio_options_.combined_audio_video_bwe); |
| 711 | 682 |
| 712 audio_options_.audio_jitter_buffer_max_packets = | 683 audio_options_.audio_jitter_buffer_max_packets = |
| 713 rtc::Optional<int>(rtc_configuration.audio_jitter_buffer_max_packets); | 684 rtc::Optional<int>(rtc_configuration.audio_jitter_buffer_max_packets); |
| 714 | 685 |
| 715 audio_options_.audio_jitter_buffer_fast_accelerate = rtc::Optional<bool>( | 686 audio_options_.audio_jitter_buffer_fast_accelerate = rtc::Optional<bool>( |
| 716 rtc_configuration.audio_jitter_buffer_fast_accelerate); | 687 rtc_configuration.audio_jitter_buffer_fast_accelerate); |
| (...skipping 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2205 } | 2176 } |
| 2206 } | 2177 } |
| 2207 | 2178 |
| 2208 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, | 2179 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, |
| 2209 const rtc::SentPacket& sent_packet) { | 2180 const rtc::SentPacket& sent_packet) { |
| 2210 RTC_DCHECK(worker_thread()->IsCurrent()); | 2181 RTC_DCHECK(worker_thread()->IsCurrent()); |
| 2211 media_controller_->call_w()->OnSentPacket(sent_packet); | 2182 media_controller_->call_w()->OnSentPacket(sent_packet); |
| 2212 } | 2183 } |
| 2213 | 2184 |
| 2214 } // namespace webrtc | 2185 } // namespace webrtc |
| OLD | NEW |