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 2278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2289 if (_rtpRtcpModule->SendTelephoneEventOutband( | 2289 if (_rtpRtcpModule->SendTelephoneEventOutband( |
2290 event, duration_ms, kTelephoneEventAttenuationdB) != 0) { | 2290 event, duration_ms, kTelephoneEventAttenuationdB) != 0) { |
2291 _engineStatisticsPtr->SetLastError( | 2291 _engineStatisticsPtr->SetLastError( |
2292 VE_SEND_DTMF_FAILED, kTraceWarning, | 2292 VE_SEND_DTMF_FAILED, kTraceWarning, |
2293 "SendTelephoneEventOutband() failed to send event"); | 2293 "SendTelephoneEventOutband() failed to send event"); |
2294 return -1; | 2294 return -1; |
2295 } | 2295 } |
2296 return 0; | 2296 return 0; |
2297 } | 2297 } |
2298 | 2298 |
2299 int Channel::SetSendTelephoneEventPayloadType(int payload_type) { | 2299 int Channel::SetSendTelephoneEventPayloadType(int payload_type, |
| 2300 int payload_frequency) { |
2300 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), | 2301 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), |
2301 "Channel::SetSendTelephoneEventPayloadType()"); | 2302 "Channel::SetSendTelephoneEventPayloadType()"); |
2302 RTC_DCHECK_LE(0, payload_type); | 2303 RTC_DCHECK_LE(0, payload_type); |
2303 RTC_DCHECK_GE(127, payload_type); | 2304 RTC_DCHECK_GE(127, payload_type); |
2304 CodecInst codec = {0}; | 2305 CodecInst codec = {0}; |
2305 codec.plfreq = 8000; | |
2306 codec.pltype = payload_type; | 2306 codec.pltype = payload_type; |
| 2307 codec.plfreq = payload_frequency; |
2307 memcpy(codec.plname, "telephone-event", 16); | 2308 memcpy(codec.plname, "telephone-event", 16); |
2308 if (_rtpRtcpModule->RegisterSendPayload(codec) != 0) { | 2309 if (_rtpRtcpModule->RegisterSendPayload(codec) != 0) { |
2309 _rtpRtcpModule->DeRegisterSendPayload(codec.pltype); | 2310 _rtpRtcpModule->DeRegisterSendPayload(codec.pltype); |
2310 if (_rtpRtcpModule->RegisterSendPayload(codec) != 0) { | 2311 if (_rtpRtcpModule->RegisterSendPayload(codec) != 0) { |
2311 _engineStatisticsPtr->SetLastError( | 2312 _engineStatisticsPtr->SetLastError( |
2312 VE_RTP_RTCP_MODULE_ERROR, kTraceError, | 2313 VE_RTP_RTCP_MODULE_ERROR, kTraceError, |
2313 "SetSendTelephoneEventPayloadType() failed to register send" | 2314 "SetSendTelephoneEventPayloadType() failed to register send" |
2314 "payload type"); | 2315 "payload type"); |
2315 return -1; | 2316 return -1; |
2316 } | 2317 } |
(...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3239 int64_t min_rtt = 0; | 3240 int64_t min_rtt = 0; |
3240 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != | 3241 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != |
3241 0) { | 3242 0) { |
3242 return 0; | 3243 return 0; |
3243 } | 3244 } |
3244 return rtt; | 3245 return rtt; |
3245 } | 3246 } |
3246 | 3247 |
3247 } // namespace voe | 3248 } // namespace voe |
3248 } // namespace webrtc | 3249 } // namespace webrtc |
OLD | NEW |