blob: ae4c67e6ec8b10fbcec1e02b23d7003cdb0e4549 [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",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010052 "../api:transport_api",
Gustaf Ullbergf35c6662018-02-23 13:18:29 +010053 "../api/audio:aec3_factory",
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +020054 "../api/audio:audio_frame_api",
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",
Mirko Bonadei245660a2017-10-10 14:38:11 +020057 "../call:bitrate_allocator",
ossuf515ab82016-12-07 04:52:58 -080058 "../call:call_interfaces",
nissed76b7b22017-06-01 04:02:35 -070059 "../call:rtp_interfaces",
aleloi04c07222016-11-22 06:42:53 -080060 "../common_audio",
Mirko Bonadeidbbb33c2018-02-05 15:50:41 +010061 "../common_audio:common_audio_c",
Qingsi Wang970b0882018-02-01 11:04:46 -080062 "../logging:rtc_event_audio",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010063 "../logging:rtc_event_log_api",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010064 "../modules/audio_coding",
65 "../modules/audio_coding:audio_format_conversion",
66 "../modules/audio_coding:audio_network_adaptor_config",
ossu20a4b3f2017-04-27 02:08:52 -070067 "../modules/audio_coding:cng",
aleloidd310712016-11-17 06:28:59 -080068 "../modules/audio_device",
69 "../modules/audio_processing",
stefan7de8d642017-02-07 07:14:08 -080070 "../modules/bitrate_controller:bitrate_controller",
kjellander676e08f2016-12-07 08:23:27 -080071 "../modules/pacing:pacing",
72 "../modules/remote_bitrate_estimator:remote_bitrate_estimator",
Mirko Bonadeib5728d92017-12-06 07:51:33 +010073 "../modules/rtp_rtcp",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010074 "../modules/rtp_rtcp:rtp_rtcp_format",
75 "../modules/utility",
Jonas Olssonabbe8412018-04-03 13:40:05 +020076 "../rtc_base:audio_format_to_string",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010077 "../rtc_base:checks",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010078 "../rtc_base:rate_limiter",
henrika5f6bf242017-11-01 11:06:56 +010079 "../rtc_base:rtc_base",
ehmaldonadof6a861a2017-07-19 10:40:47 -070080 "../rtc_base:rtc_base_approved",
81 "../rtc_base:rtc_task_queue",
Karl Wiberg12edf4c2018-03-07 14:18:56 +010082 "../rtc_base:safe_minmax",
Tommifef05002018-02-27 13:51:08 +010083 "../rtc_base:stringutils",
Peter Boström5c389d32015-09-25 13:58:30 +020084 "../system_wrappers",
Alex Narestcedd3512017-12-07 20:54:55 +010085 "../system_wrappers:field_trial_api",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010086 "../system_wrappers:metrics_api",
Fredrik Solenberg2a877972017-12-15 16:42:15 +010087 "utility:audio_frame_operations",
Karl Wiberg918f50c2018-07-05 11:40:33 +020088 "//third_party/abseil-cpp/absl/memory",
Danil Chapovalovb9b146c2018-06-15 12:28:07 +020089 "//third_party/abseil-cpp/absl/types:optional",
Peter Boström5c389d32015-09-25 13:58:30 +020090 ]
91}
Peter Boström02083222016-06-14 12:52:54 +020092if (rtc_include_tests) {
Fredrik Solenberg73276ad2017-09-14 14:46:47 +020093 rtc_source_set("audio_end_to_end_test") {
94 testonly = true
95
96 sources = [
97 "test/audio_end_to_end_test.cc",
98 "test/audio_end_to_end_test.h",
99 ]
100 deps = [
101 ":audio",
Artem Titov46c4e602018-08-17 14:26:54 +0200102 "../api:simulated_network_api",
Artem Titov4e199e92018-08-20 13:30:39 +0200103 "../call:fake_network",
104 "../call:simulated_network",
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200105 "../system_wrappers:system_wrappers",
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200106 "../test:test_common",
107 "../test:test_support",
108 ]
109
110 if (!build_with_chromium && is_clang) {
111 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
112 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
113 }
114 }
115
ehmaldonado38a21322016-09-02 04:10:34 -0700116 rtc_source_set("audio_tests") {
Peter Boström02083222016-06-14 12:52:54 +0200117 testonly = true
kjellander676e08f2016-12-07 08:23:27 -0800118
Peter Boström02083222016-06-14 12:52:54 +0200119 sources = [
120 "audio_receive_stream_unittest.cc",
solenberg18f54272017-09-15 09:56:08 -0700121 "audio_send_stream_tests.cc",
Peter Boström02083222016-06-14 12:52:54 +0200122 "audio_send_stream_unittest.cc",
123 "audio_state_unittest.cc",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +0100124 "mock_voe_channel_proxy.h",
125 "remix_resample_unittest.cc",
Mirko Bonadei264bee82018-08-07 08:53:41 +0200126 "test/audio_stats_test.cc",
sazac58f8c02017-07-19 00:39:19 -0700127 "time_interval_unittest.cc",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +0100128 "transport_feedback_packet_loss_tracker_unittest.cc",
Peter Boström02083222016-06-14 12:52:54 +0200129 ]
130 deps = [
131 ":audio",
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200132 ":audio_end_to_end_test",
aleloi04c07222016-11-22 06:42:53 -0800133 "../api:mock_audio_mixer",
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +0200134 "../api/audio:audio_frame_api",
Sebastian Jansson5f83cf02018-05-08 14:52:22 +0200135 "../api/units:time_delta",
Fredrik Solenberg2a877972017-12-15 16:42:15 +0100136 "../call:mock_call_interfaces",
Sebastian Janssonef9daee2018-02-22 14:49:02 +0100137 "../call:mock_rtp_interfaces",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100138 "../call:rtp_interfaces",
nisse0f15f922017-06-21 01:05:22 -0700139 "../call:rtp_receiver",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +0100140 "../common_audio",
Patrik Höglund731082c2018-01-03 09:08:20 +0100141 "../logging:mocks",
aleloidd310712016-11-17 06:28:59 -0800142 "../modules/audio_device:mock_audio_device",
aleloi04c07222016-11-22 06:42:53 -0800143 "../modules/audio_mixer:audio_mixer_impl",
Ivo Creusen56d46092017-11-24 17:29:59 +0100144 "../modules/audio_processing:audio_processing_statistics",
Patrik Höglund62139292017-12-19 16:44:45 +0100145 "../modules/audio_processing:mocks",
Patrik Höglund94dc1772018-01-02 14:20:17 +0100146 "../modules/bitrate_controller:mocks",
kjellander676e08f2016-12-07 08:23:27 -0800147 "../modules/pacing:pacing",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100148 "../modules/rtp_rtcp:mock_rtp_rtcp",
149 "../modules/rtp_rtcp:rtp_rtcp_format",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +0100150 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700151 "../rtc_base:rtc_base_approved",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100152 "../rtc_base:rtc_base_tests_utils",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700153 "../rtc_base:rtc_task_queue",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100154 "../rtc_base:safe_compare",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100155 "../system_wrappers:system_wrappers",
156 "../test:audio_codec_mocks",
157 "../test:rtp_test_utils",
aleloi10111bc2016-11-17 06:48:48 -0800158 "../test:test_common",
aleloi6321b492016-12-05 01:46:09 -0800159 "../test:test_support",
ehmaldonado894c2bb2017-01-05 06:03:24 -0800160 "utility:utility_tests",
Peter Boström02083222016-06-14 12:52:54 +0200161 "//testing/gtest",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200162 "//third_party/abseil-cpp/absl/memory",
Peter Boström02083222016-06-14 12:52:54 +0200163 ]
oprypin5e1ca782017-03-20 02:06:18 -0700164
kjellandere40a7ee2016-10-16 23:56:12 -0700165 if (!build_with_chromium && is_clang) {
166 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700167 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Peter Boström02083222016-06-14 12:52:54 +0200168 }
169 }
kjellander8f8d1a02017-03-06 04:01:16 -0800170
171 if (rtc_enable_protobuf) {
oprypin6d305ba2017-03-30 04:01:30 -0700172 rtc_test("low_bandwidth_audio_test") {
kjellander8f8d1a02017-03-06 04:01:16 -0800173 testonly = true
174
175 sources = [
176 "test/low_bandwidth_audio_test.cc",
177 ]
178
oprypin92220ff2017-03-23 03:40:03 -0700179 deps = [
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200180 ":audio_end_to_end_test",
Artem Titov46c4e602018-08-17 14:26:54 +0200181 "../api:simulated_network_api",
oprypin92220ff2017-03-23 03:40:03 -0700182 "../common_audio",
oprypin9b2f20c2017-08-29 05:51:57 -0700183 "../rtc_base:rtc_base_approved",
oprypin92220ff2017-03-23 03:40:03 -0700184 "../system_wrappers",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100185 "../test:fileutils",
oprypin92220ff2017-03-23 03:40:03 -0700186 "../test:test_common",
187 "../test:test_main",
tschumim9d117642017-07-17 01:41:41 -0700188 "//testing/gtest",
oprypin92220ff2017-03-23 03:40:03 -0700189 ]
kjellander8f8d1a02017-03-06 04:01:16 -0800190 if (is_android) {
oprypin92220ff2017-03-23 03:40:03 -0700191 deps += [ "//testing/android/native_test:native_test_native_code" ]
192 }
193
194 data = [
Oleh Prypin8cf0a872018-03-18 22:31:06 +0100195 "../resources/voice_engine/audio_tiny16.wav",
Oleh Prypin9c1ee362018-03-19 15:58:08 +0100196 "../resources/voice_engine/audio_tiny48.wav",
Oleh Prypin8cf0a872018-03-18 22:31:06 +0100197 ]
198
199 if (!build_with_chromium && is_clang) {
200 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163)
201 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
202 }
203 }
204
205 group("low_bandwidth_audio_perf_test") {
206 testonly = true
207
208 deps = [
209 ":low_bandwidth_audio_test",
210 ]
211
212 data = [
213 "test/low_bandwidth_audio_test.py",
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200214 "../resources/voice_engine/audio_tiny16.wav",
215 "../resources/voice_engine/audio_tiny48.wav",
oprypin92220ff2017-03-23 03:40:03 -0700216 ]
Oleh Prypin7b2676f2018-03-19 11:33:03 +0100217 if (is_win) {
218 data += [ "${root_out_dir}/low_bandwidth_audio_test.exe" ]
219 } else {
220 data += [ "${root_out_dir}/low_bandwidth_audio_test" ]
221 }
222
Edward Lemur98d40362018-01-15 17:37:04 +0100223 if (is_linux || is_android) {
Edward Lemur20110752017-09-28 16:14:37 +0200224 data += [
225 "../tools_webrtc/audio_quality/linux/PolqaOem64",
226 "../tools_webrtc/audio_quality/linux/pesq",
227 ]
228 }
229 if (is_win) {
230 data += [
231 "../tools_webrtc/audio_quality/win/PolqaOem64.dll",
232 "../tools_webrtc/audio_quality/win/PolqaOem64.exe",
233 "../tools_webrtc/audio_quality/win/pesq.exe",
234 "../tools_webrtc/audio_quality/win/vcomp120.dll",
235 ]
236 }
237 if (is_mac) {
238 data += [ "../tools_webrtc/audio_quality/mac/pesq" ]
239 }
Oleh Prypin650a8262018-03-15 13:52:41 +0000240
Oleh Prypin8cf0a872018-03-18 22:31:06 +0100241 write_runtime_deps = "${root_out_dir}/${target_name}.runtime_deps"
kjellander8f8d1a02017-03-06 04:01:16 -0800242 }
243 }
tschumim9d117642017-07-17 01:41:41 -0700244
245 rtc_source_set("audio_perf_tests") {
246 testonly = true
247
tschumim9d117642017-07-17 01:41:41 -0700248 sources = [
249 "test/audio_bwe_integration_test.cc",
250 "test/audio_bwe_integration_test.h",
251 ]
252 deps = [
Artem Titov46c4e602018-08-17 14:26:54 +0200253 "../api:simulated_network_api",
Artem Titov4e199e92018-08-20 13:30:39 +0200254 "../call:fake_network",
255 "../call:simulated_network",
tschumim9d117642017-07-17 01:41:41 -0700256 "../common_audio",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700257 "../rtc_base:rtc_base_approved",
tschumim9d117642017-07-17 01:41:41 -0700258 "../system_wrappers",
tschumim9d117642017-07-17 01:41:41 -0700259 "../test:field_trial",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100260 "../test:fileutils",
eladalon413ee9a2017-08-22 04:02:52 -0700261 "../test:single_threaded_task_queue",
tschumim9d117642017-07-17 01:41:41 -0700262 "../test:test_common",
263 "../test:test_main",
tschumim9d117642017-07-17 01:41:41 -0700264 "//testing/gtest",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200265 "//third_party/abseil-cpp/absl/memory",
tschumim9d117642017-07-17 01:41:41 -0700266 ]
267
268 data = [
269 "//resources/voice_engine/audio_dtx16.wav",
270 ]
271
272 if (!build_with_chromium && is_clang) {
273 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
274 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
275 }
276 }
Peter Boström02083222016-06-14 12:52:54 +0200277}