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

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

Issue 1810413002: Avoid clicks when muting/unmuting a voe::Channel. (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
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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 return _shared->transmit_mixer()->SetMute(enable); 208 return _shared->transmit_mixer()->SetMute(enable);
209 } 209 }
210 // Mute after demultiplexing <=> affects one channel only 210 // Mute after demultiplexing <=> affects one channel only
211 voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 211 voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel);
212 voe::Channel* channelPtr = ch.channel(); 212 voe::Channel* channelPtr = ch.channel();
213 if (channelPtr == NULL) { 213 if (channelPtr == NULL) {
214 _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, 214 _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError,
215 "SetInputMute() failed to locate channel"); 215 "SetInputMute() failed to locate channel");
216 return -1; 216 return -1;
217 } 217 }
218 return channelPtr->SetMute(enable); 218 return channelPtr->SetInputMute(enable);
219 } 219 }
220 220
221 int VoEVolumeControlImpl::GetInputMute(int channel, bool& enabled) { 221 int VoEVolumeControlImpl::GetInputMute(int channel, bool& enabled) {
222 if (!_shared->statistics().Initialized()) { 222 if (!_shared->statistics().Initialized()) {
223 _shared->SetLastError(VE_NOT_INITED, kTraceError); 223 _shared->SetLastError(VE_NOT_INITED, kTraceError);
224 return -1; 224 return -1;
225 } 225 }
226 if (channel == -1) { 226 if (channel == -1) {
227 enabled = _shared->transmit_mixer()->Mute(); 227 enabled = _shared->transmit_mixer()->Mute();
228 } else { 228 } else {
229 voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel); 229 voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel);
230 voe::Channel* channelPtr = ch.channel(); 230 voe::Channel* channelPtr = ch.channel();
231 if (channelPtr == NULL) { 231 if (channelPtr == NULL) {
232 _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, 232 _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError,
233 "SetInputMute() failed to locate channel"); 233 "SetInputMute() failed to locate channel");
234 return -1; 234 return -1;
235 } 235 }
236 enabled = channelPtr->Mute(); 236 enabled = channelPtr->InputMute();
237 } 237 }
238 return 0; 238 return 0;
239 } 239 }
240 240
241 int VoEVolumeControlImpl::GetSpeechInputLevel(unsigned int& level) { 241 int VoEVolumeControlImpl::GetSpeechInputLevel(unsigned int& level) {
242 if (!_shared->statistics().Initialized()) { 242 if (!_shared->statistics().Initialized()) {
243 _shared->SetLastError(VE_NOT_INITED, kTraceError); 243 _shared->SetLastError(VE_NOT_INITED, kTraceError);
244 return -1; 244 return -1;
245 } 245 }
246 int8_t currentLevel = _shared->transmit_mixer()->AudioLevel(); 246 int8_t currentLevel = _shared->transmit_mixer()->AudioLevel();
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, 410 _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError,
411 "GetOutputVolumePan() failed to locate channel"); 411 "GetOutputVolumePan() failed to locate channel");
412 return -1; 412 return -1;
413 } 413 }
414 return channelPtr->GetOutputVolumePan(left, right); 414 return channelPtr->GetOutputVolumePan(left, right);
415 } 415 }
416 416
417 #endif // #ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API 417 #endif // #ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API
418 418
419 } // namespace webrtc 419 } // namespace webrtc
OLDNEW
« webrtc/voice_engine/transmit_mixer.cc ('K') | « webrtc/voice_engine/transmit_mixer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698