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

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

Issue 1986093002: Propagate muted info from VoE Channel to AudioConferenceMixer (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@mixer-mod-3
Patch Set: Fixing win build Created 4 years, 7 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.cc ('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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 "GetAudioFrame() was called on channel that is not playing."); 146 "GetAudioFrame() was called on channel that is not playing.");
147 return -1; 147 return -1;
148 } 148 }
149 if (desired_sample_rate_hz == -1) { 149 if (desired_sample_rate_hz == -1) {
150 shared_->SetLastError(VE_BAD_ARGUMENT, kTraceError, 150 shared_->SetLastError(VE_BAD_ARGUMENT, kTraceError,
151 "GetAudioFrame() was called with bad sample rate."); 151 "GetAudioFrame() was called with bad sample rate.");
152 return -1; 152 return -1;
153 } 153 }
154 frame->sample_rate_hz_ = 154 frame->sample_rate_hz_ =
155 desired_sample_rate_hz == 0 ? -1 : desired_sample_rate_hz; 155 desired_sample_rate_hz == 0 ? -1 : desired_sample_rate_hz;
156 return channelPtr->GetAudioFrame(channel, frame); 156 auto ret = channelPtr->GetAudioFrameWithMuted(channel, frame);
157 if (ret == MixerParticipant::AudioFrameInfo::kMuted) {
158 frame->Mute();
159 }
160 return ret == MixerParticipant::AudioFrameInfo::kError ? -1 : 0;
157 } 161 }
158 162
159 int VoEExternalMediaImpl::SetExternalMixing(int channel, bool enable) { 163 int VoEExternalMediaImpl::SetExternalMixing(int channel, bool enable) {
160 WEBRTC_TRACE(kTraceApiCall, kTraceVoice, 164 WEBRTC_TRACE(kTraceApiCall, kTraceVoice,
161 VoEId(shared_->instance_id(), channel), 165 VoEId(shared_->instance_id(), channel),
162 "SetExternalMixing(channel=%d, enable=%d)", channel, enable); 166 "SetExternalMixing(channel=%d, enable=%d)", channel, enable);
163 if (!shared_->statistics().Initialized()) { 167 if (!shared_->statistics().Initialized()) {
164 shared_->SetLastError(VE_NOT_INITED, kTraceError); 168 shared_->SetLastError(VE_NOT_INITED, kTraceError);
165 return -1; 169 return -1;
166 } 170 }
167 voe::ChannelOwner ch = shared_->channel_manager().GetChannel(channel); 171 voe::ChannelOwner ch = shared_->channel_manager().GetChannel(channel);
168 voe::Channel* channelPtr = ch.channel(); 172 voe::Channel* channelPtr = ch.channel();
169 if (channelPtr == NULL) { 173 if (channelPtr == NULL) {
170 shared_->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, 174 shared_->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError,
171 "SetExternalMixing() failed to locate channel"); 175 "SetExternalMixing() failed to locate channel");
172 return -1; 176 return -1;
173 } 177 }
174 return channelPtr->SetExternalMixing(enable); 178 return channelPtr->SetExternalMixing(enable);
175 } 179 }
176 180
177 #endif // WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API 181 #endif // WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API
178 182
179 } // namespace webrtc 183 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/voice_engine/channel.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698