blob: 18dbfb9e92caba75d34b4b7007bb703cfb909861 [file] [log] [blame]
Alex Loikoed8ff642018-07-06 14:54:30 +02001# Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
9import("../../../webrtc.gni")
10
11rtc_source_set("agc") {
12 sources = [
13 "agc_manager_direct.cc",
14 "agc_manager_direct.h",
15 ]
16 configs += [ "..:apm_debug_dump" ]
17 deps = [
18 ":gain_map",
19 ":level_estimation",
20 "..:apm_logging",
21 "..:gain_control_interface",
Alex Loikoed8ff642018-07-06 14:54:30 +020022 "../../..:webrtc_common",
23 "../../../rtc_base:checks",
24 "../../../rtc_base:logging",
25 "../../../rtc_base:macromagic",
26 "../../../rtc_base:safe_minmax",
27 "../../../system_wrappers:metrics_api",
Alex Loiko2ffafa82018-07-06 15:35:42 +020028 "../agc2:level_estimation_agc",
Alex Loikoed8ff642018-07-06 14:54:30 +020029 "../vad",
30 ]
31}
32
33rtc_source_set("level_estimation") {
34 sources = [
35 "agc.cc",
36 "agc.h",
37 "loudness_histogram.cc",
38 "loudness_histogram.h",
39 "utility.cc",
40 "utility.h",
41 ]
42 deps = [
Alex Loikoed8ff642018-07-06 14:54:30 +020043 "../../..:webrtc_common",
44 "../../../rtc_base:checks",
45 "../../../rtc_base:macromagic",
46 "../vad",
47 ]
48}
49
50rtc_source_set("agc_legacy_c") {
51 visibility = [
52 ":*",
53 "..:*",
54 ] # Only targets in this file and in
55 # audio_processing can depend on
56 # this.
57
58 sources = [
59 "legacy/analog_agc.c",
60 "legacy/analog_agc.h",
61 "legacy/digital_agc.c",
62 "legacy/digital_agc.h",
63 "legacy/gain_control.h",
64 ]
65
66 deps = [
Alex Loikoed8ff642018-07-06 14:54:30 +020067 "../../..:webrtc_common",
68 "../../../common_audio",
69 "../../../common_audio:common_audio_c",
Artem Titov333a5052018-07-25 16:56:18 +020070 "../../../common_audio/third_party/fft4g",
Alex Loikoed8ff642018-07-06 14:54:30 +020071 "../../../rtc_base:checks",
72 "../../../rtc_base:rtc_base_approved",
73 "../../../system_wrappers:cpu_features_api",
74 ]
75
76 if (rtc_build_with_neon) {
77 if (current_cpu != "arm64") {
78 # Enable compilation for the NEON instruction set. This is needed
79 # since //build/config/arm.gni only enables NEON for iOS, not Android.
80 # This provides the same functionality as webrtc/build/arm_neon.gypi.
81 suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
82 cflags = [ "-mfpu=neon" ]
83 }
84
85 # Disable LTO on NEON targets due to compiler bug.
86 # TODO(fdegans): Enable this. See crbug.com/408997.
87 if (rtc_use_lto) {
88 cflags -= [
89 "-flto",
90 "-ffat-lto-objects",
91 ]
92 }
93 }
94}
95
96rtc_source_set("gain_map") {
97 sources = [
98 "gain_map_internal.h",
99 ]
100}
101
102if (rtc_include_tests) {
103 rtc_source_set("agc_unittests") {
104 testonly = true
105 sources = [
106 "agc_manager_direct_unittest.cc",
107 "loudness_histogram_unittest.cc",
108 "mock_agc.h",
109 ]
110 configs += [ "..:apm_debug_dump" ]
111
112 if ((!build_with_chromium || is_win) && is_clang) {
113 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
114 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
115 }
116
117 deps = [
118 ":agc",
119 ":level_estimation",
120 "..:mocks",
121 "../../..:webrtc_common",
122 "../../../test:fileutils",
123 "../../../test:test_support",
124 "//testing/gtest",
125 ]
126 }
127}