blob: d7d7a12986048a702c083da7445f0f2a6005cb7f [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",
Niels Möller530ead42018-10-04 14:28:39 +020029 "channel_send.cc",
30 "channel_send.h",
Fredrik Solenberg4f4ec0a2015-10-22 10:49:27 +020031 "conversion.h",
Sebastian Janssonfdbbada2020-01-30 18:13:54 +000032 "null_audio_poller.cc",
33 "null_audio_poller.h",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010034 "remix_resample.cc",
35 "remix_resample.h",
Peter Boström5c389d32015-09-25 13:58:30 +020036 ]
37
Peter Boström5c389d32015-09-25 13:58:30 +020038 deps = [
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010039 "../api:array_view",
kjellander676e08f2016-12-07 08:23:27 -080040 "../api:call_api",
Artem Titov741daaf2019-03-21 14:37:36 +010041 "../api:function_view",
Niels Mölleref1052a2019-03-20 08:40:23 +010042 "../api:rtp_headers",
Niels Möller6dcd4dc2019-08-26 10:45:28 +020043 "../api:rtp_parameters",
Mirko Bonadeid9708072019-01-25 20:26:48 +010044 "../api:scoped_refptr",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010045 "../api:transport_api",
Gustaf Ullbergf35c6662018-02-23 13:18:29 +010046 "../api/audio:aec3_factory",
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +020047 "../api/audio:audio_frame_api",
Gustaf Ullberg2ae140a2018-02-16 13:43:49 +010048 "../api/audio:audio_mixer_api",
ossueb1fde42017-05-02 06:46:30 -070049 "../api/audio_codecs:audio_codecs_api",
Mirko Bonadeieaaaf412019-09-13 14:42:15 +020050 "../api/crypto:frame_decryptor_interface",
51 "../api/crypto:frame_encryptor_interface",
52 "../api/crypto:options",
Ivo Creusenc3d1f9b2019-11-01 11:47:51 +010053 "../api/neteq:neteq_api",
Danil Chapovalov83bbe912019-08-07 12:24:53 +020054 "../api/rtc_event_log",
Sebastian Jansson0b698262019-03-07 09:17:19 +010055 "../api/task_queue",
Niels Möllera8370302019-09-02 15:16:49 +020056 "../api/transport/rtp:rtp_source",
Tim Nab8c775a2020-01-10 10:33:05 -080057 "../call:audio_sender_interface",
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",
Oskar Sundbom56ef3052018-10-30 16:11:02 +010064 "../logging:rtc_stream_config",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010065 "../modules/audio_coding",
Niels Möllered44f542019-07-30 15:15:59 +020066 "../modules/audio_coding:audio_coding_module_typedefs",
Karl Wiberg23659362018-11-01 11:13:44 +010067 "../modules/audio_coding:audio_encoder_cng",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010068 "../modules/audio_coding:audio_network_adaptor_config",
aleloidd310712016-11-17 06:28:59 -080069 "../modules/audio_device",
70 "../modules/audio_processing",
Alessio Bazzicab768e882018-11-07 14:29:54 +000071 "../modules/audio_processing:api",
Artem Titov94b57c02019-03-21 13:35:10 +010072 "../modules/pacing",
73 "../modules/remote_bitrate_estimator",
Mirko Bonadeib5728d92017-12-06 07:51:33 +010074 "../modules/rtp_rtcp",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010075 "../modules/rtp_rtcp:rtp_rtcp_format",
76 "../modules/utility",
Artem Titov94b57c02019-03-21 13:35:10 +010077 "../rtc_base",
Jonas Olssonabbe8412018-04-03 13:40:05 +020078 "../rtc_base:audio_format_to_string",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010079 "../rtc_base:checks",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010080 "../rtc_base:rate_limiter",
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",
Sebastian Janssonf23131f2019-10-03 10:03:55 +020084 "../rtc_base/experiments:field_trial_parser",
Peter Boström5c389d32015-09-25 13:58:30 +020085 "../system_wrappers",
Mirko Bonadei17f48782018-09-28 08:51:10 +020086 "../system_wrappers:field_trial",
87 "../system_wrappers:metrics",
Fredrik Solenberg2a877972017-12-15 16:42:15 +010088 "utility:audio_frame_operations",
Karl Wiberg918f50c2018-07-05 11:40:33 +020089 "//third_party/abseil-cpp/absl/memory",
Danil Chapovalovb9b146c2018-06-15 12:28:07 +020090 "//third_party/abseil-cpp/absl/types:optional",
Peter Boström5c389d32015-09-25 13:58:30 +020091 ]
92}
Peter Boström02083222016-06-14 12:52:54 +020093if (rtc_include_tests) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +020094 rtc_library("audio_end_to_end_test") {
Fredrik Solenberg73276ad2017-09-14 14:46:47 +020095 testonly = true
96
97 sources = [
98 "test/audio_end_to_end_test.cc",
99 "test/audio_end_to_end_test.h",
100 ]
101 deps = [
102 ":audio",
Artem Titov46c4e602018-08-17 14:26:54 +0200103 "../api:simulated_network_api",
Danil Chapovalov44db4362019-09-30 04:16:28 +0200104 "../api/task_queue",
Artem Titov4e199e92018-08-20 13:30:39 +0200105 "../call:fake_network",
106 "../call:simulated_network",
Artem Titov94b57c02019-03-21 13:35:10 +0100107 "../system_wrappers",
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200108 "../test:test_common",
109 "../test:test_support",
110 ]
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200111 }
112
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200113 rtc_library("audio_tests") {
Peter Boström02083222016-06-14 12:52:54 +0200114 testonly = true
kjellander676e08f2016-12-07 08:23:27 -0800115
Peter Boström02083222016-06-14 12:52:54 +0200116 sources = [
117 "audio_receive_stream_unittest.cc",
solenberg18f54272017-09-15 09:56:08 -0700118 "audio_send_stream_tests.cc",
Peter Boström02083222016-06-14 12:52:54 +0200119 "audio_send_stream_unittest.cc",
120 "audio_state_unittest.cc",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +0100121 "mock_voe_channel_proxy.h",
122 "remix_resample_unittest.cc",
Mirko Bonadei264bee82018-08-07 08:53:41 +0200123 "test/audio_stats_test.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",
Anton Sukhanov4f08faa2019-05-21 11:12:57 -0700128 "../api:libjingle_peerconnection_api",
aleloi04c07222016-11-22 06:42:53 -0800129 "../api:mock_audio_mixer",
Benjamin Wright78410ad2018-10-25 09:52:57 -0700130 "../api:mock_frame_decryptor",
131 "../api:mock_frame_encryptor",
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +0200132 "../api/audio:audio_frame_api",
Niels Möller7d76a312018-10-26 12:57:07 +0200133 "../api/audio_codecs:audio_codecs_api",
134 "../api/audio_codecs/opus:audio_decoder_opus",
135 "../api/audio_codecs/opus:audio_encoder_opus",
Danil Chapovalov83bbe912019-08-07 12:24:53 +0200136 "../api/rtc_event_log",
Danil Chapovalov31660fd2019-03-22 12:59:48 +0100137 "../api/task_queue:default_task_queue_factory",
Sebastian Jansson5f83cf02018-05-08 14:52:22 +0200138 "../api/units:time_delta",
Niels Möller7d76a312018-10-26 12:57:07 +0200139 "../call:mock_bitrate_allocator",
Fredrik Solenberg2a877972017-12-15 16:42:15 +0100140 "../call:mock_call_interfaces",
Sebastian Janssonef9daee2018-02-22 14:49:02 +0100141 "../call:mock_rtp_interfaces",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100142 "../call:rtp_interfaces",
nisse0f15f922017-06-21 01:05:22 -0700143 "../call:rtp_receiver",
Sebastian Jansson0b698262019-03-07 09:17:19 +0100144 "../call:rtp_sender",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +0100145 "../common_audio",
Patrik Höglund731082c2018-01-03 09:08:20 +0100146 "../logging:mocks",
Danil Chapovalov31660fd2019-03-22 12:59:48 +0100147 "../modules/audio_device:audio_device_impl", # For TestAudioDeviceModule
aleloidd310712016-11-17 06:28:59 -0800148 "../modules/audio_device:mock_audio_device",
aleloi04c07222016-11-22 06:42:53 -0800149 "../modules/audio_mixer:audio_mixer_impl",
Henrik Boströmd2c336f2019-07-03 17:11:10 +0200150 "../modules/audio_mixer:audio_mixer_test_utils",
Ivo Creusen56d46092017-11-24 17:29:59 +0100151 "../modules/audio_processing:audio_processing_statistics",
Patrik Höglund62139292017-12-19 16:44:45 +0100152 "../modules/audio_processing:mocks",
Artem Titov94b57c02019-03-21 13:35:10 +0100153 "../modules/pacing",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100154 "../modules/rtp_rtcp:mock_rtp_rtcp",
155 "../modules/rtp_rtcp:rtp_rtcp_format",
Niels Möller7d76a312018-10-26 12:57:07 +0200156 "../modules/utility",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +0100157 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700158 "../rtc_base:rtc_base_approved",
Danil Chapovalov31660fd2019-03-22 12:59:48 +0100159 "../rtc_base:rtc_base_tests_utils",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100160 "../rtc_base:safe_compare",
Danil Chapovalov31660fd2019-03-22 12:59:48 +0100161 "../rtc_base:task_queue_for_test",
Bjorn Terelius5c2f1f02019-01-16 17:45:05 +0100162 "../rtc_base:timeutils",
Artem Titov94b57c02019-03-21 13:35:10 +0100163 "../system_wrappers",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100164 "../test:audio_codec_mocks",
Danil Chapovalov31660fd2019-03-22 12:59:48 +0100165 "../test:field_trial",
Tim Na9526c552020-02-20 11:53:13 -0800166 "../test:mock_transport",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100167 "../test:rtp_test_utils",
aleloi10111bc2016-11-17 06:48:48 -0800168 "../test:test_common",
aleloi6321b492016-12-05 01:46:09 -0800169 "../test:test_support",
ehmaldonado894c2bb2017-01-05 06:03:24 -0800170 "utility:utility_tests",
Peter Boström02083222016-06-14 12:52:54 +0200171 "//testing/gtest",
172 ]
Peter Boström02083222016-06-14 12:52:54 +0200173 }
kjellander8f8d1a02017-03-06 04:01:16 -0800174
175 if (rtc_enable_protobuf) {
oprypin6d305ba2017-03-30 04:01:30 -0700176 rtc_test("low_bandwidth_audio_test") {
kjellander8f8d1a02017-03-06 04:01:16 -0800177 testonly = true
178
179 sources = [
180 "test/low_bandwidth_audio_test.cc",
Artem Titovb1f2d602019-07-10 14:40:58 +0200181 "test/low_bandwidth_audio_test_flags.cc",
Artem Titovc8263e02019-07-05 12:34:36 +0200182 "test/pc_low_bandwidth_audio_test.cc",
kjellander8f8d1a02017-03-06 04:01:16 -0800183 ]
184
oprypin92220ff2017-03-23 03:40:03 -0700185 deps = [
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200186 ":audio_end_to_end_test",
Artem Titovc8263e02019-07-05 12:34:36 +0200187 "../api:create_network_emulation_manager",
188 "../api:create_peerconnection_quality_test_fixture",
189 "../api:network_emulation_manager_api",
190 "../api:peer_connection_quality_test_fixture_api",
Artem Titov46c4e602018-08-17 14:26:54 +0200191 "../api:simulated_network_api",
Artem Titovc8263e02019-07-05 12:34:36 +0200192 "../call:simulated_network",
oprypin92220ff2017-03-23 03:40:03 -0700193 "../common_audio",
194 "../system_wrappers",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100195 "../test:fileutils",
Artem Titovb1f2d602019-07-10 14:40:58 +0200196 "../test:perf_test",
oprypin92220ff2017-03-23 03:40:03 -0700197 "../test:test_common",
198 "../test:test_main",
Artem Titovc8263e02019-07-05 12:34:36 +0200199 "../test:test_support",
200 "../test/pc/e2e:network_quality_metrics_reporter",
tschumim9d117642017-07-17 01:41:41 -0700201 "//testing/gtest",
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200202 "//third_party/abseil-cpp/absl/flags:flag",
oprypin92220ff2017-03-23 03:40:03 -0700203 ]
kjellander8f8d1a02017-03-06 04:01:16 -0800204 if (is_android) {
oprypin92220ff2017-03-23 03:40:03 -0700205 deps += [ "//testing/android/native_test:native_test_native_code" ]
206 }
207
208 data = [
Oleh Prypin8cf0a872018-03-18 22:31:06 +0100209 "../resources/voice_engine/audio_tiny16.wav",
Oleh Prypin9c1ee362018-03-19 15:58:08 +0100210 "../resources/voice_engine/audio_tiny48.wav",
Oleh Prypin8cf0a872018-03-18 22:31:06 +0100211 ]
Oleh Prypin8cf0a872018-03-18 22:31:06 +0100212 }
213
214 group("low_bandwidth_audio_perf_test") {
215 testonly = true
216
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100217 deps = [ ":low_bandwidth_audio_test" ]
Oleh Prypin8cf0a872018-03-18 22:31:06 +0100218
219 data = [
220 "test/low_bandwidth_audio_test.py",
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200221 "../resources/voice_engine/audio_tiny16.wav",
222 "../resources/voice_engine/audio_tiny48.wav",
oprypin92220ff2017-03-23 03:40:03 -0700223 ]
Oleh Prypin7b2676f2018-03-19 11:33:03 +0100224 if (is_win) {
225 data += [ "${root_out_dir}/low_bandwidth_audio_test.exe" ]
226 } else {
227 data += [ "${root_out_dir}/low_bandwidth_audio_test" ]
228 }
229
Edward Lemur98d40362018-01-15 17:37:04 +0100230 if (is_linux || is_android) {
Edward Lemur20110752017-09-28 16:14:37 +0200231 data += [
232 "../tools_webrtc/audio_quality/linux/PolqaOem64",
233 "../tools_webrtc/audio_quality/linux/pesq",
234 ]
235 }
236 if (is_win) {
237 data += [
238 "../tools_webrtc/audio_quality/win/PolqaOem64.dll",
239 "../tools_webrtc/audio_quality/win/PolqaOem64.exe",
240 "../tools_webrtc/audio_quality/win/pesq.exe",
241 "../tools_webrtc/audio_quality/win/vcomp120.dll",
242 ]
243 }
244 if (is_mac) {
245 data += [ "../tools_webrtc/audio_quality/mac/pesq" ]
246 }
Oleh Prypin650a8262018-03-15 13:52:41 +0000247
Oleh Prypin8cf0a872018-03-18 22:31:06 +0100248 write_runtime_deps = "${root_out_dir}/${target_name}.runtime_deps"
kjellander8f8d1a02017-03-06 04:01:16 -0800249 }
250 }
tschumim9d117642017-07-17 01:41:41 -0700251
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200252 rtc_library("audio_perf_tests") {
tschumim9d117642017-07-17 01:41:41 -0700253 testonly = true
254
tschumim9d117642017-07-17 01:41:41 -0700255 sources = [
256 "test/audio_bwe_integration_test.cc",
257 "test/audio_bwe_integration_test.h",
258 ]
259 deps = [
Artem Titov46c4e602018-08-17 14:26:54 +0200260 "../api:simulated_network_api",
Danil Chapovalovad895282019-03-11 10:28:05 +0000261 "../api/task_queue",
Artem Titov4e199e92018-08-20 13:30:39 +0200262 "../call:fake_network",
263 "../call:simulated_network",
tschumim9d117642017-07-17 01:41:41 -0700264 "../common_audio",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700265 "../rtc_base:rtc_base_approved",
Danil Chapovalov31660fd2019-03-22 12:59:48 +0100266 "../rtc_base:task_queue_for_test",
tschumim9d117642017-07-17 01:41:41 -0700267 "../system_wrappers",
tschumim9d117642017-07-17 01:41:41 -0700268 "../test:field_trial",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100269 "../test:fileutils",
tschumim9d117642017-07-17 01:41:41 -0700270 "../test:test_common",
271 "../test:test_main",
Yves Gerey21cddff2018-10-30 21:12:42 +0100272 "../test:test_support",
tschumim9d117642017-07-17 01:41:41 -0700273 "//testing/gtest",
tschumim9d117642017-07-17 01:41:41 -0700274 ]
275
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100276 data = [ "//resources/voice_engine/audio_dtx16.wav" ]
tschumim9d117642017-07-17 01:41:41 -0700277 }
Peter Boström02083222016-06-14 12:52:54 +0200278}