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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 if (err != AudioProcessing::kNoError || !is_component_enabled()) { | 408 if (err != AudioProcessing::kNoError || !is_component_enabled()) { |
409 return err; | 409 return err; |
410 } | 410 } |
411 } | 411 } |
412 | 412 |
413 AllocateRenderQueue(); | 413 AllocateRenderQueue(); |
414 | 414 |
415 return AudioProcessing::kNoError; | 415 return AudioProcessing::kNoError; |
416 } | 416 } |
417 | 417 |
| 418 int EchoCancellationImpl::GetSystemDelayInSamples() const { |
| 419 rtc::CritScope cs(crit_capture_); |
| 420 RTC_DCHECK(is_component_enabled()); |
| 421 // Report the delay for the first AEC component. |
| 422 return WebRtcAec_system_delay( |
| 423 WebRtcAec_aec_core(static_cast<Handle*>(handle(0)))); |
| 424 } |
| 425 |
418 void EchoCancellationImpl::AllocateRenderQueue() { | 426 void EchoCancellationImpl::AllocateRenderQueue() { |
419 const size_t new_render_queue_element_max_size = std::max<size_t>( | 427 const size_t new_render_queue_element_max_size = std::max<size_t>( |
420 static_cast<size_t>(1), | 428 static_cast<size_t>(1), |
421 kMaxAllowedValuesOfSamplesPerFrame * num_handles_required()); | 429 kMaxAllowedValuesOfSamplesPerFrame * num_handles_required()); |
422 | 430 |
423 rtc::CritScope cs_render(crit_render_); | 431 rtc::CritScope cs_render(crit_render_); |
424 rtc::CritScope cs_capture(crit_capture_); | 432 rtc::CritScope cs_capture(crit_capture_); |
425 | 433 |
426 // Reallocate the queue if the queue item size is too small to fit the | 434 // Reallocate the queue if the queue item size is too small to fit the |
427 // data to put in the queue. | 435 // data to put in the queue. |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 // Not locked as it only relies on APM public API which is threadsafe. | 501 // Not locked as it only relies on APM public API which is threadsafe. |
494 return apm_->num_output_channels() * apm_->num_reverse_channels(); | 502 return apm_->num_output_channels() * apm_->num_reverse_channels(); |
495 } | 503 } |
496 | 504 |
497 int EchoCancellationImpl::GetHandleError(void* handle) const { | 505 int EchoCancellationImpl::GetHandleError(void* handle) const { |
498 // Not locked as it does not rely on anything in the state. | 506 // Not locked as it does not rely on anything in the state. |
499 assert(handle != NULL); | 507 assert(handle != NULL); |
500 return AudioProcessing::kUnspecifiedError; | 508 return AudioProcessing::kUnspecifiedError; |
501 } | 509 } |
502 } // namespace webrtc | 510 } // namespace webrtc |
OLD | NEW |