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