diff --git a/api/audio/echo_canceller3_factory.cc b/api/audio/echo_canceller3_factory.cc index 7df43b3fd4..d65a7262fa 100644 --- a/api/audio/echo_canceller3_factory.cc +++ b/api/audio/echo_canceller3_factory.cc @@ -20,11 +20,6 @@ EchoCanceller3Factory::EchoCanceller3Factory() {} EchoCanceller3Factory::EchoCanceller3Factory(const EchoCanceller3Config& config) : config_(config) {} -std::unique_ptr EchoCanceller3Factory::Create(int sample_rate_hz) { - return Create(sample_rate_hz, /*num_render_channels=*/1, - /*num_capture_channels=*/1); -} - std::unique_ptr EchoCanceller3Factory::Create( int sample_rate_hz, int num_render_channels, diff --git a/api/audio/echo_canceller3_factory.h b/api/audio/echo_canceller3_factory.h index 43f49a1b66..8b5380057b 100644 --- a/api/audio/echo_canceller3_factory.h +++ b/api/audio/echo_canceller3_factory.h @@ -28,12 +28,7 @@ class RTC_EXPORT EchoCanceller3Factory : public EchoControlFactory { // configuration. explicit EchoCanceller3Factory(const EchoCanceller3Config& config); - // Creates an EchoCanceller3 running at the specified sampling rate using a - // mono setup. - std::unique_ptr Create(int sample_rate_hz) override; - - // Creates an EchoCanceller3 running at the specified sampling rate using a - // multichannel setup. + // Creates an EchoCanceller3 with a specified channel count and sampling rate. std::unique_ptr Create(int sample_rate_hz, int num_render_channels, int num_capture_channels) override; diff --git a/api/audio/echo_control.h b/api/audio/echo_control.h index 11ba989d7a..de80f500d1 100644 --- a/api/audio/echo_control.h +++ b/api/audio/echo_control.h @@ -52,14 +52,9 @@ class EchoControl { // Interface for a factory that creates EchoControllers. class EchoControlFactory { public: - virtual std::unique_ptr Create(int sample_rate_hz) = 0; - // TODO(peah): Make pure virtual. virtual std::unique_ptr Create(int sample_rate_hz, int num_render_channels, - int num_capture_channels) { - RTC_NOTREACHED(); - return nullptr; - } + int num_capture_channels) = 0; virtual ~EchoControlFactory() = default; }; diff --git a/modules/audio_processing/audio_processing_impl.cc b/modules/audio_processing/audio_processing_impl.cc index abfcc053d3..9a0ce88d56 100644 --- a/modules/audio_processing/audio_processing_impl.cc +++ b/modules/audio_processing/audio_processing_impl.cc @@ -1783,6 +1783,7 @@ void AudioProcessingImpl::InitializeEchoController() { if (echo_control_factory_) { submodules_.echo_controller = echo_control_factory_->Create( proc_sample_rate_hz(), num_reverse_channels(), num_proc_channels()); + RTC_DCHECK(submodules_.echo_controller); } else { submodules_.echo_controller = std::make_unique( EchoCanceller3Config(), proc_sample_rate_hz(), num_reverse_channels(), diff --git a/modules/audio_processing/audio_processing_impl_unittest.cc b/modules/audio_processing/audio_processing_impl_unittest.cc index 5a2391b510..5707f470c8 100644 --- a/modules/audio_processing/audio_processing_impl_unittest.cc +++ b/modules/audio_processing/audio_processing_impl_unittest.cc @@ -53,10 +53,6 @@ class MockEchoControlFactory : public EchoControlFactory { MockEchoControlFactory() : next_mock_(std::make_unique()) {} // Returns a pointer to the next MockEchoControl that this factory creates. MockEchoControl* GetNext() const { return next_mock_.get(); } - std::unique_ptr Create(int sample_rate_hz) override { - RTC_NOTREACHED(); - return nullptr; - } std::unique_ptr Create(int sample_rate_hz, int num_render_channels, int num_capture_channels) override {