| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 135 // Read chunks of data that were received and queued on the render side from | 135 // Read chunks of data that were received and queued on the render side from | 
| 136 // a queue. All the data chunks are buffered into the farend signal of the AEC. | 136 // a queue. All the data chunks are buffered into the farend signal of the AEC. | 
| 137 void EchoCancellationImpl::ReadQueuedRenderData() { | 137 void EchoCancellationImpl::ReadQueuedRenderData() { | 
| 138   rtc::CritScope cs_capture(crit_capture_); | 138   rtc::CritScope cs_capture(crit_capture_); | 
| 139   if (!is_component_enabled()) { | 139   if (!is_component_enabled()) { | 
| 140     return; | 140     return; | 
| 141   } | 141   } | 
| 142 | 142 | 
| 143   while (render_signal_queue_->Remove(&capture_queue_buffer_)) { | 143   while (render_signal_queue_->Remove(&capture_queue_buffer_)) { | 
| 144     size_t handle_index = 0; | 144     size_t handle_index = 0; | 
| 145     int buffer_index = 0; | 145     size_t buffer_index = 0; | 
| 146     const int num_frames_per_band = | 146     const size_t num_frames_per_band = | 
| 147         capture_queue_buffer_.size() / | 147         capture_queue_buffer_.size() / | 
| 148         (apm_->num_output_channels() * apm_->num_reverse_channels()); | 148         (apm_->num_output_channels() * apm_->num_reverse_channels()); | 
| 149     for (int i = 0; i < apm_->num_output_channels(); i++) { | 149     for (int i = 0; i < apm_->num_output_channels(); i++) { | 
| 150       for (int j = 0; j < apm_->num_reverse_channels(); j++) { | 150       for (int j = 0; j < apm_->num_reverse_channels(); j++) { | 
| 151         Handle* my_handle = static_cast<Handle*>(handle(handle_index)); | 151         Handle* my_handle = static_cast<Handle*>(handle(handle_index)); | 
| 152         WebRtcAec_BufferFarend(my_handle, &capture_queue_buffer_[buffer_index], | 152         WebRtcAec_BufferFarend(my_handle, &capture_queue_buffer_[buffer_index], | 
| 153                                num_frames_per_band); | 153                                num_frames_per_band); | 
| 154 | 154 | 
| 155         buffer_index += num_frames_per_band; | 155         buffer_index += num_frames_per_band; | 
| 156         handle_index++; | 156         handle_index++; | 
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 484       WebRtcAec_aec_core(static_cast<Handle*>(handle)), | 484       WebRtcAec_aec_core(static_cast<Handle*>(handle)), | 
| 485       extended_filter_enabled_ ? 1 : 0); | 485       extended_filter_enabled_ ? 1 : 0); | 
| 486   WebRtcAec_enable_delay_agnostic( | 486   WebRtcAec_enable_delay_agnostic( | 
| 487       WebRtcAec_aec_core(static_cast<Handle*>(handle)), | 487       WebRtcAec_aec_core(static_cast<Handle*>(handle)), | 
| 488       delay_agnostic_enabled_ ? 1 : 0); | 488       delay_agnostic_enabled_ ? 1 : 0); | 
| 489   return WebRtcAec_set_config(static_cast<Handle*>(handle), config); | 489   return WebRtcAec_set_config(static_cast<Handle*>(handle), config); | 
| 490 } | 490 } | 
| 491 | 491 | 
| 492 int EchoCancellationImpl::num_handles_required() const { | 492 int EchoCancellationImpl::num_handles_required() const { | 
| 493   // Not locked as it only relies on APM public API which is threadsafe. | 493   // Not locked as it only relies on APM public API which is threadsafe. | 
| 494   return apm_->num_output_channels() * | 494   return apm_->num_output_channels() * apm_->num_reverse_channels(); | 
| 495          apm_->num_reverse_channels(); |  | 
| 496 } | 495 } | 
| 497 | 496 | 
| 498 int EchoCancellationImpl::GetHandleError(void* handle) const { | 497 int EchoCancellationImpl::GetHandleError(void* handle) const { | 
| 499   // Not locked as it does not rely on anything in the state. | 498   // Not locked as it does not rely on anything in the state. | 
| 500   assert(handle != NULL); | 499   assert(handle != NULL); | 
| 501   return AudioProcessing::kUnspecifiedError; | 500   return AudioProcessing::kUnspecifiedError; | 
| 502 } | 501 } | 
| 503 }  // namespace webrtc | 502 }  // namespace webrtc | 
| OLD | NEW | 
|---|