blob: e03252ac963fc4518b33638b5244f892652a9eca [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",
Per Åhgren71652f42020-03-17 13:23:58 +010072 "../modules/audio_processing:audio_frame_proxies",
Artem Titov94b57c02019-03-21 13:35:10 +010073 "../modules/pacing",
74 "../modules/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",
Artem Titov94b57c02019-03-21 13:35:10 +010078 "../rtc_base",
Jonas Olssonabbe8412018-04-03 13:40:05 +020079 "../rtc_base:audio_format_to_string",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010080 "../rtc_base:checks",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010081 "../rtc_base:rate_limiter",
ehmaldonadof6a861a2017-07-19 10:40:47 -070082 "../rtc_base:rtc_base_approved",
83 "../rtc_base:rtc_task_queue",
Karl Wiberg12edf4c2018-03-07 14:18:56 +010084 "../rtc_base:safe_minmax",
Sebastian Janssonf23131f2019-10-03 10:03:55 +020085 "../rtc_base/experiments:field_trial_parser",
Peter Boström5c389d32015-09-25 13:58:30 +020086 "../system_wrappers",
Mirko Bonadei17f48782018-09-28 08:51:10 +020087 "../system_wrappers:field_trial",
88 "../system_wrappers:metrics",
Fredrik Solenberg2a877972017-12-15 16:42:15 +010089 "utility:audio_frame_operations",
Karl Wiberg918f50c2018-07-05 11:40:33 +020090 "//third_party/abseil-cpp/absl/memory",
Danil Chapovalovb9b146c2018-06-15 12:28:07 +020091 "//third_party/abseil-cpp/absl/types:optional",
Peter Boström5c389d32015-09-25 13:58:30 +020092 ]
93}
Peter Boström02083222016-06-14 12:52:54 +020094if (rtc_include_tests) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +020095 rtc_library("audio_end_to_end_test") {
Fredrik Solenberg73276ad2017-09-14 14:46:47 +020096 testonly = true
97
98 sources = [
99 "test/audio_end_to_end_test.cc",
100 "test/audio_end_to_end_test.h",
101 ]
102 deps = [
103 ":audio",
Artem Titov46c4e602018-08-17 14:26:54 +0200104 "../api:simulated_network_api",
Danil Chapovalov44db4362019-09-30 04:16:28 +0200105 "../api/task_queue",
Artem Titov4e199e92018-08-20 13:30:39 +0200106 "../call:fake_network",
107 "../call:simulated_network",
Artem Titov94b57c02019-03-21 13:35:10 +0100108 "../system_wrappers",
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200109 "../test:test_common",
110 "../test:test_support",
111 ]
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200112 }
113
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200114 rtc_library("audio_tests") {
Peter Boström02083222016-06-14 12:52:54 +0200115 testonly = true
kjellander676e08f2016-12-07 08:23:27 -0800116
Peter Boström02083222016-06-14 12:52:54 +0200117 sources = [
118 "audio_receive_stream_unittest.cc",
solenberg18f54272017-09-15 09:56:08 -0700119 "audio_send_stream_tests.cc",
Peter Boström02083222016-06-14 12:52:54 +0200120 "audio_send_stream_unittest.cc",
121 "audio_state_unittest.cc",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +0100122 "mock_voe_channel_proxy.h",
123 "remix_resample_unittest.cc",
Mirko Bonadei264bee82018-08-07 08:53:41 +0200124 "test/audio_stats_test.cc",
Peter Boström02083222016-06-14 12:52:54 +0200125 ]
126 deps = [
127 ":audio",
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200128 ":audio_end_to_end_test",
Anton Sukhanov4f08faa2019-05-21 11:12:57 -0700129 "../api:libjingle_peerconnection_api",
aleloi04c07222016-11-22 06:42:53 -0800130 "../api:mock_audio_mixer",
Benjamin Wright78410ad2018-10-25 09:52:57 -0700131 "../api:mock_frame_decryptor",
132 "../api:mock_frame_encryptor",
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +0200133 "../api/audio:audio_frame_api",
Niels Möller7d76a312018-10-26 12:57:07 +0200134 "../api/audio_codecs:audio_codecs_api",
135 "../api/audio_codecs/opus:audio_decoder_opus",
136 "../api/audio_codecs/opus:audio_encoder_opus",
Danil Chapovalov83bbe912019-08-07 12:24:53 +0200137 "../api/rtc_event_log",
Danil Chapovalov31660fd2019-03-22 12:59:48 +0100138 "../api/task_queue:default_task_queue_factory",
Sebastian Jansson5f83cf02018-05-08 14:52:22 +0200139 "../api/units:time_delta",
Niels Möller7d76a312018-10-26 12:57:07 +0200140 "../call:mock_bitrate_allocator",
Fredrik Solenberg2a877972017-12-15 16:42:15 +0100141 "../call:mock_call_interfaces",
Sebastian Janssonef9daee2018-02-22 14:49:02 +0100142 "../call:mock_rtp_interfaces",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100143 "../call:rtp_interfaces",
nisse0f15f922017-06-21 01:05:22 -0700144 "../call:rtp_receiver",
Sebastian Jansson0b698262019-03-07 09:17:19 +0100145 "../call:rtp_sender",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +0100146 "../common_audio",
Patrik Höglund731082c2018-01-03 09:08:20 +0100147 "../logging:mocks",
Danil Chapovalov31660fd2019-03-22 12:59:48 +0100148 "../modules/audio_device:audio_device_impl", # For TestAudioDeviceModule
aleloidd310712016-11-17 06:28:59 -0800149 "../modules/audio_device:mock_audio_device",
aleloi04c07222016-11-22 06:42:53 -0800150 "../modules/audio_mixer:audio_mixer_impl",
Henrik Boströmd2c336f2019-07-03 17:11:10 +0200151 "../modules/audio_mixer:audio_mixer_test_utils",
Ivo Creusen56d46092017-11-24 17:29:59 +0100152 "../modules/audio_processing:audio_processing_statistics",
Patrik Höglund62139292017-12-19 16:44:45 +0100153 "../modules/audio_processing:mocks",
Artem Titov94b57c02019-03-21 13:35:10 +0100154 "../modules/pacing",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100155 "../modules/rtp_rtcp:mock_rtp_rtcp",
156 "../modules/rtp_rtcp:rtp_rtcp_format",
Niels Möller7d76a312018-10-26 12:57:07 +0200157 "../modules/utility",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +0100158 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700159 "../rtc_base:rtc_base_approved",
Danil Chapovalov31660fd2019-03-22 12:59:48 +0100160 "../rtc_base:rtc_base_tests_utils",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100161 "../rtc_base:safe_compare",
Danil Chapovalov31660fd2019-03-22 12:59:48 +0100162 "../rtc_base:task_queue_for_test",
Bjorn Terelius5c2f1f02019-01-16 17:45:05 +0100163 "../rtc_base:timeutils",
Artem Titov94b57c02019-03-21 13:35:10 +0100164 "../system_wrappers",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100165 "../test:audio_codec_mocks",
Danil Chapovalov31660fd2019-03-22 12:59:48 +0100166 "../test:field_trial",
Tim Na9526c552020-02-20 11:53:13 -0800167 "../test:mock_transport",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100168 "../test:rtp_test_utils",
aleloi10111bc2016-11-17 06:48:48 -0800169 "../test:test_common",
aleloi6321b492016-12-05 01:46:09 -0800170 "../test:test_support",
ehmaldonado894c2bb2017-01-05 06:03:24 -0800171 "utility:utility_tests",
Peter Boström02083222016-06-14 12:52:54 +0200172 "//testing/gtest",
173 ]
Peter Boström02083222016-06-14 12:52:54 +0200174 }
kjellander8f8d1a02017-03-06 04:01:16 -0800175
176 if (rtc_enable_protobuf) {
oprypin6d305ba2017-03-30 04:01:30 -0700177 rtc_test("low_bandwidth_audio_test") {
kjellander8f8d1a02017-03-06 04:01:16 -0800178 testonly = true
179
180 sources = [
181 "test/low_bandwidth_audio_test.cc",
Artem Titovb1f2d602019-07-10 14:40:58 +0200182 "test/low_bandwidth_audio_test_flags.cc",
Artem Titovc8263e02019-07-05 12:34:36 +0200183 "test/pc_low_bandwidth_audio_test.cc",
kjellander8f8d1a02017-03-06 04:01:16 -0800184 ]
185
oprypin92220ff2017-03-23 03:40:03 -0700186 deps = [
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200187 ":audio_end_to_end_test",
Artem Titovc8263e02019-07-05 12:34:36 +0200188 "../api:create_network_emulation_manager",
189 "../api:create_peerconnection_quality_test_fixture",
190 "../api:network_emulation_manager_api",
191 "../api:peer_connection_quality_test_fixture_api",
Artem Titov46c4e602018-08-17 14:26:54 +0200192 "../api:simulated_network_api",
Artem Titovc8263e02019-07-05 12:34:36 +0200193 "../call:simulated_network",
oprypin92220ff2017-03-23 03:40:03 -0700194 "../common_audio",
195 "../system_wrappers",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100196 "../test:fileutils",
Artem Titovb1f2d602019-07-10 14:40:58 +0200197 "../test:perf_test",
oprypin92220ff2017-03-23 03:40:03 -0700198 "../test:test_common",
199 "../test:test_main",
Artem Titovc8263e02019-07-05 12:34:36 +0200200 "../test:test_support",
201 "../test/pc/e2e:network_quality_metrics_reporter",
tschumim9d117642017-07-17 01:41:41 -0700202 "//testing/gtest",
Mirko Bonadei2ab97f62019-07-18 13:44:12 +0200203 "//third_party/abseil-cpp/absl/flags:flag",
oprypin92220ff2017-03-23 03:40:03 -0700204 ]
kjellander8f8d1a02017-03-06 04:01:16 -0800205 if (is_android) {
oprypin92220ff2017-03-23 03:40:03 -0700206 deps += [ "//testing/android/native_test:native_test_native_code" ]
207 }
208
209 data = [
Oleh Prypin8cf0a872018-03-18 22:31:06 +0100210 "../resources/voice_engine/audio_tiny16.wav",
Oleh Prypin9c1ee362018-03-19 15:58:08 +0100211 "../resources/voice_engine/audio_tiny48.wav",
Oleh Prypin8cf0a872018-03-18 22:31:06 +0100212 ]
Oleh Prypin8cf0a872018-03-18 22:31:06 +0100213 }
214
215 group("low_bandwidth_audio_perf_test") {
216 testonly = true
217
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100218 deps = [ ":low_bandwidth_audio_test" ]
Oleh Prypin8cf0a872018-03-18 22:31:06 +0100219
220 data = [
221 "test/low_bandwidth_audio_test.py",
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200222 "../resources/voice_engine/audio_tiny16.wav",
223 "../resources/voice_engine/audio_tiny48.wav",
oprypin92220ff2017-03-23 03:40:03 -0700224 ]
Oleh Prypin7b2676f2018-03-19 11:33:03 +0100225 if (is_win) {
226 data += [ "${root_out_dir}/low_bandwidth_audio_test.exe" ]
227 } else {
228 data += [ "${root_out_dir}/low_bandwidth_audio_test" ]
229 }
230
Edward Lemur98d40362018-01-15 17:37:04 +0100231 if (is_linux || is_android) {
Edward Lemur20110752017-09-28 16:14:37 +0200232 data += [
233 "../tools_webrtc/audio_quality/linux/PolqaOem64",
234 "../tools_webrtc/audio_quality/linux/pesq",
235 ]
236 }
237 if (is_win) {
238 data += [
239 "../tools_webrtc/audio_quality/win/PolqaOem64.dll",
240 "../tools_webrtc/audio_quality/win/PolqaOem64.exe",
241 "../tools_webrtc/audio_quality/win/pesq.exe",
242 "../tools_webrtc/audio_quality/win/vcomp120.dll",
243 ]
244 }
245 if (is_mac) {
246 data += [ "../tools_webrtc/audio_quality/mac/pesq" ]
247 }
Oleh Prypin650a8262018-03-15 13:52:41 +0000248
Oleh Prypin8cf0a872018-03-18 22:31:06 +0100249 write_runtime_deps = "${root_out_dir}/${target_name}.runtime_deps"
kjellander8f8d1a02017-03-06 04:01:16 -0800250 }
251 }
tschumim9d117642017-07-17 01:41:41 -0700252
Mirko Bonadei86d053c2019-10-17 21:32:04 +0200253 rtc_library("audio_perf_tests") {
tschumim9d117642017-07-17 01:41:41 -0700254 testonly = true
255
tschumim9d117642017-07-17 01:41:41 -0700256 sources = [
257 "test/audio_bwe_integration_test.cc",
258 "test/audio_bwe_integration_test.h",
259 ]
260 deps = [
Artem Titov46c4e602018-08-17 14:26:54 +0200261 "../api:simulated_network_api",
Danil Chapovalovad895282019-03-11 10:28:05 +0000262 "../api/task_queue",
Artem Titov4e199e92018-08-20 13:30:39 +0200263 "../call:fake_network",
264 "../call:simulated_network",
tschumim9d117642017-07-17 01:41:41 -0700265 "../common_audio",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700266 "../rtc_base:rtc_base_approved",
Danil Chapovalov31660fd2019-03-22 12:59:48 +0100267 "../rtc_base:task_queue_for_test",
tschumim9d117642017-07-17 01:41:41 -0700268 "../system_wrappers",
tschumim9d117642017-07-17 01:41:41 -0700269 "../test:field_trial",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100270 "../test:fileutils",
tschumim9d117642017-07-17 01:41:41 -0700271 "../test:test_common",
272 "../test:test_main",
Yves Gerey21cddff2018-10-30 21:12:42 +0100273 "../test:test_support",
tschumim9d117642017-07-17 01:41:41 -0700274 "//testing/gtest",
tschumim9d117642017-07-17 01:41:41 -0700275 ]
276
Mirko Bonadeiccbe95f2020-01-21 12:10:10 +0100277 data = [ "//resources/voice_engine/audio_dtx16.wav" ]
tschumim9d117642017-07-17 01:41:41 -0700278 }
Peter Boström02083222016-06-14 12:52:54 +0200279}