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 <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43553}
This commit is contained in:
Danil Chapovalov 2024-11-18 13:54:46 +01:00 committed by WebRTC LUCI CQ
parent dd373b8a32
commit 1bb49e9ad4
3 changed files with 0 additions and 99 deletions

View file

@ -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<EchoControlFactory> 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<CustomProcessing> 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<CustomProcessing> 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<EchoDetector> 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<CustomAudioAnalyzer> 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<AudioProcessing> Create();
private:
AudioProcessing::Config config_;
std::unique_ptr<EchoControlFactory> echo_control_factory_;
std::unique_ptr<CustomProcessing> capture_post_processing_;
std::unique_ptr<CustomProcessing> render_pre_processing_;
rtc::scoped_refptr<EchoDetector> echo_detector_;
std::unique_ptr<CustomAudioAnalyzer> capture_analyzer_;
};
class StreamConfig {
public:
// sample_rate_hz: The sampling rate of the stream.

View file

@ -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",

View file

@ -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 <memory>
#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<AudioProcessing> 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<AudioProcessingImpl>(
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