| 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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 bool EchoCancellationImpl::is_delay_agnostic_enabled() const { | 353 bool EchoCancellationImpl::is_delay_agnostic_enabled() const { |
| 354 rtc::CritScope cs(crit_capture_); | 354 rtc::CritScope cs(crit_capture_); |
| 355 return delay_agnostic_enabled_; | 355 return delay_agnostic_enabled_; |
| 356 } | 356 } |
| 357 | 357 |
| 358 bool EchoCancellationImpl::is_next_generation_aec_enabled() const { | 358 bool EchoCancellationImpl::is_next_generation_aec_enabled() const { |
| 359 rtc::CritScope cs(crit_capture_); | 359 rtc::CritScope cs(crit_capture_); |
| 360 return next_generation_aec_enabled_; | 360 return next_generation_aec_enabled_; |
| 361 } | 361 } |
| 362 | 362 |
| 363 bool EchoCancellationImpl::is_refined_adaptive_filter_enabled() const { |
| 364 rtc::CritScope cs(crit_capture_); |
| 365 return refined_adaptive_filter_enabled_; |
| 366 } |
| 367 |
| 363 bool EchoCancellationImpl::is_extended_filter_enabled() const { | 368 bool EchoCancellationImpl::is_extended_filter_enabled() const { |
| 364 rtc::CritScope cs(crit_capture_); | 369 rtc::CritScope cs(crit_capture_); |
| 365 return extended_filter_enabled_; | 370 return extended_filter_enabled_; |
| 366 } | 371 } |
| 367 | 372 |
| 368 // TODO(bjornv): How should we handle the multi-channel case? | 373 // TODO(bjornv): How should we handle the multi-channel case? |
| 369 int EchoCancellationImpl::GetDelayMetrics(int* median, int* std) { | 374 int EchoCancellationImpl::GetDelayMetrics(int* median, int* std) { |
| 370 rtc::CritScope cs(crit_capture_); | 375 rtc::CritScope cs(crit_capture_); |
| 371 float fraction_poor_delays = 0; | 376 float fraction_poor_delays = 0; |
| 372 return GetDelayMetrics(median, std, &fraction_poor_delays); | 377 return GetDelayMetrics(median, std, &fraction_poor_delays); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 } else { | 449 } else { |
| 445 render_signal_queue_->Clear(); | 450 render_signal_queue_->Clear(); |
| 446 } | 451 } |
| 447 } | 452 } |
| 448 | 453 |
| 449 void EchoCancellationImpl::SetExtraOptions(const Config& config) { | 454 void EchoCancellationImpl::SetExtraOptions(const Config& config) { |
| 450 { | 455 { |
| 451 rtc::CritScope cs(crit_capture_); | 456 rtc::CritScope cs(crit_capture_); |
| 452 extended_filter_enabled_ = config.Get<ExtendedFilter>().enabled; | 457 extended_filter_enabled_ = config.Get<ExtendedFilter>().enabled; |
| 453 delay_agnostic_enabled_ = config.Get<DelayAgnostic>().enabled; | 458 delay_agnostic_enabled_ = config.Get<DelayAgnostic>().enabled; |
| 459 refined_adaptive_filter_enabled_ = |
| 460 config.Get<RefinedAdaptiveFilter>().enabled; |
| 454 next_generation_aec_enabled_ = config.Get<NextGenerationAec>().enabled; | 461 next_generation_aec_enabled_ = config.Get<NextGenerationAec>().enabled; |
| 455 } | 462 } |
| 456 Configure(); | 463 Configure(); |
| 457 } | 464 } |
| 458 | 465 |
| 459 void* EchoCancellationImpl::CreateHandle() const { | 466 void* EchoCancellationImpl::CreateHandle() const { |
| 460 return WebRtcAec_Create(); | 467 return WebRtcAec_Create(); |
| 461 } | 468 } |
| 462 | 469 |
| 463 void EchoCancellationImpl::DestroyHandle(void* handle) const { | 470 void EchoCancellationImpl::DestroyHandle(void* handle) const { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 487 config.delay_logging = delay_logging_enabled_; | 494 config.delay_logging = delay_logging_enabled_; |
| 488 WebRtcAec_enable_extended_filter( | 495 WebRtcAec_enable_extended_filter( |
| 489 WebRtcAec_aec_core(static_cast<Handle*>(handle)), | 496 WebRtcAec_aec_core(static_cast<Handle*>(handle)), |
| 490 extended_filter_enabled_ ? 1 : 0); | 497 extended_filter_enabled_ ? 1 : 0); |
| 491 WebRtcAec_enable_delay_agnostic( | 498 WebRtcAec_enable_delay_agnostic( |
| 492 WebRtcAec_aec_core(static_cast<Handle*>(handle)), | 499 WebRtcAec_aec_core(static_cast<Handle*>(handle)), |
| 493 delay_agnostic_enabled_ ? 1 : 0); | 500 delay_agnostic_enabled_ ? 1 : 0); |
| 494 WebRtcAec_enable_next_generation_aec( | 501 WebRtcAec_enable_next_generation_aec( |
| 495 WebRtcAec_aec_core(static_cast<Handle*>(handle)), | 502 WebRtcAec_aec_core(static_cast<Handle*>(handle)), |
| 496 next_generation_aec_enabled_ ? 1 : 0); | 503 next_generation_aec_enabled_ ? 1 : 0); |
| 504 WebRtcAec_enable_refined_adaptive_filter( |
| 505 WebRtcAec_aec_core(static_cast<Handle*>(handle)), |
| 506 refined_adaptive_filter_enabled_); |
| 497 return WebRtcAec_set_config(static_cast<Handle*>(handle), config); | 507 return WebRtcAec_set_config(static_cast<Handle*>(handle), config); |
| 498 } | 508 } |
| 499 | 509 |
| 500 size_t EchoCancellationImpl::num_handles_required() const { | 510 size_t EchoCancellationImpl::num_handles_required() const { |
| 501 // Not locked as it only relies on APM public API which is threadsafe. | 511 // Not locked as it only relies on APM public API which is threadsafe. |
| 502 return apm_->num_output_channels() * apm_->num_reverse_channels(); | 512 return apm_->num_output_channels() * apm_->num_reverse_channels(); |
| 503 } | 513 } |
| 504 | 514 |
| 505 int EchoCancellationImpl::GetHandleError(void* handle) const { | 515 int EchoCancellationImpl::GetHandleError(void* handle) const { |
| 506 // Not locked as it does not rely on anything in the state. | 516 // Not locked as it does not rely on anything in the state. |
| 507 assert(handle != NULL); | 517 assert(handle != NULL); |
| 508 return AudioProcessing::kUnspecifiedError; | 518 return AudioProcessing::kUnspecifiedError; |
| 509 } | 519 } |
| 510 } // namespace webrtc | 520 } // namespace webrtc |
| OLD | NEW |