blob: a9ca0d55ab1141e6608439d1ef944f56007607a0 [file] [log] [blame]
Peter Boström5c389d32015-09-25 13:58:30 +02001# Copyright (c) 2015 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
mbonadei9aa3f0a2017-01-24 06:58:22 -08009import("../webrtc.gni")
kjellander8f8d1a02017-03-06 04:01:16 -080010if (is_android) {
11 import("//build/config/android/config.gni")
12 import("//build/config/android/rules.gni")
13}
Peter Boström5c389d32015-09-25 13:58:30 +020014
kjellanderb62dbbe2016-09-23 00:38:52 -070015rtc_static_library("audio") {
Peter Boström5c389d32015-09-25 13:58:30 +020016 sources = [
17 "audio_receive_stream.cc",
18 "audio_receive_stream.h",
solenbergc7a8b082015-10-16 14:35:07 -070019 "audio_send_stream.cc",
20 "audio_send_stream.h",
solenberg566ef242015-11-06 15:34:49 -080021 "audio_state.cc",
22 "audio_state.h",
aleloidd310712016-11-17 06:28:59 -080023 "audio_transport_proxy.cc",
24 "audio_transport_proxy.h",
Fredrik Solenberg4f4ec0a2015-10-22 10:49:27 +020025 "conversion.h",
26 "scoped_voe_interface.h",
sazac58f8c02017-07-19 00:39:19 -070027 "time_interval.cc",
28 "time_interval.h",
Peter Boström5c389d32015-09-25 13:58:30 +020029 ]
30
kjellandere40a7ee2016-10-16 23:56:12 -070031 if (!build_with_chromium && is_clang) {
32 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070033 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Peter Boström5c389d32015-09-25 13:58:30 +020034 }
35
36 deps = [
37 "..:webrtc_common",
aleloiaed581a2016-10-20 06:32:39 -070038 "../api:audio_mixer_api",
kjellander676e08f2016-12-07 08:23:27 -080039 "../api:call_api",
kwiberg84f6a3f2017-09-05 08:43:13 -070040 "../api:optional",
ossueb1fde42017-05-02 06:46:30 -070041 "../api/audio_codecs:audio_codecs_api",
42 "../api/audio_codecs:builtin_audio_encoder_factory",
Mirko Bonadei245660a2017-10-10 14:38:11 +020043 "../call:bitrate_allocator",
ossuf515ab82016-12-07 04:52:58 -080044 "../call:call_interfaces",
nissed76b7b22017-06-01 04:02:35 -070045 "../call:rtp_interfaces",
aleloi04c07222016-11-22 06:42:53 -080046 "../common_audio",
ossu20a4b3f2017-04-27 02:08:52 -070047 "../modules/audio_coding:cng",
aleloidd310712016-11-17 06:28:59 -080048 "../modules/audio_device",
49 "../modules/audio_processing",
stefan7de8d642017-02-07 07:14:08 -080050 "../modules/bitrate_controller:bitrate_controller",
kjellander676e08f2016-12-07 08:23:27 -080051 "../modules/congestion_controller:congestion_controller",
52 "../modules/pacing:pacing",
53 "../modules/remote_bitrate_estimator:remote_bitrate_estimator",
54 "../modules/rtp_rtcp:rtp_rtcp",
ehmaldonadof6a861a2017-07-19 10:40:47 -070055 "../rtc_base:rtc_base_approved",
56 "../rtc_base:rtc_task_queue",
Peter Boström5c389d32015-09-25 13:58:30 +020057 "../system_wrappers",
Tommif888bb52015-12-12 01:37:01 +010058 "../voice_engine",
Peter Boström5c389d32015-09-25 13:58:30 +020059 ]
60}
Peter Boström02083222016-06-14 12:52:54 +020061if (rtc_include_tests) {
Fredrik Solenberg73276ad2017-09-14 14:46:47 +020062 rtc_source_set("audio_end_to_end_test") {
63 testonly = true
64
65 sources = [
66 "test/audio_end_to_end_test.cc",
67 "test/audio_end_to_end_test.h",
68 ]
69 deps = [
70 ":audio",
71 "../system_wrappers:system_wrappers",
72 "../test:fake_audio_device",
73 "../test:test_common",
74 "../test:test_support",
75 ]
76
77 if (!build_with_chromium && is_clang) {
78 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
79 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
80 }
81 }
82
ehmaldonado38a21322016-09-02 04:10:34 -070083 rtc_source_set("audio_tests") {
Peter Boström02083222016-06-14 12:52:54 +020084 testonly = true
kjellander676e08f2016-12-07 08:23:27 -080085
kjellandere0629c02017-04-25 04:04:50 -070086 # Skip restricting visibility on mobile platforms since the tests on those
87 # gets additional generated targets which would require many lines here to
88 # cover (which would be confusing to read and hard to maintain).
89 if (!is_android && !is_ios) {
jianjun.zhuc0247402017-07-11 06:20:45 -070090 visibility = [ "..:video_engine_tests" ]
kjellandere0629c02017-04-25 04:04:50 -070091 }
92
kjellander676e08f2016-12-07 08:23:27 -080093 # TODO(kjellander): Remove (bugs.webrtc.org/6828)
94 # This needs remote_bitrate_estimator to be moved to webrtc/api first.
95 check_includes = false
96
Peter Boström02083222016-06-14 12:52:54 +020097 sources = [
98 "audio_receive_stream_unittest.cc",
solenberg18f54272017-09-15 09:56:08 -070099 "audio_send_stream_tests.cc",
Peter Boström02083222016-06-14 12:52:54 +0200100 "audio_send_stream_unittest.cc",
101 "audio_state_unittest.cc",
sazac58f8c02017-07-19 00:39:19 -0700102 "time_interval_unittest.cc",
Peter Boström02083222016-06-14 12:52:54 +0200103 ]
104 deps = [
105 ":audio",
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200106 ":audio_end_to_end_test",
aleloi04c07222016-11-22 06:42:53 -0800107 "../api:mock_audio_mixer",
nisse0f15f922017-06-21 01:05:22 -0700108 "../call:rtp_receiver",
aleloidd310712016-11-17 06:28:59 -0800109 "../modules/audio_device:mock_audio_device",
aleloi04c07222016-11-22 06:42:53 -0800110 "../modules/audio_mixer:audio_mixer_impl",
kjellander676e08f2016-12-07 08:23:27 -0800111 "../modules/congestion_controller:congestion_controller",
zstein7cb69d52017-05-08 11:52:38 -0700112 "../modules/congestion_controller:mock_congestion_controller",
kjellander676e08f2016-12-07 08:23:27 -0800113 "../modules/pacing:pacing",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700114 "../rtc_base:rtc_base_approved",
115 "../rtc_base:rtc_task_queue",
aleloi10111bc2016-11-17 06:48:48 -0800116 "../test:test_common",
aleloi6321b492016-12-05 01:46:09 -0800117 "../test:test_support",
ehmaldonado894c2bb2017-01-05 06:03:24 -0800118 "utility:utility_tests",
Peter Boström02083222016-06-14 12:52:54 +0200119 "//testing/gmock",
120 "//testing/gtest",
121 ]
oprypin5e1ca782017-03-20 02:06:18 -0700122
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200123 if (!rtc_use_memcheck) {
124 # This test is timing dependent, which rules out running on memcheck bots.
125 sources += [ "test/audio_stats_test.cc" ]
126 }
127
kjellandere40a7ee2016-10-16 23:56:12 -0700128 if (!build_with_chromium && is_clang) {
129 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700130 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Peter Boström02083222016-06-14 12:52:54 +0200131 }
132 }
kjellander8f8d1a02017-03-06 04:01:16 -0800133
134 if (rtc_enable_protobuf) {
oprypin6d305ba2017-03-30 04:01:30 -0700135 rtc_test("low_bandwidth_audio_test") {
kjellander8f8d1a02017-03-06 04:01:16 -0800136 testonly = true
137
138 sources = [
139 "test/low_bandwidth_audio_test.cc",
140 ]
141
oprypin92220ff2017-03-23 03:40:03 -0700142 deps = [
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200143 ":audio_end_to_end_test",
oprypin92220ff2017-03-23 03:40:03 -0700144 "../common_audio",
oprypin9b2f20c2017-08-29 05:51:57 -0700145 "../rtc_base:rtc_base_approved",
oprypin92220ff2017-03-23 03:40:03 -0700146 "../system_wrappers",
147 "../test:fake_audio_device",
oprypin92220ff2017-03-23 03:40:03 -0700148 "../test:test_common",
149 "../test:test_main",
tschumim9d117642017-07-17 01:41:41 -0700150 "//testing/gmock",
151 "//testing/gtest",
oprypin92220ff2017-03-23 03:40:03 -0700152 ]
kjellander8f8d1a02017-03-06 04:01:16 -0800153 if (is_android) {
oprypin92220ff2017-03-23 03:40:03 -0700154 deps += [ "//testing/android/native_test:native_test_native_code" ]
155 }
156
157 data = [
Edward Lemur20110752017-09-28 16:14:37 +0200158 "../resources/voice_engine/audio_dtx16.wav",
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200159 "../resources/voice_engine/audio_tiny16.wav",
160 "../resources/voice_engine/audio_tiny48.wav",
Edward Lemur20110752017-09-28 16:14:37 +0200161 "test/low_bandwidth_audio_test.py",
oprypin92220ff2017-03-23 03:40:03 -0700162 ]
Edward Lemur20110752017-09-28 16:14:37 +0200163 if (is_linux) {
164 data += [
165 "../tools_webrtc/audio_quality/linux/PolqaOem64",
166 "../tools_webrtc/audio_quality/linux/pesq",
167 ]
168 }
169 if (is_win) {
170 data += [
171 "../tools_webrtc/audio_quality/win/PolqaOem64.dll",
172 "../tools_webrtc/audio_quality/win/PolqaOem64.exe",
173 "../tools_webrtc/audio_quality/win/pesq.exe",
174 "../tools_webrtc/audio_quality/win/vcomp120.dll",
175 ]
176 }
177 if (is_mac) {
178 data += [ "../tools_webrtc/audio_quality/mac/pesq" ]
179 }
oprypin92220ff2017-03-23 03:40:03 -0700180
181 if (!build_with_chromium && is_clang) {
182 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163)
183 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander8f8d1a02017-03-06 04:01:16 -0800184 }
185 }
186 }
tschumim9d117642017-07-17 01:41:41 -0700187
188 rtc_source_set("audio_perf_tests") {
189 testonly = true
190
191 # Skip restricting visibility on mobile platforms since the tests on those
192 # gets additional generated targets which would require many lines here to
193 # cover (which would be confusing to read and hard to maintain).
194 if (!is_android && !is_ios) {
Jianjun Zhu037f3e42017-08-15 21:48:37 +0800195 visibility = [ "..:webrtc_perf_tests" ]
tschumim9d117642017-07-17 01:41:41 -0700196 }
197 sources = [
198 "test/audio_bwe_integration_test.cc",
199 "test/audio_bwe_integration_test.h",
200 ]
201 deps = [
tschumim9d117642017-07-17 01:41:41 -0700202 "../common_audio",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700203 "../rtc_base:rtc_base_approved",
tschumim9d117642017-07-17 01:41:41 -0700204 "../system_wrappers",
205 "../test:fake_audio_device",
206 "../test:field_trial",
eladalon413ee9a2017-08-22 04:02:52 -0700207 "../test:single_threaded_task_queue",
tschumim9d117642017-07-17 01:41:41 -0700208 "../test:test_common",
209 "../test:test_main",
210 "//testing/gmock",
211 "//testing/gtest",
tschumim9d117642017-07-17 01:41:41 -0700212 ]
213
214 data = [
215 "//resources/voice_engine/audio_dtx16.wav",
216 ]
217
218 if (!build_with_chromium && is_clang) {
219 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
220 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
221 }
222 }
Peter Boström02083222016-06-14 12:52:54 +0200223}