blob: 6917713dfa29ed443b0f3a57c80d4627573fa082 [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",
ossuf515ab82016-12-07 04:52:58 -080043 "../call:call_interfaces",
nissed76b7b22017-06-01 04:02:35 -070044 "../call:rtp_interfaces",
aleloi04c07222016-11-22 06:42:53 -080045 "../common_audio",
ossu20a4b3f2017-04-27 02:08:52 -070046 "../modules/audio_coding:cng",
aleloidd310712016-11-17 06:28:59 -080047 "../modules/audio_device",
48 "../modules/audio_processing",
stefan7de8d642017-02-07 07:14:08 -080049 "../modules/bitrate_controller:bitrate_controller",
kjellander676e08f2016-12-07 08:23:27 -080050 "../modules/congestion_controller:congestion_controller",
51 "../modules/pacing:pacing",
52 "../modules/remote_bitrate_estimator:remote_bitrate_estimator",
53 "../modules/rtp_rtcp:rtp_rtcp",
ehmaldonadof6a861a2017-07-19 10:40:47 -070054 "../rtc_base:rtc_base_approved",
55 "../rtc_base:rtc_task_queue",
Peter Boström5c389d32015-09-25 13:58:30 +020056 "../system_wrappers",
Tommif888bb52015-12-12 01:37:01 +010057 "../voice_engine",
Peter Boström5c389d32015-09-25 13:58:30 +020058 ]
59}
Peter Boström02083222016-06-14 12:52:54 +020060if (rtc_include_tests) {
Fredrik Solenberg73276ad2017-09-14 14:46:47 +020061 rtc_source_set("audio_end_to_end_test") {
62 testonly = true
63
64 sources = [
65 "test/audio_end_to_end_test.cc",
66 "test/audio_end_to_end_test.h",
67 ]
68 deps = [
69 ":audio",
70 "../system_wrappers:system_wrappers",
71 "../test:fake_audio_device",
72 "../test:test_common",
73 "../test:test_support",
74 ]
75
76 if (!build_with_chromium && is_clang) {
77 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
78 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
79 }
80 }
81
ehmaldonado38a21322016-09-02 04:10:34 -070082 rtc_source_set("audio_tests") {
Peter Boström02083222016-06-14 12:52:54 +020083 testonly = true
kjellander676e08f2016-12-07 08:23:27 -080084
kjellandere0629c02017-04-25 04:04:50 -070085 # Skip restricting visibility on mobile platforms since the tests on those
86 # gets additional generated targets which would require many lines here to
87 # cover (which would be confusing to read and hard to maintain).
88 if (!is_android && !is_ios) {
jianjun.zhuc0247402017-07-11 06:20:45 -070089 visibility = [ "..:video_engine_tests" ]
kjellandere0629c02017-04-25 04:04:50 -070090 }
91
kjellander676e08f2016-12-07 08:23:27 -080092 # TODO(kjellander): Remove (bugs.webrtc.org/6828)
93 # This needs remote_bitrate_estimator to be moved to webrtc/api first.
94 check_includes = false
95
Peter Boström02083222016-06-14 12:52:54 +020096 sources = [
97 "audio_receive_stream_unittest.cc",
solenberg18f54272017-09-15 09:56:08 -070098 "audio_send_stream_tests.cc",
Peter Boström02083222016-06-14 12:52:54 +020099 "audio_send_stream_unittest.cc",
100 "audio_state_unittest.cc",
sazac58f8c02017-07-19 00:39:19 -0700101 "time_interval_unittest.cc",
Peter Boström02083222016-06-14 12:52:54 +0200102 ]
103 deps = [
104 ":audio",
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200105 ":audio_end_to_end_test",
aleloi04c07222016-11-22 06:42:53 -0800106 "../api:mock_audio_mixer",
nisse0f15f922017-06-21 01:05:22 -0700107 "../call:rtp_receiver",
aleloidd310712016-11-17 06:28:59 -0800108 "../modules/audio_device:mock_audio_device",
aleloi04c07222016-11-22 06:42:53 -0800109 "../modules/audio_mixer:audio_mixer_impl",
kjellander676e08f2016-12-07 08:23:27 -0800110 "../modules/congestion_controller:congestion_controller",
zstein7cb69d52017-05-08 11:52:38 -0700111 "../modules/congestion_controller:mock_congestion_controller",
kjellander676e08f2016-12-07 08:23:27 -0800112 "../modules/pacing:pacing",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700113 "../rtc_base:rtc_base_approved",
114 "../rtc_base:rtc_task_queue",
aleloi10111bc2016-11-17 06:48:48 -0800115 "../test:test_common",
aleloi6321b492016-12-05 01:46:09 -0800116 "../test:test_support",
ehmaldonado894c2bb2017-01-05 06:03:24 -0800117 "utility:utility_tests",
Peter Boström02083222016-06-14 12:52:54 +0200118 "//testing/gmock",
119 "//testing/gtest",
120 ]
oprypin5e1ca782017-03-20 02:06:18 -0700121
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200122 if (!rtc_use_memcheck) {
123 # This test is timing dependent, which rules out running on memcheck bots.
124 sources += [ "test/audio_stats_test.cc" ]
125 }
126
kjellandere40a7ee2016-10-16 23:56:12 -0700127 if (!build_with_chromium && is_clang) {
128 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700129 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Peter Boström02083222016-06-14 12:52:54 +0200130 }
131 }
kjellander8f8d1a02017-03-06 04:01:16 -0800132
133 if (rtc_enable_protobuf) {
oprypin6d305ba2017-03-30 04:01:30 -0700134 rtc_test("low_bandwidth_audio_test") {
kjellander8f8d1a02017-03-06 04:01:16 -0800135 testonly = true
136
137 sources = [
138 "test/low_bandwidth_audio_test.cc",
139 ]
140
oprypin92220ff2017-03-23 03:40:03 -0700141 deps = [
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200142 ":audio_end_to_end_test",
oprypin92220ff2017-03-23 03:40:03 -0700143 "../common_audio",
oprypin9b2f20c2017-08-29 05:51:57 -0700144 "../rtc_base:rtc_base_approved",
oprypin92220ff2017-03-23 03:40:03 -0700145 "../system_wrappers",
146 "../test:fake_audio_device",
oprypin92220ff2017-03-23 03:40:03 -0700147 "../test:test_common",
148 "../test:test_main",
tschumim9d117642017-07-17 01:41:41 -0700149 "//testing/gmock",
150 "//testing/gtest",
oprypin92220ff2017-03-23 03:40:03 -0700151 ]
kjellander8f8d1a02017-03-06 04:01:16 -0800152 if (is_android) {
oprypin92220ff2017-03-23 03:40:03 -0700153 deps += [ "//testing/android/native_test:native_test_native_code" ]
154 }
155
156 data = [
Edward Lemur20110752017-09-28 16:14:37 +0200157 "../resources/voice_engine/audio_dtx16.wav",
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200158 "../resources/voice_engine/audio_tiny16.wav",
159 "../resources/voice_engine/audio_tiny48.wav",
Edward Lemur20110752017-09-28 16:14:37 +0200160 "test/low_bandwidth_audio_test.py",
oprypin92220ff2017-03-23 03:40:03 -0700161 ]
Edward Lemur20110752017-09-28 16:14:37 +0200162 if (is_linux) {
163 data += [
164 "../tools_webrtc/audio_quality/linux/PolqaOem64",
165 "../tools_webrtc/audio_quality/linux/pesq",
166 ]
167 }
168 if (is_win) {
169 data += [
170 "../tools_webrtc/audio_quality/win/PolqaOem64.dll",
171 "../tools_webrtc/audio_quality/win/PolqaOem64.exe",
172 "../tools_webrtc/audio_quality/win/pesq.exe",
173 "../tools_webrtc/audio_quality/win/vcomp120.dll",
174 ]
175 }
176 if (is_mac) {
177 data += [ "../tools_webrtc/audio_quality/mac/pesq" ]
178 }
oprypin92220ff2017-03-23 03:40:03 -0700179
180 if (!build_with_chromium && is_clang) {
181 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163)
182 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander8f8d1a02017-03-06 04:01:16 -0800183 }
184 }
185 }
tschumim9d117642017-07-17 01:41:41 -0700186
187 rtc_source_set("audio_perf_tests") {
188 testonly = true
189
190 # Skip restricting visibility on mobile platforms since the tests on those
191 # gets additional generated targets which would require many lines here to
192 # cover (which would be confusing to read and hard to maintain).
193 if (!is_android && !is_ios) {
Jianjun Zhu037f3e42017-08-15 21:48:37 +0800194 visibility = [ "..:webrtc_perf_tests" ]
tschumim9d117642017-07-17 01:41:41 -0700195 }
196 sources = [
197 "test/audio_bwe_integration_test.cc",
198 "test/audio_bwe_integration_test.h",
199 ]
200 deps = [
tschumim9d117642017-07-17 01:41:41 -0700201 "../common_audio",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700202 "../rtc_base:rtc_base_approved",
tschumim9d117642017-07-17 01:41:41 -0700203 "../system_wrappers",
204 "../test:fake_audio_device",
205 "../test:field_trial",
eladalon413ee9a2017-08-22 04:02:52 -0700206 "../test:single_threaded_task_queue",
tschumim9d117642017-07-17 01:41:41 -0700207 "../test:test_common",
208 "../test:test_main",
209 "//testing/gmock",
210 "//testing/gtest",
tschumim9d117642017-07-17 01:41:41 -0700211 ]
212
213 data = [
214 "//resources/voice_engine/audio_dtx16.wav",
215 ]
216
217 if (!build_with_chromium && is_clang) {
218 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
219 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
220 }
221 }
Peter Boström02083222016-06-14 12:52:54 +0200222}