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

@ -23,6 +23,7 @@
#include "modules/audio_processing/beamformer/array_util.h"
#include "modules/audio_processing/include/config.h"
#include "rtc_base/arraysize.h"
#include "rtc_base/callback.h"
#include "rtc_base/deprecation.h"
#include "rtc_base/platform_file.h"
#include "rtc_base/refcount.h"
@ -43,6 +44,7 @@ class ProcessingConfig;
class EchoCancellation;
class EchoControlMobile;
class EchoControl;
class GainControl;
class HighPassFilter;
class LevelEstimator;
@ -376,10 +378,15 @@ class AudioProcessing : public rtc::RefCountInterface {
RTC_DEPRECATED
static AudioProcessing* Create(const webrtc::Config& config,
NonlinearBeamformer* beamformer);
static AudioProcessing* Create(
const webrtc::Config& config,
std::unique_ptr<PostProcessing> capture_post_processor,
NonlinearBeamformer* beamformer);
// Allows passing in optional user-defined processing modules.
static AudioProcessing* Create(
const webrtc::Config& config,
std::unique_ptr<PostProcessing> capture_post_processor,
rtc::Callback1<EchoControl*, int> echo_control_factory,
NonlinearBeamformer* beamformer);
~AudioProcessing() override {}