blob: 451708ab59d6092c90c584d82c40a307d0734398 [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 = [
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010017 "audio_level.cc",
18 "audio_level.h",
Peter Boström5c389d32015-09-25 13:58:30 +020019 "audio_receive_stream.cc",
20 "audio_receive_stream.h",
solenbergc7a8b082015-10-16 14:35:07 -070021 "audio_send_stream.cc",
22 "audio_send_stream.h",
solenberg566ef242015-11-06 15:34:49 -080023 "audio_state.cc",
24 "audio_state.h",
Fredrik Solenberg2a877972017-12-15 16:42:15 +010025 "audio_transport_impl.cc",
26 "audio_transport_impl.h",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010027 "channel.cc",
28 "channel.h",
29 "channel_proxy.cc",
30 "channel_proxy.h",
Fredrik Solenberg4f4ec0a2015-10-22 10:49:27 +020031 "conversion.h",
henrika5f6bf242017-11-01 11:06:56 +010032 "null_audio_poller.cc",
33 "null_audio_poller.h",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010034 "remix_resample.cc",
35 "remix_resample.h",
sazac58f8c02017-07-19 00:39:19 -070036 "time_interval.cc",
37 "time_interval.h",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010038 "transport_feedback_packet_loss_tracker.cc",
39 "transport_feedback_packet_loss_tracker.h",
Peter Boström5c389d32015-09-25 13:58:30 +020040 ]
41
kjellandere40a7ee2016-10-16 23:56:12 -070042 if (!build_with_chromium && is_clang) {
43 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070044 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Peter Boström5c389d32015-09-25 13:58:30 +020045 }
46
47 deps = [
48 "..:webrtc_common",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010049 "../api:array_view",
kjellander676e08f2016-12-07 08:23:27 -080050 "../api:call_api",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010051 "../api:libjingle_peerconnection_api",
kwiberg84f6a3f2017-09-05 08:43:13 -070052 "../api:optional",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010053 "../api:transport_api",
Gustaf Ullbergf35c6662018-02-23 13:18:29 +010054 "../api/audio:aec3_factory",
Gustaf Ullberg2ae140a2018-02-16 13:43:49 +010055 "../api/audio:audio_mixer_api",
ossueb1fde42017-05-02 06:46:30 -070056 "../api/audio_codecs:audio_codecs_api",
57 "../api/audio_codecs:builtin_audio_encoder_factory",
Mirko Bonadei245660a2017-10-10 14:38:11 +020058 "../call:bitrate_allocator",
ossuf515ab82016-12-07 04:52:58 -080059 "../call:call_interfaces",
nissed76b7b22017-06-01 04:02:35 -070060 "../call:rtp_interfaces",
aleloi04c07222016-11-22 06:42:53 -080061 "../common_audio",
Mirko Bonadeidbbb33c2018-02-05 15:50:41 +010062 "../common_audio:common_audio_c",
Qingsi Wang970b0882018-02-01 11:04:46 -080063 "../logging:rtc_event_audio",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010064 "../logging:rtc_event_log_api",
65 "../modules:module_api",
66 "../modules/audio_coding",
67 "../modules/audio_coding:audio_format_conversion",
68 "../modules/audio_coding:audio_network_adaptor_config",
ossu20a4b3f2017-04-27 02:08:52 -070069 "../modules/audio_coding:cng",
aleloidd310712016-11-17 06:28:59 -080070 "../modules/audio_device",
71 "../modules/audio_processing",
stefan7de8d642017-02-07 07:14:08 -080072 "../modules/bitrate_controller:bitrate_controller",
kjellander676e08f2016-12-07 08:23:27 -080073 "../modules/pacing:pacing",
74 "../modules/remote_bitrate_estimator:remote_bitrate_estimator",
Mirko Bonadeib5728d92017-12-06 07:51:33 +010075 "../modules/rtp_rtcp",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010076 "../modules/rtp_rtcp:rtp_rtcp_format",
77 "../modules/utility",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010078 "../rtc_base:checks",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010079 "../rtc_base:rate_limiter",
henrika5f6bf242017-11-01 11:06:56 +010080 "../rtc_base:rtc_base",
ehmaldonadof6a861a2017-07-19 10:40:47 -070081 "../rtc_base:rtc_base_approved",
82 "../rtc_base:rtc_task_queue",
Karl Wiberg12edf4c2018-03-07 14:18:56 +010083 "../rtc_base:safe_minmax",
Tommifef05002018-02-27 13:51:08 +010084 "../rtc_base:stringutils",
Peter Boström5c389d32015-09-25 13:58:30 +020085 "../system_wrappers",
Alex Narestcedd3512017-12-07 20:54:55 +010086 "../system_wrappers:field_trial_api",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010087 "../system_wrappers:metrics_api",
Fredrik Solenberg2a877972017-12-15 16:42:15 +010088 "utility:audio_frame_operations",
Peter Boström5c389d32015-09-25 13:58:30 +020089 ]
90}
Peter Boström02083222016-06-14 12:52:54 +020091if (rtc_include_tests) {
Fredrik Solenberg73276ad2017-09-14 14:46:47 +020092 rtc_source_set("audio_end_to_end_test") {
93 testonly = true
94
95 sources = [
96 "test/audio_end_to_end_test.cc",
97 "test/audio_end_to_end_test.h",
98 ]
99 deps = [
100 ":audio",
101 "../system_wrappers:system_wrappers",
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200102 "../test:test_common",
103 "../test:test_support",
104 ]
105
106 if (!build_with_chromium && is_clang) {
107 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
108 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
109 }
110 }
111
ehmaldonado38a21322016-09-02 04:10:34 -0700112 rtc_source_set("audio_tests") {
Peter Boström02083222016-06-14 12:52:54 +0200113 testonly = true
kjellander676e08f2016-12-07 08:23:27 -0800114
Peter Boström02083222016-06-14 12:52:54 +0200115 sources = [
116 "audio_receive_stream_unittest.cc",
solenberg18f54272017-09-15 09:56:08 -0700117 "audio_send_stream_tests.cc",
Peter Boström02083222016-06-14 12:52:54 +0200118 "audio_send_stream_unittest.cc",
119 "audio_state_unittest.cc",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +0100120 "mock_voe_channel_proxy.h",
121 "remix_resample_unittest.cc",
sazac58f8c02017-07-19 00:39:19 -0700122 "time_interval_unittest.cc",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +0100123 "transport_feedback_packet_loss_tracker_unittest.cc",
Peter Boström02083222016-06-14 12:52:54 +0200124 ]
125 deps = [
126 ":audio",
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200127 ":audio_end_to_end_test",
aleloi04c07222016-11-22 06:42:53 -0800128 "../api:mock_audio_mixer",
Fredrik Solenberg2a877972017-12-15 16:42:15 +0100129 "../call:mock_call_interfaces",
Sebastian Janssonef9daee2018-02-22 14:49:02 +0100130 "../call:mock_rtp_interfaces",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100131 "../call:rtp_interfaces",
nisse0f15f922017-06-21 01:05:22 -0700132 "../call:rtp_receiver",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +0100133 "../common_audio",
Patrik Höglund731082c2018-01-03 09:08:20 +0100134 "../logging:mocks",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +0100135 "../modules:module_api",
aleloidd310712016-11-17 06:28:59 -0800136 "../modules/audio_device:mock_audio_device",
aleloi04c07222016-11-22 06:42:53 -0800137 "../modules/audio_mixer:audio_mixer_impl",
Ivo Creusen56d46092017-11-24 17:29:59 +0100138 "../modules/audio_processing:audio_processing_statistics",
Patrik Höglund62139292017-12-19 16:44:45 +0100139 "../modules/audio_processing:mocks",
Patrik Höglund94dc1772018-01-02 14:20:17 +0100140 "../modules/bitrate_controller:mocks",
kjellander676e08f2016-12-07 08:23:27 -0800141 "../modules/pacing:pacing",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100142 "../modules/rtp_rtcp:mock_rtp_rtcp",
143 "../modules/rtp_rtcp:rtp_rtcp_format",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +0100144 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700145 "../rtc_base:rtc_base_approved",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100146 "../rtc_base:rtc_base_tests_utils",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700147 "../rtc_base:rtc_task_queue",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100148 "../rtc_base:safe_compare",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100149 "../system_wrappers:system_wrappers",
150 "../test:audio_codec_mocks",
151 "../test:rtp_test_utils",
aleloi10111bc2016-11-17 06:48:48 -0800152 "../test:test_common",
aleloi6321b492016-12-05 01:46:09 -0800153 "../test:test_support",
ehmaldonado894c2bb2017-01-05 06:03:24 -0800154 "utility:utility_tests",
Peter Boström02083222016-06-14 12:52:54 +0200155 "//testing/gtest",
156 ]
oprypin5e1ca782017-03-20 02:06:18 -0700157
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200158 if (!rtc_use_memcheck) {
159 # This test is timing dependent, which rules out running on memcheck bots.
160 sources += [ "test/audio_stats_test.cc" ]
161 }
162
kjellandere40a7ee2016-10-16 23:56:12 -0700163 if (!build_with_chromium && is_clang) {
164 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700165 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Peter Boström02083222016-06-14 12:52:54 +0200166 }
167 }
kjellander8f8d1a02017-03-06 04:01:16 -0800168
169 if (rtc_enable_protobuf) {
oprypin6d305ba2017-03-30 04:01:30 -0700170 rtc_test("low_bandwidth_audio_test") {
kjellander8f8d1a02017-03-06 04:01:16 -0800171 testonly = true
172
173 sources = [
174 "test/low_bandwidth_audio_test.cc",
175 ]
176
oprypin92220ff2017-03-23 03:40:03 -0700177 deps = [
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200178 ":audio_end_to_end_test",
oprypin92220ff2017-03-23 03:40:03 -0700179 "../common_audio",
oprypin9b2f20c2017-08-29 05:51:57 -0700180 "../rtc_base:rtc_base_approved",
oprypin92220ff2017-03-23 03:40:03 -0700181 "../system_wrappers",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100182 "../test:fileutils",
oprypin92220ff2017-03-23 03:40:03 -0700183 "../test:test_common",
184 "../test:test_main",
tschumim9d117642017-07-17 01:41:41 -0700185 "//testing/gtest",
oprypin92220ff2017-03-23 03:40:03 -0700186 ]
kjellander8f8d1a02017-03-06 04:01:16 -0800187 if (is_android) {
oprypin92220ff2017-03-23 03:40:03 -0700188 deps += [ "//testing/android/native_test:native_test_native_code" ]
189 }
190
191 data = [
Oleh Prypin8cf0a872018-03-18 22:31:06 +0100192 "../resources/voice_engine/audio_tiny16.wav",
Oleh Prypin9c1ee362018-03-19 15:58:08 +0100193 "../resources/voice_engine/audio_tiny48.wav",
Oleh Prypin8cf0a872018-03-18 22:31:06 +0100194 ]
195
196 if (!build_with_chromium && is_clang) {
197 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163)
198 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
199 }
200 }
201
202 group("low_bandwidth_audio_perf_test") {
203 testonly = true
204
205 deps = [
206 ":low_bandwidth_audio_test",
207 ]
208
209 data = [
210 "test/low_bandwidth_audio_test.py",
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200211 "../resources/voice_engine/audio_tiny16.wav",
212 "../resources/voice_engine/audio_tiny48.wav",
oprypin92220ff2017-03-23 03:40:03 -0700213 ]
Oleh Prypin7b2676f2018-03-19 11:33:03 +0100214 if (is_win) {
215 data += [ "${root_out_dir}/low_bandwidth_audio_test.exe" ]
216 } else {
217 data += [ "${root_out_dir}/low_bandwidth_audio_test" ]
218 }
219
Edward Lemur98d40362018-01-15 17:37:04 +0100220 if (is_linux || is_android) {
Edward Lemur20110752017-09-28 16:14:37 +0200221 data += [
222 "../tools_webrtc/audio_quality/linux/PolqaOem64",
223 "../tools_webrtc/audio_quality/linux/pesq",
224 ]
225 }
226 if (is_win) {
227 data += [
228 "../tools_webrtc/audio_quality/win/PolqaOem64.dll",
229 "../tools_webrtc/audio_quality/win/PolqaOem64.exe",
230 "../tools_webrtc/audio_quality/win/pesq.exe",
231 "../tools_webrtc/audio_quality/win/vcomp120.dll",
232 ]
233 }
234 if (is_mac) {
235 data += [ "../tools_webrtc/audio_quality/mac/pesq" ]
236 }
Oleh Prypin650a8262018-03-15 13:52:41 +0000237
Oleh Prypin8cf0a872018-03-18 22:31:06 +0100238 write_runtime_deps = "${root_out_dir}/${target_name}.runtime_deps"
kjellander8f8d1a02017-03-06 04:01:16 -0800239 }
240 }
tschumim9d117642017-07-17 01:41:41 -0700241
242 rtc_source_set("audio_perf_tests") {
243 testonly = true
244
tschumim9d117642017-07-17 01:41:41 -0700245 sources = [
246 "test/audio_bwe_integration_test.cc",
247 "test/audio_bwe_integration_test.h",
248 ]
249 deps = [
tschumim9d117642017-07-17 01:41:41 -0700250 "../common_audio",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700251 "../rtc_base:rtc_base_approved",
tschumim9d117642017-07-17 01:41:41 -0700252 "../system_wrappers",
tschumim9d117642017-07-17 01:41:41 -0700253 "../test:field_trial",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100254 "../test:fileutils",
eladalon413ee9a2017-08-22 04:02:52 -0700255 "../test:single_threaded_task_queue",
tschumim9d117642017-07-17 01:41:41 -0700256 "../test:test_common",
257 "../test:test_main",
tschumim9d117642017-07-17 01:41:41 -0700258 "//testing/gtest",
tschumim9d117642017-07-17 01:41:41 -0700259 ]
260
261 data = [
262 "//resources/voice_engine/audio_dtx16.wav",
263 ]
264
265 if (!build_with_chromium && is_clang) {
266 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
267 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
268 }
269 }
Peter Boström02083222016-06-14 12:52:54 +0200270}