blob: 460f2ceeffdbe5fd3b188a25991f700feb86cc85 [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
Mirko Bonadei86d053c2019-10-17 21:32:04 +020015rtc_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",
Niels Möller530ead42018-10-04 14:28:39 +020027 "channel_receive.cc",
28 "channel_receive.h",
Marina Ciocea48623202020-04-01 10:19:44 +020029 "channel_receive_frame_transformer_delegate.cc",
30 "channel_receive_frame_transformer_delegate.h",
Niels Möller530ead42018-10-04 14:28:39 +020031 "channel_send.cc",
32 "channel_send.h",
Marina Ciocea65674d82020-03-31 22:41:30 +020033 "channel_send_frame_transformer_delegate.cc",
34 "channel_send_frame_transformer_delegate.h",
Fredrik Solenberg4f4ec0a2015-10-22 10:49:27 +020035 "conversion.h",
Sebastian Janssonfdbbada2020-01-30 18:13:54 +000036 "null_audio_poller.cc",
37 "null_audio_poller.h",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010038 "remix_resample.cc",
39 "remix_resample.h",
Peter Boström5c389d32015-09-25 13:58:30 +020040 ]
41
Peter Boström5c389d32015-09-25 13:58:30 +020042 deps = [
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010043 "../api:array_view",
kjellander676e08f2016-12-07 08:23:27 -080044 "../api:call_api",
Marina Ciocead2aa8f92020-03-31 11:29:56 +020045 "../api:frame_transformer_interface",
Artem Titov741daaf2019-03-21 14:37:36 +010046 "../api:function_view",
Niels Mölleref1052a2019-03-20 08:40:23 +010047 "../api:rtp_headers",
Niels Möller6dcd4dc2019-08-26 10:45:28 +020048 "../api:rtp_parameters",
Mirko Bonadeid9708072019-01-25 20:26:48 +010049 "../api:scoped_refptr",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010050 "../api:transport_api",
Gustaf Ullbergf35c6662018-02-23 13:18:29 +010051 "../api/audio:aec3_factory",
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +020052 "../api/audio:audio_frame_api",
Gustaf Ullberg2ae140a2018-02-16 13:43:49 +010053 "../api/audio:audio_mixer_api",
ossueb1fde42017-05-02 06:46:30 -070054 "../api/audio_codecs:audio_codecs_api",
Mirko Bonadeieaaaf412019-09-13 14:42:15 +020055 "../api/crypto:frame_decryptor_interface",
56 "../api/crypto:frame_encryptor_interface",
57 "../api/crypto:options",
Ivo Creusenc3d1f9b2019-11-01 11:47:51 +010058 "../api/neteq:neteq_api",
Danil Chapovalov83bbe912019-08-07 12:24:53 +020059 "../api/rtc_event_log",
Sebastian Jansson0b698262019-03-07 09:17:19 +010060 "../api/task_queue",
Niels Möllera8370302019-09-02 15:16:49 +020061 "../api/transport/rtp:rtp_source",
Tim Nab8c775a2020-01-10 10:33:05 -080062 "../call:audio_sender_interface",
Mirko Bonadei245660a2017-10-10 14:38:11 +020063 "../call:bitrate_allocator",
ossuf515ab82016-12-07 04:52:58 -080064 "../call:call_interfaces",
nissed76b7b22017-06-01 04:02:35 -070065 "../call:rtp_interfaces",
aleloi04c07222016-11-22 06:42:53 -080066 "../common_audio",
Mirko Bonadeidbbb33c2018-02-05 15:50:41 +010067 "../common_audio:common_audio_c",
Qingsi Wang970b0882018-02-01 11:04:46 -080068 "../logging:rtc_event_audio",
Oskar Sundbom56ef3052018-10-30 16:11:02 +010069 "../logging:rtc_stream_config",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010070 "../modules/audio_coding",
Niels Möllered44f542019-07-30 15:15:59 +020071 "../modules/audio_coding:audio_coding_module_typedefs",
Karl Wiberg23659362018-11-01 11:13:44 +010072 "../modules/audio_coding:audio_encoder_cng",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010073 "../modules/audio_coding:audio_network_adaptor_config",
aleloidd310712016-11-17 06:28:59 -080074 "../modules/audio_device",
75 "../modules/audio_processing",
Alessio Bazzicab768e882018-11-07 14:29:54 +000076 "../modules/audio_processing:api",
Per Åhgren71652f42020-03-17 13:23:58 +010077 "../modules/audio_processing:audio_frame_proxies",
Sam Zackrisson7eab0a82020-03-20 15:55:29 +010078 "../modules/audio_processing:rms_level",
Artem Titov94b57c02019-03-21 13:35:10 +010079 "../modules/pacing",
80 "../modules/remote_bitrate_estimator",
Mirko Bonadeib5728d92017-12-06 07:51:33 +010081 "../modules/rtp_rtcp",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010082 "../modules/rtp_rtcp:rtp_rtcp_format",
83 "../modules/utility",
Artem Titov94b57c02019-03-21 13:35:10 +010084 "../rtc_base",
Jonas Olssonabbe8412018-04-03 13:40:05 +020085 "../rtc_base:audio_format_to_string",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010086 "../rtc_base:checks",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010087 "../rtc_base:rate_limiter",
ehmaldonadof6a861a2017-07-19 10:40:47 -070088 "../rtc_base:rtc_base_approved",
89 "../rtc_base:rtc_task_queue",
Karl Wiberg12edf4c2018-03-07 14:18:56 +010090 "../rtc_base:safe_minmax",
Sebastian Janssonf23131f2019-10-03 10:03:55 +020091 "../rtc_base/experiments:field_trial_parser",
Marina Ciocead2aa8f92020-03-31 11:29:56 +020092 "../rtc_base/synchronization:sequence_checker",
Marina Ciocea48623202020-04-01 10:19:44 +020093 "../rtc_base/task_utils:to_queued_task",
Peter Boström5c389d32015-09-25 13:58:30 +020094 "../system_wrappers",
Mirko Bonadei17f48782018-09-28 08:51:10 +020095 "../system_wrappers:field_trial",
96 "../system_wrappers:metrics",
Fredrik Solenberg2a877972017-12-15 16:42:15 +010097 "utility:audio_frame_operations",
Mirko Bonadei2dcf3482020-06-05 14:30:41 +020098 ]
99 absl_deps = [
Karl Wiberg918f50c2018-07-05 11:40:33 +0200100 "//third_party/abseil-cpp/absl/memory",
Danil Chapovalovb9b146c2018-06-15 12:28:07 +0200101 "//third_party/abseil-cpp/absl/types:optional",
Peter Boström5c389d32015-09-25 13:58:30 +0200102 ]
103}
Peter Boström02083222016-06-14 12:52:54 +0200104if (rtc_include_tests) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200105 rtc_library("audio_end_to_end_test") {
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200106 testonly = true
107
108 sources = [
109 "test/audio_end_to_end_test.cc",
110 "test/audio_end_to_end_test.h",
111 ]
112 deps = [
113 ":audio",
Artem Titov46c4e602018-08-17 14:26:54 +0200114 "../api:simulated_network_api",
Danil Chapovalov44db4362019-09-30 04:16:28 +0200115 "../api/task_queue",
Artem Titov4e199e92018-08-20 13:30:39 +0200116 "../call:fake_network",
117 "../call:simulated_network",
Artem Titov94b57c02019-03-21 13:35:10 +0100118 "../system_wrappers",
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200119 "../test:test_common",
120 "../test:test_support",
121 ]
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200122 }
123
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200124 rtc_library("audio_tests") {
Peter Boström02083222016-06-14 12:52:54 +0200125 testonly = true
kjellander676e08f2016-12-07 08:23:27 -0800126
Peter Boström02083222016-06-14 12:52:54 +0200127 sources = [
128 "audio_receive_stream_unittest.cc",
solenberg18f54272017-09-15 09:56:08 -0700129 "audio_send_stream_tests.cc",
Peter Boström02083222016-06-14 12:52:54 +0200130 "audio_send_stream_unittest.cc",
131 "audio_state_unittest.cc",
Marina Ciocea701ccf92020-05-04 16:08:32 +0200132 "channel_receive_frame_transformer_delegate_unittest.cc",
Marina Ciocead7197082020-05-04 17:50:38 +0200133 "channel_send_frame_transformer_delegate_unittest.cc",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +0100134 "mock_voe_channel_proxy.h",
135 "remix_resample_unittest.cc",
Mirko Bonadei264bee82018-08-07 08:53:41 +0200136 "test/audio_stats_test.cc",
Peter Boström02083222016-06-14 12:52:54 +0200137 ]
138 deps = [
139 ":audio",
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200140 ":audio_end_to_end_test",
Anton Sukhanov4f08faa2019-05-21 11:12:57 -0700141 "../api:libjingle_peerconnection_api",
aleloi04c07222016-11-22 06:42:53 -0800142 "../api:mock_audio_mixer",
Benjamin Wright78410ad2018-10-25 09:52:57 -0700143 "../api:mock_frame_decryptor",
144 "../api:mock_frame_encryptor",
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +0200145 "../api/audio:audio_frame_api",
Niels Möller7d76a312018-10-26 12:57:07 +0200146 "../api/audio_codecs:audio_codecs_api",
147 "../api/audio_codecs/opus:audio_decoder_opus",
148 "../api/audio_codecs/opus:audio_encoder_opus",
Danil Chapovalov83bbe912019-08-07 12:24:53 +0200149 "../api/rtc_event_log",
Danil Chapovalov31660fd2019-03-22 12:59:48 +0100150 "../api/task_queue:default_task_queue_factory",
Sebastian Jansson5f83cf02018-05-08 14:52:22 +0200151 "../api/units:time_delta",
Niels Möller7d76a312018-10-26 12:57:07 +0200152 "../call:mock_bitrate_allocator",
Fredrik Solenberg2a877972017-12-15 16:42:15 +0100153 "../call:mock_call_interfaces",
Sebastian Janssonef9daee2018-02-22 14:49:02 +0100154 "../call:mock_rtp_interfaces",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100155 "../call:rtp_interfaces",
nisse0f15f922017-06-21 01:05:22 -0700156 "../call:rtp_receiver",
Sebastian Jansson0b698262019-03-07 09:17:19 +0100157 "../call:rtp_sender",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +0100158 "../common_audio",
Patrik Höglund731082c2018-01-03 09:08:20 +0100159 "../logging:mocks",
Danil Chapovalov31660fd2019-03-22 12:59:48 +0100160 "../modules/audio_device:audio_device_impl", # For TestAudioDeviceModule
aleloidd310712016-11-17 06:28:59 -0800161 "../modules/audio_device:mock_audio_device",
aleloi04c07222016-11-22 06:42:53 -0800162 "../modules/audio_mixer:audio_mixer_impl",
Henrik Boströmd2c336f2019-07-03 17:11:10 +0200163 "../modules/audio_mixer:audio_mixer_test_utils",
Ivo Creusen56d46092017-11-24 17:29:59 +0100164 "../modules/audio_processing:audio_processing_statistics",
Patrik Höglund62139292017-12-19 16:44:45 +0100165 "../modules/audio_processing:mocks",
Artem Titov94b57c02019-03-21 13:35:10 +0100166 "../modules/pacing",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100167 "../modules/rtp_rtcp:mock_rtp_rtcp",
168 "../modules/rtp_rtcp:rtp_rtcp_format",
Niels Möller7d76a312018-10-26 12:57:07 +0200169 "../modules/utility",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +0100170 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700171 "../rtc_base:rtc_base_approved",
Danil Chapovalov31660fd2019-03-22 12:59:48 +0100172 "../rtc_base:rtc_base_tests_utils",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100173 "../rtc_base:safe_compare",
Danil Chapovalov31660fd2019-03-22 12:59:48 +0100174 "../rtc_base:task_queue_for_test",
Bjorn Terelius5c2f1f02019-01-16 17:45:05 +0100175 "../rtc_base:timeutils",
Artem Titov94b57c02019-03-21 13:35:10 +0100176 "../system_wrappers",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100177 "../test:audio_codec_mocks",
Danil Chapovalov31660fd2019-03-22 12:59:48 +0100178 "../test:field_trial",
Marina Ciocea701ccf92020-05-04 16:08:32 +0200179 "../test:mock_frame_transformer",
180 "../test:mock_transformable_frame",
Tim Na9526c552020-02-20 11:53:13 -0800181 "../test:mock_transport",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100182 "../test:rtp_test_utils",
aleloi10111bc2016-11-17 06:48:48 -0800183 "../test:test_common",
aleloi6321b492016-12-05 01:46:09 -0800184 "../test:test_support",
ehmaldonado894c2bb2017-01-05 06:03:24 -0800185 "utility:utility_tests",
Peter Boström02083222016-06-14 12:52:54 +0200186 "//testing/gtest",
187 ]
Peter Boström02083222016-06-14 12:52:54 +0200188 }
kjellander8f8d1a02017-03-06 04:01:16 -0800189
190 if (rtc_enable_protobuf) {
oprypin6d305ba2017-03-30 04:01:30 -0700191 rtc_test("low_bandwidth_audio_test") {
kjellander8f8d1a02017-03-06 04:01:16 -0800192 testonly = true
193
194 sources = [
195 "test/low_bandwidth_audio_test.cc",
Artem Titovb1f2d602019-07-10 14:40:58 +0200196 "test/low_bandwidth_audio_test_flags.cc",
Artem Titovc8263e02019-07-05 12:34:36 +0200197 "test/pc_low_bandwidth_audio_test.cc",
kjellander8f8d1a02017-03-06 04:01:16 -0800198 ]
199
oprypin92220ff2017-03-23 03:40:03 -0700200 deps = [
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200201 ":audio_end_to_end_test",
Artem Titovc8263e02019-07-05 12:34:36 +0200202 "../api:create_network_emulation_manager",
203 "../api:create_peerconnection_quality_test_fixture",
204 "../api:network_emulation_manager_api",
205 "../api:peer_connection_quality_test_fixture_api",
Artem Titov46c4e602018-08-17 14:26:54 +0200206 "../api:simulated_network_api",
Artem Titovc8263e02019-07-05 12:34:36 +0200207 "../call:simulated_network",
oprypin92220ff2017-03-23 03:40:03 -0700208 "../common_audio",
209 "../system_wrappers",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100210 "../test:fileutils",
Artem Titovb1f2d602019-07-10 14:40:58 +0200211 "../test:perf_test",
oprypin92220ff2017-03-23 03:40:03 -0700212 "../test:test_common",
213 "../test:test_main",
Artem Titovc8263e02019-07-05 12:34:36 +0200214 "../test:test_support",
215 "../test/pc/e2e:network_quality_metrics_reporter",
tschumim9d117642017-07-17 01:41:41 -0700216 "//testing/gtest",
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200217 "//third_party/abseil-cpp/absl/flags:flag",
oprypin92220ff2017-03-23 03:40:03 -0700218 ]
kjellander8f8d1a02017-03-06 04:01:16 -0800219 if (is_android) {
oprypin92220ff2017-03-23 03:40:03 -0700220 deps += [ "//testing/android/native_test:native_test_native_code" ]
221 }
oprypin92220ff2017-03-23 03:40:03 -0700222 data = [
Oleh Prypin8cf0a872018-03-18 22:31:06 +0100223 "../resources/voice_engine/audio_tiny16.wav",
Oleh Prypin9c1ee362018-03-19 15:58:08 +0100224 "../resources/voice_engine/audio_tiny48.wav",
Oleh Prypin8cf0a872018-03-18 22:31:06 +0100225 ]
Oleh Prypin8cf0a872018-03-18 22:31:06 +0100226 }
227
228 group("low_bandwidth_audio_perf_test") {
229 testonly = true
230
Patrik Höglunde4ae1ce2020-03-27 09:11:30 +0100231 deps = [
232 ":low_bandwidth_audio_test",
233 "//third_party/catapult/tracing/tracing/proto:histogram_proto",
234 "//third_party/protobuf:py_proto_runtime",
235 ]
Oleh Prypin8cf0a872018-03-18 22:31:06 +0100236
237 data = [
238 "test/low_bandwidth_audio_test.py",
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200239 "../resources/voice_engine/audio_tiny16.wav",
240 "../resources/voice_engine/audio_tiny48.wav",
Patrik Höglunde4ae1ce2020-03-27 09:11:30 +0100241 "${root_out_dir}/pyproto/tracing/tracing/proto/histogram_pb2.py",
oprypin92220ff2017-03-23 03:40:03 -0700242 ]
Patrik Höglund3b4bbf52020-03-26 08:41:09 +0100243
244 # TODO(http://crbug.com/1029452): Create a cleaner target with just the
245 # tracing python code. We don't need Polymer for instance.
246 data_deps = [ "//third_party/catapult/tracing:convert_chart_json" ]
247
Oleh Prypin7b2676f2018-03-19 11:33:03 +0100248 if (is_win) {
249 data += [ "${root_out_dir}/low_bandwidth_audio_test.exe" ]
250 } else {
251 data += [ "${root_out_dir}/low_bandwidth_audio_test" ]
252 }
253
Edward Lemur98d40362018-01-15 17:37:04 +0100254 if (is_linux || is_android) {
Edward Lemur20110752017-09-28 16:14:37 +0200255 data += [
256 "../tools_webrtc/audio_quality/linux/PolqaOem64",
257 "../tools_webrtc/audio_quality/linux/pesq",
258 ]
259 }
260 if (is_win) {
261 data += [
262 "../tools_webrtc/audio_quality/win/PolqaOem64.dll",
263 "../tools_webrtc/audio_quality/win/PolqaOem64.exe",
264 "../tools_webrtc/audio_quality/win/pesq.exe",
265 "../tools_webrtc/audio_quality/win/vcomp120.dll",
266 ]
267 }
268 if (is_mac) {
269 data += [ "../tools_webrtc/audio_quality/mac/pesq" ]
270 }
Oleh Prypin650a8262018-03-15 13:52:41 +0000271
Oleh Prypin8cf0a872018-03-18 22:31:06 +0100272 write_runtime_deps = "${root_out_dir}/${target_name}.runtime_deps"
kjellander8f8d1a02017-03-06 04:01:16 -0800273 }
274 }
tschumim9d117642017-07-17 01:41:41 -0700275
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200276 rtc_library("audio_perf_tests") {
tschumim9d117642017-07-17 01:41:41 -0700277 testonly = true
278
tschumim9d117642017-07-17 01:41:41 -0700279 sources = [
280 "test/audio_bwe_integration_test.cc",
281 "test/audio_bwe_integration_test.h",
282 ]
283 deps = [
Artem Titov46c4e602018-08-17 14:26:54 +0200284 "../api:simulated_network_api",
Danil Chapovalovad895282019-03-11 10:28:05 +0000285 "../api/task_queue",
Artem Titov4e199e92018-08-20 13:30:39 +0200286 "../call:fake_network",
287 "../call:simulated_network",
tschumim9d117642017-07-17 01:41:41 -0700288 "../common_audio",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700289 "../rtc_base:rtc_base_approved",
Danil Chapovalov31660fd2019-03-22 12:59:48 +0100290 "../rtc_base:task_queue_for_test",
tschumim9d117642017-07-17 01:41:41 -0700291 "../system_wrappers",
tschumim9d117642017-07-17 01:41:41 -0700292 "../test:field_trial",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100293 "../test:fileutils",
tschumim9d117642017-07-17 01:41:41 -0700294 "../test:test_common",
295 "../test:test_main",
Yves Gerey21cddff2018-10-30 21:12:42 +0100296 "../test:test_support",
tschumim9d117642017-07-17 01:41:41 -0700297 "//testing/gtest",
tschumim9d117642017-07-17 01:41:41 -0700298 ]
299
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100300 data = [ "//resources/voice_engine/audio_dtx16.wav" ]
tschumim9d117642017-07-17 01:41:41 -0700301 }
Peter Boström02083222016-06-14 12:52:54 +0200302}