Only create AEC2 when needed

This CL ensures that the AEC2 is only created when needed.
The changes in the CL are bitexact when running AEC2 via
audioproc_f

Bug: webrtc:8671
Change-Id: I5f6d33e45a7031c69ac53098781635c415668e49
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/129740
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27772}
This commit is contained in:
Per Åhgren
2019-04-25 15:18:06 +02:00
committed by Commit Bot
parent e680c83a41
commit f204fafdb4
6 changed files with 144 additions and 114 deletions

View File

@ -246,7 +246,8 @@ class AudioProcessingImpl : public AudioProcessing {
void InitializeResidualEchoDetector()
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
void InitializeLowCutFilter() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
void InitializeEchoController() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
void InitializeEchoController()
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
void InitializeGainController2() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
void InitializePreAmplifier() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
void InitializePostProcessor() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
@ -417,6 +418,9 @@ class AudioProcessingImpl : public AudioProcessing {
int split_rate;
int stream_delay_ms;
bool echo_controller_enabled = false;
bool use_aec2_extended_filter = false;
bool use_aec2_delay_agnostic = false;
bool use_aec2_refined_adaptive_filter = false;
} capture_nonlocked_;
struct ApmRenderState {