Reland: Fix all circular deps in audio_processing (but one).

Arguably we should add a few more targets, for instance a utility
target, but I tried to create as few targets as possible here based on
the current usage.

Bug: webrtc:6828
Change-Id: Icc9400d76f4016c8b0943aa734430955208a14f8
Reviewed-on: https://webrtc-review.googlesource.com/28301
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21199}
This commit is contained in:
Patrik Höglund 2017-12-11 10:28:16 +01:00 committed by Commit Bot
parent a5a37d07d2
commit e6ffc422af
2 changed files with 81 additions and 79 deletions

View File

@ -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_c",
":audio_processing_statistics",
"..:module_api",
@ -286,26 +269,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,37 +359,69 @@ if (rtc_enable_protobuf) {
}
}
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
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" ]
}
}
sources = [
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",
]
cflags = []
defines = []
if (current_cpu == "x86" || current_cpu == "x64") {
sources += [
"aec/aec_core_sse2.cc",
"utility/ooura_fft_sse2.cc",
"utility/ooura_fft_tables_neon_sse2.h",
]
if (is_posix) {
cflags = [ "-msse2" ]
}
if (apm_debug_dump) {
defines = [ "WEBRTC_APM_DEBUG_DUMP=1" ]
} else {
defines = [ "WEBRTC_APM_DEBUG_DUMP=0" ]
cflags += [ "-msse2" ]
}
}
}
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 = [
if (rtc_build_with_neon) {
sources += [
"aec/aec_core_neon.cc",
"aecm/aecm_core_neon.cc",
"utility/ooura_fft_neon.cc",
@ -438,7 +433,7 @@ if (rtc_build_with_neon) {
# since //build/config/arm.gni only enables NEON for iOS, not Android.
# This provides the same functionality as webrtc/build/arm_neon.gypi.
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
cflags = [ "-mfpu=neon" ]
cflags += [ "-mfpu=neon" ]
}
# Disable LTO on NEON targets due to compiler bug.
@ -450,18 +445,31 @@ if (rtc_build_with_neon) {
]
}
deps = [
deps += [
":audio_processing_neon_c",
"../../common_audio",
]
if (apm_debug_dump) {
defines = [ "WEBRTC_APM_DEBUG_DUMP=1" ]
} else {
defines = [ "WEBRTC_APM_DEBUG_DUMP=0" ]
}
}
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" ]
}
if (apm_debug_dump) {
defines += [ "WEBRTC_APM_DEBUG_DUMP=1" ]
} else {
defines += [ "WEBRTC_APM_DEBUG_DUMP=0" ]
}
}
if (rtc_build_with_neon) {
rtc_static_library("audio_processing_neon_c") {
# TODO(mbonadei): Remove (bugs.webrtc.org/6828)
# Errors on cyclic dependency with :audio_processing_c if enabled.
@ -560,7 +568,9 @@ if (rtc_include_tests) {
]
deps = [
":aec_core",
":analog_mic_simulation",
":apm_logging",
":audio_processing",
":audioproc_test_utils",
"..:module_api",
@ -687,16 +697,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 = [
@ -830,6 +830,7 @@ if (rtc_include_tests) {
"../../common_audio:common_audio",
"../../rtc_base:rtc_base_approved",
"../../system_wrappers",
"../../system_wrappers:metrics_default",
"../../test:test_support",
"//testing/gtest",
]

View File

@ -141,6 +141,7 @@ rtc_executable("apm_vad") {
"../../../..:webrtc_common",
"../../../../common_audio",
"../../../../rtc_base:rtc_base_approved",
"../../../../system_wrappers:metrics_default",
]
}