Alex Loiko | ed8ff64 | 2018-07-06 14:54:30 +0200 | [diff] [blame] | 1 | # 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 | |
| 9 | import("../../../webrtc.gni") |
| 10 | |
| 11 | rtc_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 Loiko | ed8ff64 | 2018-07-06 14:54:30 +0200 | [diff] [blame] | 22 | "../../..:webrtc_common", |
| 23 | "../../../rtc_base:checks", |
Alex Loiko | 9489c3a | 2018-08-09 15:04:24 +0200 | [diff] [blame] | 24 | "../../../rtc_base:gtest_prod", |
Alex Loiko | ed8ff64 | 2018-07-06 14:54:30 +0200 | [diff] [blame] | 25 | "../../../rtc_base:logging", |
| 26 | "../../../rtc_base:macromagic", |
| 27 | "../../../rtc_base:safe_minmax", |
Mirko Bonadei | 17f4878 | 2018-09-28 08:51:10 +0200 | [diff] [blame^] | 28 | "../../../system_wrappers:metrics", |
Alex Loiko | 2ffafa8 | 2018-07-06 15:35:42 +0200 | [diff] [blame] | 29 | "../agc2:level_estimation_agc", |
Alex Loiko | ed8ff64 | 2018-07-06 14:54:30 +0200 | [diff] [blame] | 30 | "../vad", |
| 31 | ] |
| 32 | } |
| 33 | |
| 34 | rtc_source_set("level_estimation") { |
| 35 | sources = [ |
| 36 | "agc.cc", |
| 37 | "agc.h", |
| 38 | "loudness_histogram.cc", |
| 39 | "loudness_histogram.h", |
| 40 | "utility.cc", |
| 41 | "utility.h", |
| 42 | ] |
| 43 | deps = [ |
Alex Loiko | ed8ff64 | 2018-07-06 14:54:30 +0200 | [diff] [blame] | 44 | "../../..:webrtc_common", |
| 45 | "../../../rtc_base:checks", |
| 46 | "../../../rtc_base:macromagic", |
| 47 | "../vad", |
| 48 | ] |
| 49 | } |
| 50 | |
| 51 | rtc_source_set("agc_legacy_c") { |
| 52 | visibility = [ |
| 53 | ":*", |
| 54 | "..:*", |
| 55 | ] # Only targets in this file and in |
| 56 | # audio_processing can depend on |
| 57 | # this. |
| 58 | |
| 59 | sources = [ |
| 60 | "legacy/analog_agc.c", |
| 61 | "legacy/analog_agc.h", |
| 62 | "legacy/digital_agc.c", |
| 63 | "legacy/digital_agc.h", |
| 64 | "legacy/gain_control.h", |
| 65 | ] |
| 66 | |
| 67 | deps = [ |
Alex Loiko | ed8ff64 | 2018-07-06 14:54:30 +0200 | [diff] [blame] | 68 | "../../..:webrtc_common", |
| 69 | "../../../common_audio", |
| 70 | "../../../common_audio:common_audio_c", |
Artem Titov | 333a505 | 2018-07-25 16:56:18 +0200 | [diff] [blame] | 71 | "../../../common_audio/third_party/fft4g", |
Alex Loiko | ed8ff64 | 2018-07-06 14:54:30 +0200 | [diff] [blame] | 72 | "../../../rtc_base:checks", |
| 73 | "../../../rtc_base:rtc_base_approved", |
| 74 | "../../../system_wrappers:cpu_features_api", |
| 75 | ] |
| 76 | |
| 77 | if (rtc_build_with_neon) { |
| 78 | if (current_cpu != "arm64") { |
Oleh Prypin | d2f4e8b | 2018-08-01 12:18:05 +0200 | [diff] [blame] | 79 | # Enable compilation for the NEON instruction set. |
Alex Loiko | ed8ff64 | 2018-07-06 14:54:30 +0200 | [diff] [blame] | 80 | suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ] |
| 81 | cflags = [ "-mfpu=neon" ] |
| 82 | } |
| 83 | |
| 84 | # Disable LTO on NEON targets due to compiler bug. |
| 85 | # TODO(fdegans): Enable this. See crbug.com/408997. |
| 86 | if (rtc_use_lto) { |
| 87 | cflags -= [ |
| 88 | "-flto", |
| 89 | "-ffat-lto-objects", |
| 90 | ] |
| 91 | } |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | rtc_source_set("gain_map") { |
| 96 | sources = [ |
| 97 | "gain_map_internal.h", |
| 98 | ] |
| 99 | } |
| 100 | |
| 101 | if (rtc_include_tests) { |
| 102 | rtc_source_set("agc_unittests") { |
| 103 | testonly = true |
| 104 | sources = [ |
| 105 | "agc_manager_direct_unittest.cc", |
| 106 | "loudness_histogram_unittest.cc", |
| 107 | "mock_agc.h", |
| 108 | ] |
| 109 | configs += [ "..:apm_debug_dump" ] |
| 110 | |
| 111 | if ((!build_with_chromium || is_win) && is_clang) { |
| 112 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 113 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 114 | } |
| 115 | |
| 116 | deps = [ |
| 117 | ":agc", |
| 118 | ":level_estimation", |
| 119 | "..:mocks", |
| 120 | "../../..:webrtc_common", |
| 121 | "../../../test:fileutils", |
| 122 | "../../../test:test_support", |
| 123 | "//testing/gtest", |
| 124 | ] |
| 125 | } |
| 126 | } |