Added EchoControlFactory interface.

The factory for EchoControl is changed from an rtc::Callback1 to an
interface. This avoids using rtc::Callback1 outside of WebRTC.
This also makes the EchoControl factory more similar to other
factories in the code base.

Bug: webrtc:8345
Change-Id: Ie61b9416ed771f8c756326736d17e339eb768469
Reviewed-on: https://webrtc-review.googlesource.com/8900
Reviewed-by: Per Ã…hgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20272}
diff --git a/modules/audio_processing/audio_processing_impl.h b/modules/audio_processing/audio_processing_impl.h
index a5e16cb..6a58b41 100644
--- a/modules/audio_processing/audio_processing_impl.h
+++ b/modules/audio_processing/audio_processing_impl.h
@@ -43,7 +43,7 @@
   // beamformer.
   AudioProcessingImpl(const webrtc::Config& config,
                       std::unique_ptr<PostProcessing> capture_post_processor,
-                      rtc::Callback1<EchoControl*, int> echo_control_factory,
+                      std::unique_ptr<EchoControlFactory> echo_control_factory,
                       NonlinearBeamformer* beamformer);
   ~AudioProcessingImpl() override;
   int Initialize() override;
@@ -142,8 +142,8 @@
   // Submodule interface implementations.
   std::unique_ptr<HighPassFilter> high_pass_filter_impl_;
 
-  // EchoControl factory method.
-  rtc::Callback1<EchoControl*, int> echo_control_factory_;
+  // EchoControl factory.
+  std::unique_ptr<EchoControlFactory> echo_control_factory_;
 
   class ApmSubmoduleStates {
    public: