blob: 6dc6dc2a42864caa359a7ad0c947f84a67c42210 [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",
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",
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",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010036 "transport_feedback_packet_loss_tracker.cc",
37 "transport_feedback_packet_loss_tracker.h",
Peter Boström5c389d32015-09-25 13:58:30 +020038 ]
39
Peter Boström5c389d32015-09-25 13:58:30 +020040 deps = [
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010041 "../api:array_view",
kjellander676e08f2016-12-07 08:23:27 -080042 "../api:call_api",
Artem Titov741daaf2019-03-21 14:37:36 +010043 "../api:function_view",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010044 "../api:libjingle_peerconnection_api",
Niels Mölleref1052a2019-03-20 08:40:23 +010045 "../api:rtp_headers",
Mirko Bonadeid9708072019-01-25 20:26:48 +010046 "../api:scoped_refptr",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010047 "../api:transport_api",
Gustaf Ullbergf35c6662018-02-23 13:18:29 +010048 "../api/audio:aec3_factory",
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +020049 "../api/audio:audio_frame_api",
Gustaf Ullberg2ae140a2018-02-16 13:43:49 +010050 "../api/audio:audio_mixer_api",
ossueb1fde42017-05-02 06:46:30 -070051 "../api/audio_codecs:audio_codecs_api",
Danil Chapovalov83bbe912019-08-07 12:24:53 +020052 "../api/rtc_event_log",
Sebastian Jansson0b698262019-03-07 09:17:19 +010053 "../api/task_queue",
Mirko Bonadei245660a2017-10-10 14:38:11 +020054 "../call:bitrate_allocator",
ossuf515ab82016-12-07 04:52:58 -080055 "../call:call_interfaces",
nissed76b7b22017-06-01 04:02:35 -070056 "../call:rtp_interfaces",
aleloi04c07222016-11-22 06:42:53 -080057 "../common_audio",
Mirko Bonadeidbbb33c2018-02-05 15:50:41 +010058 "../common_audio:common_audio_c",
Qingsi Wang970b0882018-02-01 11:04:46 -080059 "../logging:rtc_event_audio",
Oskar Sundbom56ef3052018-10-30 16:11:02 +010060 "../logging:rtc_stream_config",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010061 "../modules/audio_coding",
Niels Möllered44f542019-07-30 15:15:59 +020062 "../modules/audio_coding:audio_coding_module_typedefs",
Karl Wiberg23659362018-11-01 11:13:44 +010063 "../modules/audio_coding:audio_encoder_cng",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010064 "../modules/audio_coding:audio_network_adaptor_config",
aleloidd310712016-11-17 06:28:59 -080065 "../modules/audio_device",
66 "../modules/audio_processing",
Alessio Bazzicab768e882018-11-07 14:29:54 +000067 "../modules/audio_processing:api",
Artem Titov94b57c02019-03-21 13:35:10 +010068 "../modules/bitrate_controller",
69 "../modules/pacing",
70 "../modules/remote_bitrate_estimator",
Mirko Bonadeib5728d92017-12-06 07:51:33 +010071 "../modules/rtp_rtcp",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010072 "../modules/rtp_rtcp:rtp_rtcp_format",
73 "../modules/utility",
Artem Titov94b57c02019-03-21 13:35:10 +010074 "../rtc_base",
Jonas Olssonabbe8412018-04-03 13:40:05 +020075 "../rtc_base:audio_format_to_string",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010076 "../rtc_base:checks",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +010077 "../rtc_base:rate_limiter",
ehmaldonadof6a861a2017-07-19 10:40:47 -070078 "../rtc_base:rtc_base_approved",
79 "../rtc_base:rtc_task_queue",
Karl Wiberg12edf4c2018-03-07 14:18:56 +010080 "../rtc_base:safe_minmax",
Sebastian Jansson470a5ea2019-01-23 12:37:49 +010081 "../rtc_base/experiments:audio_allocation_settings",
Peter Boström5c389d32015-09-25 13:58:30 +020082 "../system_wrappers",
Mirko Bonadei17f48782018-09-28 08:51:10 +020083 "../system_wrappers:field_trial",
84 "../system_wrappers:metrics",
Fredrik Solenberg2a877972017-12-15 16:42:15 +010085 "utility:audio_frame_operations",
Karl Wiberg918f50c2018-07-05 11:40:33 +020086 "//third_party/abseil-cpp/absl/memory",
Danil Chapovalovb9b146c2018-06-15 12:28:07 +020087 "//third_party/abseil-cpp/absl/types:optional",
Peter Boström5c389d32015-09-25 13:58:30 +020088 ]
89}
Peter Boström02083222016-06-14 12:52:54 +020090if (rtc_include_tests) {
Fredrik Solenberg73276ad2017-09-14 14:46:47 +020091 rtc_source_set("audio_end_to_end_test") {
92 testonly = true
93
94 sources = [
95 "test/audio_end_to_end_test.cc",
96 "test/audio_end_to_end_test.h",
97 ]
98 deps = [
99 ":audio",
Artem Titov46c4e602018-08-17 14:26:54 +0200100 "../api:simulated_network_api",
Artem Titov4e199e92018-08-20 13:30:39 +0200101 "../call:fake_network",
102 "../call:simulated_network",
Artem Titov94b57c02019-03-21 13:35:10 +0100103 "../system_wrappers",
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200104 "../test:test_common",
105 "../test:test_support",
Steve Anton40d55332019-01-07 10:21:47 -0800106 "//third_party/abseil-cpp/absl/memory",
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200107 ]
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200108 }
109
ehmaldonado38a21322016-09-02 04:10:34 -0700110 rtc_source_set("audio_tests") {
Peter Boström02083222016-06-14 12:52:54 +0200111 testonly = true
kjellander676e08f2016-12-07 08:23:27 -0800112
Peter Boström02083222016-06-14 12:52:54 +0200113 sources = [
114 "audio_receive_stream_unittest.cc",
solenberg18f54272017-09-15 09:56:08 -0700115 "audio_send_stream_tests.cc",
Peter Boström02083222016-06-14 12:52:54 +0200116 "audio_send_stream_unittest.cc",
117 "audio_state_unittest.cc",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +0100118 "mock_voe_channel_proxy.h",
119 "remix_resample_unittest.cc",
Mirko Bonadei264bee82018-08-07 08:53:41 +0200120 "test/audio_stats_test.cc",
Niels Möller7d76a312018-10-26 12:57:07 +0200121 "test/media_transport_test.cc",
Fredrik Solenberga8b7c7f2018-01-17 11:18:31 +0100122 "transport_feedback_packet_loss_tracker_unittest.cc",
Peter Boström02083222016-06-14 12:52:54 +0200123 ]
124 deps = [
125 ":audio",
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200126 ":audio_end_to_end_test",
Anton Sukhanov4f08faa2019-05-21 11:12:57 -0700127 "../api:libjingle_peerconnection_api",
Niels Möller7d76a312018-10-26 12:57:07 +0200128 "../api:loopback_media_transport",
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",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100166 "../test:rtp_test_utils",
aleloi10111bc2016-11-17 06:48:48 -0800167 "../test:test_common",
aleloi6321b492016-12-05 01:46:09 -0800168 "../test:test_support",
ehmaldonado894c2bb2017-01-05 06:03:24 -0800169 "utility:utility_tests",
Peter Boström02083222016-06-14 12:52:54 +0200170 "//testing/gtest",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200171 "//third_party/abseil-cpp/absl/memory",
Peter Boström02083222016-06-14 12:52:54 +0200172 ]
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",
203 "//third_party/abseil-cpp/absl/memory",
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
218 deps = [
219 ":low_bandwidth_audio_test",
220 ]
221
222 data = [
223 "test/low_bandwidth_audio_test.py",
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200224 "../resources/voice_engine/audio_tiny16.wav",
225 "../resources/voice_engine/audio_tiny48.wav",
oprypin92220ff2017-03-23 03:40:03 -0700226 ]
Oleh Prypin7b2676f2018-03-19 11:33:03 +0100227 if (is_win) {
228 data += [ "${root_out_dir}/low_bandwidth_audio_test.exe" ]
229 } else {
230 data += [ "${root_out_dir}/low_bandwidth_audio_test" ]
231 }
232
Edward Lemur98d40362018-01-15 17:37:04 +0100233 if (is_linux || is_android) {
Edward Lemur20110752017-09-28 16:14:37 +0200234 data += [
235 "../tools_webrtc/audio_quality/linux/PolqaOem64",
236 "../tools_webrtc/audio_quality/linux/pesq",
237 ]
238 }
239 if (is_win) {
240 data += [
241 "../tools_webrtc/audio_quality/win/PolqaOem64.dll",
242 "../tools_webrtc/audio_quality/win/PolqaOem64.exe",
243 "../tools_webrtc/audio_quality/win/pesq.exe",
244 "../tools_webrtc/audio_quality/win/vcomp120.dll",
245 ]
246 }
247 if (is_mac) {
248 data += [ "../tools_webrtc/audio_quality/mac/pesq" ]
249 }
Oleh Prypin650a8262018-03-15 13:52:41 +0000250
Oleh Prypin8cf0a872018-03-18 22:31:06 +0100251 write_runtime_deps = "${root_out_dir}/${target_name}.runtime_deps"
kjellander8f8d1a02017-03-06 04:01:16 -0800252 }
253 }
tschumim9d117642017-07-17 01:41:41 -0700254
255 rtc_source_set("audio_perf_tests") {
256 testonly = true
257
tschumim9d117642017-07-17 01:41:41 -0700258 sources = [
259 "test/audio_bwe_integration_test.cc",
260 "test/audio_bwe_integration_test.h",
261 ]
262 deps = [
Artem Titov46c4e602018-08-17 14:26:54 +0200263 "../api:simulated_network_api",
Danil Chapovalovad895282019-03-11 10:28:05 +0000264 "../api/task_queue",
Artem Titov4e199e92018-08-20 13:30:39 +0200265 "../call:fake_network",
266 "../call:simulated_network",
tschumim9d117642017-07-17 01:41:41 -0700267 "../common_audio",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700268 "../rtc_base:rtc_base_approved",
Danil Chapovalov31660fd2019-03-22 12:59:48 +0100269 "../rtc_base:task_queue_for_test",
tschumim9d117642017-07-17 01:41:41 -0700270 "../system_wrappers",
tschumim9d117642017-07-17 01:41:41 -0700271 "../test:field_trial",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100272 "../test:fileutils",
eladalon413ee9a2017-08-22 04:02:52 -0700273 "../test:single_threaded_task_queue",
tschumim9d117642017-07-17 01:41:41 -0700274 "../test:test_common",
275 "../test:test_main",
Yves Gerey21cddff2018-10-30 21:12:42 +0100276 "../test:test_support",
tschumim9d117642017-07-17 01:41:41 -0700277 "//testing/gtest",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200278 "//third_party/abseil-cpp/absl/memory",
tschumim9d117642017-07-17 01:41:41 -0700279 ]
280
281 data = [
282 "//resources/voice_engine/audio_dtx16.wav",
283 ]
tschumim9d117642017-07-17 01:41:41 -0700284 }
Peter Boström02083222016-06-14 12:52:54 +0200285}