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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // a queue. All the data chunks are buffered into the farend signal of the AEC. | 140 // a queue. All the data chunks are buffered into the farend signal of the AEC. |
141 void EchoControlMobileImpl::ReadQueuedRenderData() { | 141 void EchoControlMobileImpl::ReadQueuedRenderData() { |
142 rtc::CritScope cs_capture(crit_capture_); | 142 rtc::CritScope cs_capture(crit_capture_); |
143 | 143 |
144 if (!is_component_enabled()) { | 144 if (!is_component_enabled()) { |
145 return; | 145 return; |
146 } | 146 } |
147 | 147 |
148 while (render_signal_queue_->Remove(&capture_queue_buffer_)) { | 148 while (render_signal_queue_->Remove(&capture_queue_buffer_)) { |
149 size_t handle_index = 0; | 149 size_t handle_index = 0; |
150 int buffer_index = 0; | 150 size_t buffer_index = 0; |
151 const int num_frames_per_band = | 151 const size_t num_frames_per_band = |
152 capture_queue_buffer_.size() / | 152 capture_queue_buffer_.size() / |
153 (apm_->num_output_channels() * apm_->num_reverse_channels()); | 153 (apm_->num_output_channels() * apm_->num_reverse_channels()); |
154 for (int i = 0; i < apm_->num_output_channels(); i++) { | 154 for (int i = 0; i < apm_->num_output_channels(); i++) { |
155 for (int j = 0; j < apm_->num_reverse_channels(); j++) { | 155 for (int j = 0; j < apm_->num_reverse_channels(); j++) { |
156 Handle* my_handle = static_cast<Handle*>(handle(handle_index)); | 156 Handle* my_handle = static_cast<Handle*>(handle(handle_index)); |
157 WebRtcAecm_BufferFarend(my_handle, &capture_queue_buffer_[buffer_index], | 157 WebRtcAecm_BufferFarend(my_handle, &capture_queue_buffer_[buffer_index], |
158 num_frames_per_band); | 158 num_frames_per_band); |
159 | 159 |
160 buffer_index += num_frames_per_band; | 160 buffer_index += num_frames_per_band; |
161 handle_index++; | 161 handle_index++; |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 rtc::CritScope cs_capture(crit_capture_); | 389 rtc::CritScope cs_capture(crit_capture_); |
390 AecmConfig config; | 390 AecmConfig config; |
391 config.cngMode = comfort_noise_enabled_; | 391 config.cngMode = comfort_noise_enabled_; |
392 config.echoMode = MapSetting(routing_mode_); | 392 config.echoMode = MapSetting(routing_mode_); |
393 | 393 |
394 return WebRtcAecm_set_config(static_cast<Handle*>(handle), config); | 394 return WebRtcAecm_set_config(static_cast<Handle*>(handle), config); |
395 } | 395 } |
396 | 396 |
397 int EchoControlMobileImpl::num_handles_required() const { | 397 int EchoControlMobileImpl::num_handles_required() const { |
398 // Not locked as it only relies on APM public API which is threadsafe. | 398 // Not locked as it only relies on APM public API which is threadsafe. |
399 return apm_->num_output_channels() * | 399 return apm_->num_output_channels() * apm_->num_reverse_channels(); |
400 apm_->num_reverse_channels(); | |
401 } | 400 } |
402 | 401 |
403 int EchoControlMobileImpl::GetHandleError(void* handle) const { | 402 int EchoControlMobileImpl::GetHandleError(void* handle) const { |
404 // Not locked as it does not rely on anything in the state. | 403 // Not locked as it does not rely on anything in the state. |
405 assert(handle != NULL); | 404 assert(handle != NULL); |
406 return AudioProcessing::kUnspecifiedError; | 405 return AudioProcessing::kUnspecifiedError; |
407 } | 406 } |
408 } // namespace webrtc | 407 } // namespace webrtc |
OLD | NEW |