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

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

Issue 1782053002: 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') | webrtc/voice_engine/channel_proxy.h » ('j') | 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 29 matching lines...) Expand all
40 #include "webrtc/voice_engine/transmit_mixer.h" 40 #include "webrtc/voice_engine/transmit_mixer.h"
41 #include "webrtc/voice_engine/utility.h" 41 #include "webrtc/voice_engine/utility.h"
42 42
43 #if defined(_WIN32) 43 #if defined(_WIN32)
44 #include <Qos.h> 44 #include <Qos.h>
45 #endif 45 #endif
46 46
47 namespace webrtc { 47 namespace webrtc {
48 namespace voe { 48 namespace voe {
49 49
50 const int kTelephoneEventAttenuationdB = 10;
51
50 class TransportFeedbackProxy : public TransportFeedbackObserver { 52 class TransportFeedbackProxy : public TransportFeedbackObserver {
51 public: 53 public:
52 TransportFeedbackProxy() : feedback_observer_(nullptr) { 54 TransportFeedbackProxy() : feedback_observer_(nullptr) {
53 pacer_thread_.DetachFromThread(); 55 pacer_thread_.DetachFromThread();
54 network_thread_.DetachFromThread(); 56 network_thread_.DetachFromThread();
55 } 57 }
56 58
57 void SetTransportFeedbackObserver( 59 void SetTransportFeedbackObserver(
58 TransportFeedbackObserver* feedback_observer) { 60 TransportFeedbackObserver* feedback_observer) {
59 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 61 RTC_DCHECK(thread_checker_.CalledOnValidThread());
(...skipping 2145 matching lines...) Expand 10 before | Expand all | Expand 10 after
2205 _outputGain = scaling; 2207 _outputGain = scaling;
2206 return 0; 2208 return 0;
2207 } 2209 }
2208 2210
2209 int Channel::GetChannelOutputVolumeScaling(float& scaling) const { 2211 int Channel::GetChannelOutputVolumeScaling(float& scaling) const {
2210 rtc::CritScope cs(&volume_settings_critsect_); 2212 rtc::CritScope cs(&volume_settings_critsect_);
2211 scaling = _outputGain; 2213 scaling = _outputGain;
2212 return 0; 2214 return 0;
2213 } 2215 }
2214 2216
2215 int Channel::SendTelephoneEventOutband(unsigned char eventCode, 2217 int Channel::SendTelephoneEventOutband(int event, int duration_ms) {
2216 int lengthMs,
2217 int attenuationDb,
2218 bool playDtmfEvent) {
2219 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), 2218 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
2220 "Channel::SendTelephoneEventOutband(..., playDtmfEvent=%d)", 2219 "Channel::SendTelephoneEventOutband(...)");
2221 playDtmfEvent); 2220 RTC_DCHECK_LE(0, event);
2221 RTC_DCHECK_GE(255, event);
2222 RTC_DCHECK_LE(0, duration_ms);
2223 RTC_DCHECK_GE(65535, duration_ms);
2222 if (!Sending()) { 2224 if (!Sending()) {
2223 return -1; 2225 return -1;
2224 } 2226 }
2225 2227
2226 _playOutbandDtmfEvent = playDtmfEvent; 2228 _playOutbandDtmfEvent = false;
2227 2229
2228 if (_rtpRtcpModule->SendTelephoneEventOutband(eventCode, lengthMs, 2230 if (_rtpRtcpModule->SendTelephoneEventOutband(
2229 attenuationDb) != 0) { 2231 event, duration_ms, kTelephoneEventAttenuationdB) != 0) {
2230 _engineStatisticsPtr->SetLastError( 2232 _engineStatisticsPtr->SetLastError(
2231 VE_SEND_DTMF_FAILED, kTraceWarning, 2233 VE_SEND_DTMF_FAILED, kTraceWarning,
2232 "SendTelephoneEventOutband() failed to send event"); 2234 "SendTelephoneEventOutband() failed to send event");
2233 return -1; 2235 return -1;
2234 } 2236 }
2235 return 0; 2237 return 0;
2236 } 2238 }
2237 2239
2238 int Channel::SendTelephoneEventInband(unsigned char eventCode, 2240 int Channel::SendTelephoneEventInband(unsigned char eventCode,
2239 int lengthMs, 2241 int lengthMs,
(...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after
3647 int64_t min_rtt = 0; 3649 int64_t min_rtt = 0;
3648 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != 3650 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) !=
3649 0) { 3651 0) {
3650 return 0; 3652 return 0;
3651 } 3653 }
3652 return rtt; 3654 return rtt;
3653 } 3655 }
3654 3656
3655 } // namespace voe 3657 } // namespace voe
3656 } // namespace webrtc 3658 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/voice_engine/channel.h ('k') | webrtc/voice_engine/channel_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698