Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(900)

Side by Side Diff: webrtc/voice_engine/channel.cc

Issue 1804523002: Relanding https://codereview.webrtc.org/1715883002/ in pieces. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/voice_engine/channel.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 return true; 353 return true;
354 } 354 }
355 355
356 void Channel::OnPlayTelephoneEvent(uint8_t event, 356 void Channel::OnPlayTelephoneEvent(uint8_t event,
357 uint16_t lengthMs, 357 uint16_t lengthMs,
358 uint8_t volume) { 358 uint8_t volume) {
359 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, _channelId), 359 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, _channelId),
360 "Channel::OnPlayTelephoneEvent(event=%u, lengthMs=%u," 360 "Channel::OnPlayTelephoneEvent(event=%u, lengthMs=%u,"
361 " volume=%u)", 361 " volume=%u)",
362 event, lengthMs, volume); 362 event, lengthMs, volume);
363
364 if (!_playOutbandDtmfEvent || event > 15) {
365 // Ignore callback since feedback is disabled or event is not a
366 // Dtmf tone event.
367 return;
368 }
369
370 assert(_outputMixerPtr != NULL);
371
372 // Start playing out the Dtmf tone (if playout is enabled).
373 // Reduce length of tone with 80ms to the reduce risk of echo.
374 _outputMixerPtr->PlayDtmfTone(event, lengthMs - 80, volume);
375 } 363 }
376 364
377 void Channel::OnIncomingSSRCChanged(uint32_t ssrc) { 365 void Channel::OnIncomingSSRCChanged(uint32_t ssrc) {
378 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), 366 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
379 "Channel::OnIncomingSSRCChanged(SSRC=%d)", ssrc); 367 "Channel::OnIncomingSSRCChanged(SSRC=%d)", ssrc);
380 368
381 // Update ssrc so that NTP for AV sync can be updated. 369 // Update ssrc so that NTP for AV sync can be updated.
382 _rtpRtcpModule->SetRemoteSSRC(ssrc); 370 _rtpRtcpModule->SetRemoteSSRC(ssrc);
383 } 371 }
384 372
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 _transportPtr(NULL), 772 _transportPtr(NULL),
785 _rxVadObserverPtr(NULL), 773 _rxVadObserverPtr(NULL),
786 _oldVadDecision(-1), 774 _oldVadDecision(-1),
787 _sendFrameType(0), 775 _sendFrameType(0),
788 _externalMixing(false), 776 _externalMixing(false),
789 _mixFileWithMicrophone(false), 777 _mixFileWithMicrophone(false),
790 _mute(false), 778 _mute(false),
791 _panLeft(1.0f), 779 _panLeft(1.0f),
792 _panRight(1.0f), 780 _panRight(1.0f),
793 _outputGain(1.0f), 781 _outputGain(1.0f),
794 _playOutbandDtmfEvent(false),
795 _lastLocalTimeStamp(0), 782 _lastLocalTimeStamp(0),
796 _lastPayloadType(0), 783 _lastPayloadType(0),
797 _includeAudioLevelIndication(false), 784 _includeAudioLevelIndication(false),
798 _outputSpeechType(AudioFrame::kNormalSpeech), 785 _outputSpeechType(AudioFrame::kNormalSpeech),
799 _average_jitter_buffer_delay_us(0), 786 _average_jitter_buffer_delay_us(0),
800 _previousTimestamp(0), 787 _previousTimestamp(0),
801 _recPacketDelayMs(20), 788 _recPacketDelayMs(20),
802 _RxVadDetection(false), 789 _RxVadDetection(false),
803 _rxAgcIsEnabled(false), 790 _rxAgcIsEnabled(false),
804 _rxNsIsEnabled(false), 791 _rxNsIsEnabled(false),
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after
2208 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), 2195 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
2209 "Channel::SendTelephoneEventOutband(...)"); 2196 "Channel::SendTelephoneEventOutband(...)");
2210 RTC_DCHECK_LE(0, event); 2197 RTC_DCHECK_LE(0, event);
2211 RTC_DCHECK_GE(255, event); 2198 RTC_DCHECK_GE(255, event);
2212 RTC_DCHECK_LE(0, duration_ms); 2199 RTC_DCHECK_LE(0, duration_ms);
2213 RTC_DCHECK_GE(65535, duration_ms); 2200 RTC_DCHECK_GE(65535, duration_ms);
2214 if (!Sending()) { 2201 if (!Sending()) {
2215 return -1; 2202 return -1;
2216 } 2203 }
2217 2204
2218 _playOutbandDtmfEvent = false;
2219
2220 if (_rtpRtcpModule->SendTelephoneEventOutband( 2205 if (_rtpRtcpModule->SendTelephoneEventOutband(
2221 event, duration_ms, kTelephoneEventAttenuationdB) != 0) { 2206 event, duration_ms, kTelephoneEventAttenuationdB) != 0) {
2222 _engineStatisticsPtr->SetLastError( 2207 _engineStatisticsPtr->SetLastError(
2223 VE_SEND_DTMF_FAILED, kTraceWarning, 2208 VE_SEND_DTMF_FAILED, kTraceWarning,
2224 "SendTelephoneEventOutband() failed to send event"); 2209 "SendTelephoneEventOutband() failed to send event");
2225 return -1; 2210 return -1;
2226 } 2211 }
2227 return 0; 2212 return 0;
2228 } 2213 }
2229 2214
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after
3555 int64_t min_rtt = 0; 3540 int64_t min_rtt = 0;
3556 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != 3541 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) !=
3557 0) { 3542 0) {
3558 return 0; 3543 return 0;
3559 } 3544 }
3560 return rtt; 3545 return rtt;
3561 } 3546 }
3562 3547
3563 } // namespace voe 3548 } // namespace voe
3564 } // namespace webrtc 3549 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/voice_engine/channel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698