Separate AEC3 config from AudioProcessing::Config.

The struct containing the config for AEC3 is removed from
AudioProcessing::Config and is put in a new struct called
EchoCanceller3Config.

AEC3 should no longer be activated through
AudioProcessing::ApplyConfig. Instead an EchoCanceller3Factory
can be injected at AudioProcessing creation.

Bug: webrtc:8346
Change-Id: I27e3592e675eec3632a60c45d9e0d12514c2c567
Reviewed-on: https://webrtc-review.googlesource.com/11420
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20342}
This commit is contained in:
Gustaf Ullberg
2017-10-18 12:32:42 +02:00
committed by Commit Bot
parent 737e073f8d
commit bd83b914c3
36 changed files with 285 additions and 323 deletions

View File

@ -603,7 +603,7 @@ int AudioProcessingImpl::InitializeLocked(const ProcessingConfig& config) {
StreamConfig(capture_processing_rate);
int render_processing_rate;
if (!config_.echo_canceller3.enabled) {
if (!capture_nonlocked_.echo_controller_enabled) {
render_processing_rate = FindNativeProcessRateToUse(
std::min(formats_.api_format.reverse_input_stream().sample_rate_hz(),
formats_.api_format.reverse_output_stream().sample_rate_hz()),
@ -616,7 +616,7 @@ int AudioProcessingImpl::InitializeLocked(const ProcessingConfig& config) {
// TODO(aluebs): Remove this restriction once we figure out why the 3-band
// splitting filter degrades the AEC performance.
if (render_processing_rate > kSampleRate32kHz &&
!config_.echo_canceller3.enabled) {
!capture_nonlocked_.echo_controller_enabled) {
render_processing_rate = submodule_states_.RenderMultiBandProcessingActive()
? kSampleRate32kHz
: kSampleRate16kHz;
@ -692,12 +692,13 @@ void AudioProcessingImpl::ApplyConfig(const AudioProcessing::Config& config) {
LOG(LS_INFO) << "Highpass filter activated: "
<< config_.high_pass_filter.enabled;
// Inject EchoCanceller3 if requested.
// Deprecated way of activating AEC3.
// TODO(gustaf): Remove when possible.
if (config.echo_canceller3.enabled && !echo_control_factory_) {
capture_nonlocked_.echo_controller_enabled =
config_.echo_canceller3.enabled;
echo_control_factory_ = std::unique_ptr<EchoControlFactory>(
new EchoCanceller3Factory(config.echo_canceller3));
echo_control_factory_ =
std::unique_ptr<EchoControlFactory>(new EchoCanceller3Factory());
InitializeEchoController();
LOG(LS_INFO) << "Echo canceller 3 activated: "
<< capture_nonlocked_.echo_controller_enabled;