Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Unified Diff: webrtc/modules/audio_processing/audio_processing_impl.cc

Issue 1770823002: Removed the AudioProcessing dependency in EchoCancellerImpl (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@CleanUpAecImpl_CL
Patch Set: Changed the way the error checks were done Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/echo_cancellation_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_processing/audio_processing_impl.cc
diff --git a/webrtc/modules/audio_processing/audio_processing_impl.cc b/webrtc/modules/audio_processing/audio_processing_impl.cc
index 9c587c25c7940b1cebb230caba6d6ea807eba628..5be6c5944ecb4768796884d16b6955229f0eceba 100644
--- a/webrtc/modules/audio_processing/audio_processing_impl.cc
+++ b/webrtc/modules/audio_processing/audio_processing_impl.cc
@@ -715,7 +715,23 @@ int AudioProcessingImpl::ProcessStreamLocked() {
public_submodules_->high_pass_filter->ProcessCaptureAudio(ca);
RETURN_ON_ERR(public_submodules_->gain_control->AnalyzeCaptureAudio(ca));
public_submodules_->noise_suppression->AnalyzeCaptureAudio(ca);
- RETURN_ON_ERR(public_submodules_->echo_cancellation->ProcessCaptureAudio(ca));
+
+ // Ensure that not both the AEC and AECM are active at the same time.
+ // TODO(peah): Simplify once the public API Enable functions for these
+ // are moved to APM.
+ if (public_submodules_->echo_cancellation->is_enabled() &&
the sun 2016/03/11 10:14:12 Make this a DCHECK and move it to the beginning of
+ public_submodules_->echo_control_mobile->is_enabled()) {
+ return AudioProcessing::kBadParameterError;
+ }
+
+ // Ensure that the stream delay was set before the call to the
+ // AEC ProcessCaptureAudio function.
+ if (!was_stream_delay_set()) {
the sun 2016/03/11 10:14:13 Likewise, this is a precondition, so move to begin
+ return AudioProcessing::kBadParameterError;
+ }
+
+ RETURN_ON_ERR(public_submodules_->echo_cancellation->ProcessCaptureAudio(
+ ca, stream_delay_ms()));
if (public_submodules_->echo_control_mobile->is_enabled() &&
public_submodules_->noise_suppression->is_enabled()) {
@@ -1251,7 +1267,9 @@ void AudioProcessingImpl::InitializeNoiseSuppression() {
}
void AudioProcessingImpl::InitializeEchoCanceller() {
- public_submodules_->echo_cancellation->Initialize();
+ public_submodules_->echo_cancellation->Initialize(
+ proc_sample_rate_hz(), num_reverse_channels(), num_output_channels(),
+ num_proc_channels());
}
void AudioProcessingImpl::InitializeLevelEstimator() {
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/echo_cancellation_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698