diff --git a/modules/audio_processing/BUILD.gn b/modules/audio_processing/BUILD.gn index 6f09165525..4b53c39cc0 100644 --- a/modules/audio_processing/BUILD.gn +++ b/modules/audio_processing/BUILD.gn @@ -19,9 +19,6 @@ declare_args() { rtc_static_library("audio_processing") { sources = [ - "aec/aec_core.cc", - "aec/aec_core.h", - "aec/aec_core_optimized_methods.h", "aec/aec_resampler.cc", "aec/aec_resampler.h", "aec/echo_cancellation.cc", @@ -101,10 +98,6 @@ rtc_static_library("audio_processing") { "aec3/vector_buffer.cc", "aec3/vector_buffer.h", "aec3/vector_math.h", - "aecm/aecm_core.cc", - "aecm/aecm_core.h", - "aecm/echo_control_mobile.cc", - "aecm/echo_control_mobile.h", "agc/agc.cc", "agc/agc.h", "agc/agc_manager_direct.cc", @@ -172,8 +165,6 @@ rtc_static_library("audio_processing") { "level_controller/signal_classifier.h", "level_estimator_impl.cc", "level_estimator_impl.h", - "logging/apm_data_dumper.cc", - "logging/apm_data_dumper.h", "low_cut_filter.cc", "low_cut_filter.h", "noise_suppression_impl.cc", @@ -202,16 +193,6 @@ rtc_static_library("audio_processing") { "transient/wpd_tree.h", "typing_detection.cc", "typing_detection.h", - "utility/block_mean_calculator.cc", - "utility/block_mean_calculator.h", - "utility/delay_estimator.cc", - "utility/delay_estimator.h", - "utility/delay_estimator_internal.h", - "utility/delay_estimator_wrapper.cc", - "utility/delay_estimator_wrapper.h", - "utility/ooura_fft.cc", - "utility/ooura_fft.h", - "utility/ooura_fft_tables_common.h", "vad/common.h", "vad/gmm.cc", "vad/gmm.h", @@ -238,7 +219,9 @@ rtc_static_library("audio_processing") { defines = [] deps = [ + ":aec_core", ":aec_dump_interface", + ":apm_logging", ":audio_processing_statistics", "..:module_api", "../..:webrtc_common", @@ -263,6 +246,14 @@ rtc_static_library("audio_processing") { defines += [ "WEBRTC_UNTRUSTED_DELAY" ] } + if (current_cpu == "x86" || current_cpu == "x64") { + deps += [ ":audio_processing_sse2" ] + } + + if (rtc_build_with_neon) { + deps += [ ":audio_processing_neon" ] + } + if (rtc_enable_protobuf) { defines += [ "WEBRTC_AUDIOPROC_DEBUG_DUMP" ] deps += [ ":audioproc_debug_proto" ] @@ -286,26 +277,6 @@ rtc_static_library("audio_processing") { defines += [ "WEBRTC_NS_FLOAT" ] } - if (current_cpu == "x86" || current_cpu == "x64") { - deps += [ ":audio_processing_sse2" ] - } - - if (rtc_build_with_neon) { - deps += [ ":audio_processing_neon" ] - } - - if (current_cpu == "mipsel") { - sources += [ "aecm/aecm_core_mips.cc" ] - if (mips_float_abi == "hard") { - sources += [ - "aec/aec_core_mips.cc", - "utility/ooura_fft_mips.cc", - ] - } - } else { - sources += [ "aecm/aecm_core_c.cc" ] - } - # TODO(jschuh): Bug 1348: fix this warning. configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] @@ -396,18 +367,86 @@ if (rtc_enable_protobuf) { } } +rtc_source_set("apm_logging") { + sources = [ + "logging/apm_data_dumper.cc", + "logging/apm_data_dumper.h", + ] + deps = [ + "../../api:array_view", + "../../common_audio:common_audio", + "../../rtc_base:rtc_base_approved", + ] + defines = [] + if (apm_debug_dump) { + defines += [ "WEBRTC_APM_DEBUG_DUMP=1" ] + } else { + defines += [ "WEBRTC_APM_DEBUG_DUMP=0" ] + } +} + +rtc_source_set("aec_core") { + sources = [ + "aec/aec_core.cc", + "aec/aec_core.h", + "aec/aec_core_optimized_methods.h", + "aecm/aecm_core.cc", + "aecm/aecm_core.h", + "aecm/echo_control_mobile.cc", + "aecm/echo_control_mobile.h", + "utility/block_mean_calculator.cc", + "utility/block_mean_calculator.h", + "utility/delay_estimator.cc", + "utility/delay_estimator.h", + "utility/delay_estimator_internal.h", + "utility/delay_estimator_wrapper.cc", + "utility/delay_estimator_wrapper.h", + "utility/ooura_fft.cc", + "utility/ooura_fft.h", + "utility/ooura_fft_tables_common.h", + ] + deps = [ + ":apm_logging", + ":audio_processing_statistics", + "../..:webrtc_common", + "../../common_audio:common_audio", + "../../rtc_base:rtc_base_approved", + "../../system_wrappers:cpu_features_api", + "../../system_wrappers:metrics_api", + ] + + if (current_cpu == "mipsel") { + sources += [ "aecm/aecm_core_mips.cc" ] + if (mips_float_abi == "hard") { + sources += [ + "aec/aec_core_mips.cc", + "utility/ooura_fft_mips.cc", + ] + } + } else { + sources += [ "aecm/aecm_core_c.cc" ] + } + defines = [] + if (apm_debug_dump) { + defines += [ "WEBRTC_APM_DEBUG_DUMP=1" ] + } else { + defines += [ "WEBRTC_APM_DEBUG_DUMP=0" ] + } +} + if (current_cpu == "x86" || current_cpu == "x64") { rtc_static_library("audio_processing_sse2") { - # TODO(ehmaldonado): Remove (bugs.webrtc.org/6828) - # Errors on cyclic dependency with :audio_processing if enabled. - check_includes = false - sources = [ "aec/aec_core_sse2.cc", "utility/ooura_fft_sse2.cc", "utility/ooura_fft_tables_neon_sse2.h", ] + deps = [ + ":aec_core", + "../../common_audio:common_audio", + ] + if (is_posix) { cflags = [ "-msse2" ] } @@ -422,10 +461,6 @@ if (current_cpu == "x86" || current_cpu == "x64") { if (rtc_build_with_neon) { rtc_static_library("audio_processing_neon") { - # TODO(ehmaldonado): Remove (bugs.webrtc.org/6828) - # Errors on cyclic dependency with :audio_processing if enabled. - check_includes = false - sources = [ "aec/aec_core_neon.cc", "aecm/aecm_core_neon.cc", @@ -451,7 +486,9 @@ if (rtc_build_with_neon) { } deps = [ + ":aec_core", "../../common_audio", + "../../rtc_base:rtc_base_approved", ] public_deps = [ ":audio_processing_neon_c", @@ -562,7 +599,9 @@ if (rtc_include_tests) { ] deps = [ + ":aec_core", ":analog_mic_simulation", + ":apm_logging", ":audio_processing", ":audioproc_test_utils", "..:module_api", @@ -688,16 +727,6 @@ if (rtc_include_tests) { } rtc_source_set("audio_processing_perf_tests") { - # Has problems with autogenerated targets on Android and iOS - # Dependency chain (there may also be others): - # :audio_processing_perf_tests --> - # ..:modules_unittests --[private]--> - # ..:modules_unittests_apk --> - # ..:modules_unittests_apk__create --> - # ..:modules_unittests_apk__create__finalize --> - # ..:modules_unittests_apk__create__package --[private]--> - # ..:_modules_unittests__library - check_includes = false testonly = true sources = [ diff --git a/modules/audio_processing/test/py_quality_assessment/BUILD.gn b/modules/audio_processing/test/py_quality_assessment/BUILD.gn index 64e3a30bd3..19cfc03d65 100644 --- a/modules/audio_processing/test/py_quality_assessment/BUILD.gn +++ b/modules/audio_processing/test/py_quality_assessment/BUILD.gn @@ -141,6 +141,7 @@ rtc_executable("apm_vad") { "../../../..:webrtc_common", "../../../../common_audio", "../../../../rtc_base:rtc_base_approved", + "../../../../system_wrappers:metrics_default", ] }