Remove APM internal usage of EchoCancellation

This CL:
 - Changes EchoCancellationImpl to inherit privately from
   EchoCancellation.
 - Removes usage of AudioProcessing::echo_cancellation() inside most of
   the audio processing module and unit tests.
 - Default-enables metrics collection in AEC2.

This CL breaks audioproc_f backwards compatibility: It can no longer
use all recorded settings (drift compensation, suppression level), but
prints an error message when such settings are encountered.

Some code in audio_processing_unittest.cc still uses the old interface.
I'll handle that in a separate change, as it is not as straightforward
to preserve coverage.

Bug: webrtc:9535
Change-Id: Ia4d4b8d117ccbe516e5345c15d37298418590686
Reviewed-on: https://webrtc-review.googlesource.com/97603
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24724}
This commit is contained in:
Sam Zackrisson
2018-09-13 13:37:48 +02:00
committed by Commit Bot
parent 36b3179312
commit 1a03960e63
17 changed files with 269 additions and 346 deletions

View File

@ -452,11 +452,10 @@ class CallSimulator : public ::testing::TestWithParam<SimulationConfig> {
ASSERT_EQ(apm->kNoError, apm->gain_control()->Enable(true));
ASSERT_EQ(apm->kNoError, apm->noise_suppression()->Enable(true));
ASSERT_EQ(apm->kNoError, apm->voice_detection()->Enable(true));
ASSERT_EQ(apm->kNoError, apm->echo_control_mobile()->Enable(false));
ASSERT_EQ(apm->kNoError, apm->echo_cancellation()->Enable(true));
ASSERT_EQ(apm->kNoError, apm->echo_cancellation()->enable_metrics(true));
ASSERT_EQ(apm->kNoError,
apm->echo_cancellation()->enable_delay_logging(true));
AudioProcessing::Config apm_config = apm->GetConfig();
apm_config.echo_canceller.enabled = true;
apm_config.echo_canceller.mobile_mode = false;
apm->ApplyConfig(apm_config);
};
// Lambda function for setting the default APM runtime settings for mobile.
@ -468,8 +467,10 @@ class CallSimulator : public ::testing::TestWithParam<SimulationConfig> {
ASSERT_EQ(apm->kNoError, apm->gain_control()->Enable(true));
ASSERT_EQ(apm->kNoError, apm->noise_suppression()->Enable(true));
ASSERT_EQ(apm->kNoError, apm->voice_detection()->Enable(true));
ASSERT_EQ(apm->kNoError, apm->echo_control_mobile()->Enable(true));
ASSERT_EQ(apm->kNoError, apm->echo_cancellation()->Enable(false));
AudioProcessing::Config apm_config = apm->GetConfig();
apm_config.echo_canceller.enabled = true;
apm_config.echo_canceller.mobile_mode = true;
apm->ApplyConfig(apm_config);
};
// Lambda function for turning off all of the APM runtime settings
@ -482,11 +483,9 @@ class CallSimulator : public ::testing::TestWithParam<SimulationConfig> {
ASSERT_EQ(apm->kNoError, apm->gain_control()->Enable(false));
ASSERT_EQ(apm->kNoError, apm->noise_suppression()->Enable(false));
ASSERT_EQ(apm->kNoError, apm->voice_detection()->Enable(false));
ASSERT_EQ(apm->kNoError, apm->echo_control_mobile()->Enable(false));
ASSERT_EQ(apm->kNoError, apm->echo_cancellation()->Enable(false));
ASSERT_EQ(apm->kNoError, apm->echo_cancellation()->enable_metrics(false));
ASSERT_EQ(apm->kNoError,
apm->echo_cancellation()->enable_delay_logging(false));
AudioProcessing::Config apm_config = apm->GetConfig();
apm_config.echo_canceller.enabled = false;
apm->ApplyConfig(apm_config);
};
// Lambda function for adding default desktop APM settings to a config.