Move EchoCanceller3Factory to api/auido
The AEC3 factory is now part of the WebRTC API. Bug: webrtc:8844 Change-Id: If6f419b4ca0354e2d346c0e6474086e456ba747e Reviewed-on: https://webrtc-review.googlesource.com/57141 Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Reviewed-by: Alex Loiko <aleloi@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22204}
This commit is contained in:
committed by
Commit Bot
parent
fef0500aa7
commit
0efa941d2f
@ -508,6 +508,7 @@ if (rtc_include_tests) {
|
||||
"../../api:array_view",
|
||||
"../../api:optional",
|
||||
"../../api/audio:aec3_config",
|
||||
"../../api/audio:aec3_factory",
|
||||
"../../common_audio:common_audio",
|
||||
"../../common_audio:common_audio_c",
|
||||
"../../rtc_base:checks",
|
||||
@ -519,7 +520,6 @@ if (rtc_include_tests) {
|
||||
"../../system_wrappers:cpu_features_api",
|
||||
"../../test:test_support",
|
||||
"../audio_coding:neteq_input_audio_tools",
|
||||
"aec3:aec3",
|
||||
"aec_dump:mock_aec_dump_unittests",
|
||||
"agc2:fixed_digital_unittests",
|
||||
"test/conversational_speech:unittest",
|
||||
@ -651,6 +651,7 @@ if (rtc_include_tests) {
|
||||
":audioproc_protobuf_utils",
|
||||
":audioproc_test_utils",
|
||||
"../../api:optional",
|
||||
"../../api/audio:aec3_factory",
|
||||
"../../common_audio:common_audio",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:protobuf_utils",
|
||||
@ -660,7 +661,6 @@ if (rtc_include_tests) {
|
||||
"../../system_wrappers",
|
||||
"../../system_wrappers:system_wrappers_default",
|
||||
"../../test:test_support",
|
||||
"aec3:aec3",
|
||||
"aec_dump",
|
||||
"aec_dump:aec_dump_impl",
|
||||
"//testing/gtest",
|
||||
|
||||
@ -9,17 +9,9 @@
|
||||
import("//build/config/arm.gni")
|
||||
import("../../../webrtc.gni")
|
||||
|
||||
config("apm_debug_dump") {
|
||||
if (apm_debug_dump) {
|
||||
defines = [ "WEBRTC_APM_DEBUG_DUMP=1" ]
|
||||
} else {
|
||||
defines = [ "WEBRTC_APM_DEBUG_DUMP=0" ]
|
||||
}
|
||||
}
|
||||
|
||||
rtc_static_library("aec3") {
|
||||
visibility = [ "*" ]
|
||||
configs += [ ":apm_debug_dump" ]
|
||||
configs += [ "..:apm_debug_dump" ]
|
||||
sources = [
|
||||
"adaptive_fir_filter.cc",
|
||||
"adaptive_fir_filter.h",
|
||||
@ -125,7 +117,7 @@ if (rtc_include_tests) {
|
||||
rtc_source_set("aec3_unittests") {
|
||||
testonly = true
|
||||
|
||||
configs += [ ":apm_debug_dump" ]
|
||||
configs += [ "..:apm_debug_dump" ]
|
||||
sources = [
|
||||
"mock/mock_block_processor.h",
|
||||
"mock/mock_echo_remover.h",
|
||||
|
||||
@ -338,10 +338,6 @@ EchoControl::Metrics EchoCanceller3::GetMetrics() const {
|
||||
return metrics;
|
||||
}
|
||||
|
||||
bool EchoCanceller3::Validate(const EchoCanceller3Config& config) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void EchoCanceller3::EmptyRenderQueue() {
|
||||
RTC_DCHECK_RUNS_SERIALIZED(&capture_race_checker_);
|
||||
bool frame_to_buffer =
|
||||
@ -363,20 +359,4 @@ void EchoCanceller3::EmptyRenderQueue() {
|
||||
render_transfer_queue_.Remove(&render_queue_output_frame_);
|
||||
}
|
||||
}
|
||||
|
||||
EchoCanceller3Factory::EchoCanceller3Factory() {}
|
||||
|
||||
EchoCanceller3Factory::EchoCanceller3Factory(const EchoCanceller3Config& config)
|
||||
: config_(config) {
|
||||
// Revert to default configuration if needed.
|
||||
if (!EchoCanceller3::Validate(config_)) {
|
||||
config_ = EchoCanceller3Config();
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<EchoControl> EchoCanceller3Factory::Create(int sample_rate_hz) {
|
||||
return std::unique_ptr<EchoControl>(
|
||||
new EchoCanceller3(config_, sample_rate_hz, true));
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -92,9 +92,6 @@ class EchoCanceller3 : public EchoControl {
|
||||
block_processor_->UpdateEchoLeakageStatus(leakage_detected);
|
||||
}
|
||||
|
||||
// Validates a config.
|
||||
static bool Validate(const EchoCanceller3Config& config);
|
||||
|
||||
private:
|
||||
class RenderWriter;
|
||||
|
||||
|
||||
@ -681,11 +681,6 @@ TEST(EchoCanceller3Messaging, EchoLeakage) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST(EchoCanceller3, ConfigValidation) {
|
||||
EchoCanceller3Config config;
|
||||
EXPECT_TRUE(EchoCanceller3::Validate(config));
|
||||
}
|
||||
|
||||
#if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID)
|
||||
|
||||
TEST(EchoCanceller3InputCheck, WrongCaptureNumBandsCheckVerification) {
|
||||
|
||||
@ -1162,16 +1162,6 @@ class VoiceDetection {
|
||||
protected:
|
||||
virtual ~VoiceDetection() {}
|
||||
};
|
||||
|
||||
class EchoCanceller3Factory : public EchoControlFactory {
|
||||
public:
|
||||
EchoCanceller3Factory();
|
||||
EchoCanceller3Factory(const EchoCanceller3Config& config);
|
||||
std::unique_ptr<EchoControl> Create(int sample_rate_hz) override;
|
||||
|
||||
private:
|
||||
EchoCanceller3Config config_;
|
||||
};
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "api/audio/echo_canceller3_factory.h"
|
||||
#include "common_audio/include/audio_util.h"
|
||||
#include "modules/audio_processing/aec_dump/aec_dump_factory.h"
|
||||
#include "modules/audio_processing/include/audio_processing.h"
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "api/audio/echo_canceller3_factory.h"
|
||||
#include "modules/audio_coding/neteq/tools/resample_input_audio_file.h"
|
||||
#include "modules/audio_processing/aec_dump/aec_dump_factory.h"
|
||||
#include "modules/audio_processing/test/debug_dump_replayer.h"
|
||||
|
||||
Reference in New Issue
Block a user