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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 "GetAudioFrame() was called on channel that is not playing."); | 151 "GetAudioFrame() was called on channel that is not playing."); |
152 return -1; | 152 return -1; |
153 } | 153 } |
154 if (desired_sample_rate_hz == -1) { | 154 if (desired_sample_rate_hz == -1) { |
155 shared_->SetLastError(VE_BAD_ARGUMENT, kTraceError, | 155 shared_->SetLastError(VE_BAD_ARGUMENT, kTraceError, |
156 "GetAudioFrame() was called with bad sample rate."); | 156 "GetAudioFrame() was called with bad sample rate."); |
157 return -1; | 157 return -1; |
158 } | 158 } |
159 frame->sample_rate_hz_ = | 159 frame->sample_rate_hz_ = |
160 desired_sample_rate_hz == 0 ? -1 : desired_sample_rate_hz; | 160 desired_sample_rate_hz == 0 ? -1 : desired_sample_rate_hz; |
161 return channelPtr->GetAudioFrame(channel, *frame); | 161 return channelPtr->GetAudioFrame(channel, frame); |
162 } | 162 } |
163 | 163 |
164 int VoEExternalMediaImpl::SetExternalMixing(int channel, bool enable) { | 164 int VoEExternalMediaImpl::SetExternalMixing(int channel, bool enable) { |
165 WEBRTC_TRACE(kTraceApiCall, kTraceVoice, | 165 WEBRTC_TRACE(kTraceApiCall, kTraceVoice, |
166 VoEId(shared_->instance_id(), channel), | 166 VoEId(shared_->instance_id(), channel), |
167 "SetExternalMixing(channel=%d, enable=%d)", channel, enable); | 167 "SetExternalMixing(channel=%d, enable=%d)", channel, enable); |
168 if (!shared_->statistics().Initialized()) { | 168 if (!shared_->statistics().Initialized()) { |
169 shared_->SetLastError(VE_NOT_INITED, kTraceError); | 169 shared_->SetLastError(VE_NOT_INITED, kTraceError); |
170 return -1; | 170 return -1; |
171 } | 171 } |
172 voe::ChannelOwner ch = shared_->channel_manager().GetChannel(channel); | 172 voe::ChannelOwner ch = shared_->channel_manager().GetChannel(channel); |
173 voe::Channel* channelPtr = ch.channel(); | 173 voe::Channel* channelPtr = ch.channel(); |
174 if (channelPtr == NULL) { | 174 if (channelPtr == NULL) { |
175 shared_->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, | 175 shared_->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, |
176 "SetExternalMixing() failed to locate channel"); | 176 "SetExternalMixing() failed to locate channel"); |
177 return -1; | 177 return -1; |
178 } | 178 } |
179 return channelPtr->SetExternalMixing(enable); | 179 return channelPtr->SetExternalMixing(enable); |
180 } | 180 } |
181 | 181 |
182 #endif // WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API | 182 #endif // WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API |
183 | 183 |
184 } // namespace webrtc | 184 } // namespace webrtc |
OLD | NEW |