Revert "Remove APM internal usage of EchoCancellation"

This reverts commit 1a03960e632a04e2ff866f2048cc36146af83e41.

Reason for revert: breaks downstream projects.

Original change's description:
> 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}

TBR=gustaf@webrtc.org,saza@webrtc.org

Change-Id: Ifdc4235f9c5ee8a8a5d32cc8e1dda0853b941693
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9535
Reviewed-on: https://webrtc-review.googlesource.com/100305
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24729}
This commit is contained in:
Sergey Silkin
2018-09-13 14:55:17 +00:00
committed by Commit Bot
parent cd56486ffd
commit 271812a893
17 changed files with 345 additions and 268 deletions

View File

@ -26,9 +26,10 @@ void SetupComponent(int sample_rate_hz,
bool drift_compensation_enabled,
EchoCancellationImpl* echo_canceller) {
echo_canceller->Initialize(sample_rate_hz, 1, 1, 1);
echo_canceller->Enable(true);
echo_canceller->set_suppression_level(suppression_level);
echo_canceller->enable_drift_compensation(drift_compensation_enabled);
EchoCancellation* ec = static_cast<EchoCancellation*>(echo_canceller);
ec->Enable(true);
ec->set_suppression_level(suppression_level);
ec->enable_drift_compensation(drift_compensation_enabled);
Config config;
config.Set<DelayAgnostic>(new DelayAgnostic(true));
@ -55,7 +56,8 @@ void ProcessOneFrame(int sample_rate_hz,
echo_canceller->ProcessRenderAudio(render_audio);
if (drift_compensation_enabled) {
echo_canceller->set_stream_drift_samples(stream_drift_samples);
static_cast<EchoCancellation*>(echo_canceller)
->set_stream_drift_samples(stream_drift_samples);
}
echo_canceller->ProcessCaptureAudio(capture_audio_buffer, stream_delay_ms);
@ -116,7 +118,8 @@ void RunBitexactnessTest(int sample_rate_hz,
test::ExtractVectorFromAudioBuffer(capture_config, &capture_buffer,
&capture_output);
EXPECT_EQ(stream_has_echo_reference, echo_canceller.stream_has_echo());
EXPECT_EQ(stream_has_echo_reference,
static_cast<EchoCancellation*>(&echo_canceller)->stream_has_echo());
// Compare the output with the reference. Only the first values of the output
// from last frame processed are compared in order not having to specify all