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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 bool muted; |
| 157 int32_t ret = channelPtr->GetAudioFrameWithMuted(channel, frame, &muted); |
| 158 if (muted) { |
| 159 frame->Mute(); |
| 160 } |
| 161 return ret; |
157 } | 162 } |
158 | 163 |
159 int VoEExternalMediaImpl::SetExternalMixing(int channel, bool enable) { | 164 int VoEExternalMediaImpl::SetExternalMixing(int channel, bool enable) { |
160 WEBRTC_TRACE(kTraceApiCall, kTraceVoice, | 165 WEBRTC_TRACE(kTraceApiCall, kTraceVoice, |
161 VoEId(shared_->instance_id(), channel), | 166 VoEId(shared_->instance_id(), channel), |
162 "SetExternalMixing(channel=%d, enable=%d)", channel, enable); | 167 "SetExternalMixing(channel=%d, enable=%d)", channel, enable); |
163 if (!shared_->statistics().Initialized()) { | 168 if (!shared_->statistics().Initialized()) { |
164 shared_->SetLastError(VE_NOT_INITED, kTraceError); | 169 shared_->SetLastError(VE_NOT_INITED, kTraceError); |
165 return -1; | 170 return -1; |
166 } | 171 } |
167 voe::ChannelOwner ch = shared_->channel_manager().GetChannel(channel); | 172 voe::ChannelOwner ch = shared_->channel_manager().GetChannel(channel); |
168 voe::Channel* channelPtr = ch.channel(); | 173 voe::Channel* channelPtr = ch.channel(); |
169 if (channelPtr == NULL) { | 174 if (channelPtr == NULL) { |
170 shared_->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, | 175 shared_->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, |
171 "SetExternalMixing() failed to locate channel"); | 176 "SetExternalMixing() failed to locate channel"); |
172 return -1; | 177 return -1; |
173 } | 178 } |
174 return channelPtr->SetExternalMixing(enable); | 179 return channelPtr->SetExternalMixing(enable); |
175 } | 180 } |
176 | 181 |
177 #endif // WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API | 182 #endif // WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API |
178 | 183 |
179 } // namespace webrtc | 184 } // namespace webrtc |
OLD | NEW |