OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 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 2771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2782 | 2782 |
2783 void Channel::SetRTCPStatus(bool enable) { | 2783 void Channel::SetRTCPStatus(bool enable) { |
2784 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), | 2784 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), |
2785 "Channel::SetRTCPStatus()"); | 2785 "Channel::SetRTCPStatus()"); |
2786 _rtpRtcpModule->SetRTCPStatus(enable ? kRtcpCompound : kRtcpOff); | 2786 _rtpRtcpModule->SetRTCPStatus(enable ? kRtcpCompound : kRtcpOff); |
2787 } | 2787 } |
2788 | 2788 |
2789 int | 2789 int |
2790 Channel::GetRTCPStatus(bool& enabled) | 2790 Channel::GetRTCPStatus(bool& enabled) |
2791 { | 2791 { |
2792 RTCPMethod method = _rtpRtcpModule->RTCP(); | 2792 RtcpMode method = _rtpRtcpModule->RTCP(); |
2793 enabled = (method != kRtcpOff); | 2793 enabled = (method != kRtcpOff); |
2794 return 0; | 2794 return 0; |
2795 } | 2795 } |
2796 | 2796 |
2797 int | 2797 int |
2798 Channel::SetRTCP_CNAME(const char cName[256]) | 2798 Channel::SetRTCP_CNAME(const char cName[256]) |
2799 { | 2799 { |
2800 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), | 2800 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), |
2801 "Channel::SetRTCP_CNAME()"); | 2801 "Channel::SetRTCP_CNAME()"); |
2802 if (_rtpRtcpModule->SetCNAME(cName) != 0) | 2802 if (_rtpRtcpModule->SetCNAME(cName) != 0) |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2929 "SendApplicationDefinedRTCPPacket() invalid data value"); | 2929 "SendApplicationDefinedRTCPPacket() invalid data value"); |
2930 return -1; | 2930 return -1; |
2931 } | 2931 } |
2932 if (dataLengthInBytes % 4 != 0) | 2932 if (dataLengthInBytes % 4 != 0) |
2933 { | 2933 { |
2934 _engineStatisticsPtr->SetLastError( | 2934 _engineStatisticsPtr->SetLastError( |
2935 VE_INVALID_ARGUMENT, kTraceError, | 2935 VE_INVALID_ARGUMENT, kTraceError, |
2936 "SendApplicationDefinedRTCPPacket() invalid length value"); | 2936 "SendApplicationDefinedRTCPPacket() invalid length value"); |
2937 return -1; | 2937 return -1; |
2938 } | 2938 } |
2939 RTCPMethod status = _rtpRtcpModule->RTCP(); | 2939 RtcpMode status = _rtpRtcpModule->RTCP(); |
2940 if (status == kRtcpOff) | 2940 if (status == kRtcpOff) |
2941 { | 2941 { |
2942 _engineStatisticsPtr->SetLastError( | 2942 _engineStatisticsPtr->SetLastError( |
2943 VE_RTCP_ERROR, kTraceError, | 2943 VE_RTCP_ERROR, kTraceError, |
2944 "SendApplicationDefinedRTCPPacket() RTCP is disabled"); | 2944 "SendApplicationDefinedRTCPPacket() RTCP is disabled"); |
2945 return -1; | 2945 return -1; |
2946 } | 2946 } |
2947 | 2947 |
2948 // Create and schedule the RTCP APP packet for transmission | 2948 // Create and schedule the RTCP APP packet for transmission |
2949 if (_rtpRtcpModule->SetRTCPApplicationSpecificData( | 2949 if (_rtpRtcpModule->SetRTCPApplicationSpecificData( |
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3904 // DSP routines can operate at 48,000 Hz, but the RTP clock | 3904 // DSP routines can operate at 48,000 Hz, but the RTP clock |
3905 // rate for the Opus payload format is standardized to 48,000 Hz, | 3905 // rate for the Opus payload format is standardized to 48,000 Hz, |
3906 // because that is the maximum supported decoding sampling rate. | 3906 // because that is the maximum supported decoding sampling rate. |
3907 playout_frequency = 48000; | 3907 playout_frequency = 48000; |
3908 } | 3908 } |
3909 } | 3909 } |
3910 return playout_frequency; | 3910 return playout_frequency; |
3911 } | 3911 } |
3912 | 3912 |
3913 int64_t Channel::GetRTT(bool allow_associate_channel) const { | 3913 int64_t Channel::GetRTT(bool allow_associate_channel) const { |
3914 RTCPMethod method = _rtpRtcpModule->RTCP(); | 3914 RtcpMode method = _rtpRtcpModule->RTCP(); |
3915 if (method == kRtcpOff) { | 3915 if (method == kRtcpOff) { |
3916 return 0; | 3916 return 0; |
3917 } | 3917 } |
3918 std::vector<RTCPReportBlock> report_blocks; | 3918 std::vector<RTCPReportBlock> report_blocks; |
3919 _rtpRtcpModule->RemoteRTCPStat(&report_blocks); | 3919 _rtpRtcpModule->RemoteRTCPStat(&report_blocks); |
3920 | 3920 |
3921 int64_t rtt = 0; | 3921 int64_t rtt = 0; |
3922 if (report_blocks.empty()) { | 3922 if (report_blocks.empty()) { |
3923 if (allow_associate_channel) { | 3923 if (allow_associate_channel) { |
3924 CriticalSectionScoped lock(assoc_send_channel_lock_.get()); | 3924 CriticalSectionScoped lock(assoc_send_channel_lock_.get()); |
(...skipping 29 matching lines...) Expand all Loading... |
3954 int64_t min_rtt = 0; | 3954 int64_t min_rtt = 0; |
3955 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) | 3955 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) |
3956 != 0) { | 3956 != 0) { |
3957 return 0; | 3957 return 0; |
3958 } | 3958 } |
3959 return rtt; | 3959 return rtt; |
3960 } | 3960 } |
3961 | 3961 |
3962 } // namespace voe | 3962 } // namespace voe |
3963 } // namespace webrtc | 3963 } // namespace webrtc |
OLD | NEW |