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}
diff --git a/modules/audio_processing/audio_processing_impl.h b/modules/audio_processing/audio_processing_impl.h
index 1e5695c..a5e16cb 100644
--- a/modules/audio_processing/audio_processing_impl.h
+++ b/modules/audio_processing/audio_processing_impl.h
@@ -43,6 +43,7 @@
// 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 @@
// 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);