EchoControl factory injectable in AudioProcessing.

This CL enables a factory method creating acoustic echo cancellers
that inherit EchoControl to be injected into the audio processing
module. AudioProcessing will call the factory method to create an
instance of the EchoControl subclass when needed. In the event of
sample rate changes, AudioProcessing will recreate the object using
the factory method.

Bug: webrtc:8346
Change-Id: I0c508b4d4cdb35569864cefaa0e3aea2555cc9b9
Reviewed-on: https://webrtc-review.googlesource.com/7742
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20251}
This commit is contained in:
Gustaf Ullberg
2017-10-11 16:29:02 +02:00
committed by Commit Bot
parent 5de6b1a211
commit d8579e0133
5 changed files with 46 additions and 11 deletions

View File

@ -43,6 +43,7 @@ class AudioProcessingImpl : public AudioProcessing {
// beamformer.
AudioProcessingImpl(const webrtc::Config& config,
std::unique_ptr<PostProcessing> capture_post_processor,
rtc::Callback1<EchoControl*, int> echo_control_factory,
NonlinearBeamformer* beamformer);
~AudioProcessingImpl() override;
int Initialize() override;
@ -141,6 +142,9 @@ class AudioProcessingImpl : public AudioProcessing {
// Submodule interface implementations.
std::unique_ptr<HighPassFilter> high_pass_filter_impl_;
// EchoControl factory method.
rtc::Callback1<EchoControl*, int> echo_control_factory_;
class ApmSubmoduleStates {
public:
explicit ApmSubmoduleStates(bool capture_post_processor_enabled);