From 1bb49e9ad4969930b69bf9f4282a968e6d6607e3 Mon Sep 17 00:00:00 2001 From: Danil Chapovalov Date: Mon, 18 Nov 2024 13:54:46 +0100 Subject: [PATCH] Delete deprecated AudioProcessingBuilder BuiltinAudioProcessingBuilder should be used instead. This would allow AudioProcessingImpl to have Environment construction parameter and thus use propagated rather than global field trials. Bug: webrtc:369904700 Change-Id: I4fcc299bb9e65c109a3fe476c755a81c2aea551c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/368480 Commit-Queue: Danil Chapovalov Reviewed-by: Harald Alvestrand Cr-Commit-Position: refs/heads/main@{#43553} --- api/audio/audio_processing.h | 64 ------------------- modules/audio_processing/BUILD.gn | 1 - .../audio_processing_builder_impl.cc | 34 ---------- 3 files changed, 99 deletions(-) delete mode 100644 modules/audio_processing/audio_processing_builder_impl.cc diff --git a/api/audio/audio_processing.h b/api/audio/audio_processing.h index 293c01f442..36b956e83f 100644 --- a/api/audio/audio_processing.h +++ b/api/audio/audio_processing.h @@ -780,70 +780,6 @@ class CustomProcessing { virtual ~CustomProcessing() {} }; -// Use BuiltinAudioProcessingBuilder instead, see bugs.webrtc.org/369904700 -class RTC_EXPORT [[deprecated]] AudioProcessingBuilder { - public: - AudioProcessingBuilder(); - AudioProcessingBuilder(const AudioProcessingBuilder&) = delete; - AudioProcessingBuilder& operator=(const AudioProcessingBuilder&) = delete; - ~AudioProcessingBuilder(); - - // Sets the APM configuration. - AudioProcessingBuilder& SetConfig(const AudioProcessing::Config& config) { - config_ = config; - return *this; - } - - // Sets the echo controller factory to inject when APM is created. - AudioProcessingBuilder& SetEchoControlFactory( - std::unique_ptr echo_control_factory) { - echo_control_factory_ = std::move(echo_control_factory); - return *this; - } - - // Sets the capture post-processing sub-module to inject when APM is created. - AudioProcessingBuilder& SetCapturePostProcessing( - std::unique_ptr capture_post_processing) { - capture_post_processing_ = std::move(capture_post_processing); - return *this; - } - - // Sets the render pre-processing sub-module to inject when APM is created. - AudioProcessingBuilder& SetRenderPreProcessing( - std::unique_ptr render_pre_processing) { - render_pre_processing_ = std::move(render_pre_processing); - return *this; - } - - // Sets the echo detector to inject when APM is created. - AudioProcessingBuilder& SetEchoDetector( - rtc::scoped_refptr echo_detector) { - echo_detector_ = std::move(echo_detector); - return *this; - } - - // Sets the capture analyzer sub-module to inject when APM is created. - AudioProcessingBuilder& SetCaptureAnalyzer( - std::unique_ptr capture_analyzer) { - capture_analyzer_ = std::move(capture_analyzer); - return *this; - } - - // Creates an APM instance with the specified config or the default one if - // unspecified. Injects the specified components transferring the ownership - // to the newly created APM instance - i.e., except for the config, the - // builder is reset to its initial state. - rtc::scoped_refptr Create(); - - private: - AudioProcessing::Config config_; - std::unique_ptr echo_control_factory_; - std::unique_ptr capture_post_processing_; - std::unique_ptr render_pre_processing_; - rtc::scoped_refptr echo_detector_; - std::unique_ptr capture_analyzer_; -}; - class StreamConfig { public: // sample_rate_hz: The sampling rate of the stream. diff --git a/modules/audio_processing/BUILD.gn b/modules/audio_processing/BUILD.gn index ab6e2c7902..b63ee19dba 100644 --- a/modules/audio_processing/BUILD.gn +++ b/modules/audio_processing/BUILD.gn @@ -132,7 +132,6 @@ rtc_library("audio_processing") { visibility = [ "*" ] configs += [ ":apm_debug_dump" ] sources = [ - "audio_processing_builder_impl.cc", "audio_processing_impl.cc", "audio_processing_impl.h", "echo_control_mobile_impl.cc", diff --git a/modules/audio_processing/audio_processing_builder_impl.cc b/modules/audio_processing/audio_processing_builder_impl.cc deleted file mode 100644 index d02ac82fe0..0000000000 --- a/modules/audio_processing/audio_processing_builder_impl.cc +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2020 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include "api/audio/audio_processing.h" -#include "api/make_ref_counted.h" -#include "modules/audio_processing/audio_processing_impl.h" - -namespace webrtc { - -AudioProcessingBuilder::AudioProcessingBuilder() = default; -AudioProcessingBuilder::~AudioProcessingBuilder() = default; - -rtc::scoped_refptr AudioProcessingBuilder::Create() { -#ifdef WEBRTC_EXCLUDE_AUDIO_PROCESSING_MODULE - // Return a null pointer when the APM is excluded from the build. - return nullptr; -#else // WEBRTC_EXCLUDE_AUDIO_PROCESSING_MODULE - return rtc::make_ref_counted( - config_, std::move(capture_post_processing_), - std::move(render_pre_processing_), std::move(echo_control_factory_), - std::move(echo_detector_), std::move(capture_analyzer_)); -#endif -} - -} // namespace webrtc