Bug 1848242 - Mark basic.any.html subtest as intermittent. a=test-only
[gecko.git] / third_party / libwebrtc / audio / BUILD.gn
blob654cdbce0eafd104930ea67d71bd571a2989f304
1 # Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
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.
9 import("../webrtc.gni")
10 if (is_android) {
11   import("//build/config/android/config.gni")
12   import("//build/config/android/rules.gni")
15 rtc_library("audio") {
16   sources = [
17     "audio_level.cc",
18     "audio_level.h",
19     "audio_receive_stream.cc",
20     "audio_receive_stream.h",
21     "audio_send_stream.cc",
22     "audio_send_stream.h",
23     "audio_state.cc",
24     "audio_state.h",
25     "audio_transport_impl.cc",
26     "audio_transport_impl.h",
27     "channel_receive.cc",
28     "channel_receive.h",
29     "channel_receive_frame_transformer_delegate.cc",
30     "channel_receive_frame_transformer_delegate.h",
31     "channel_send.cc",
32     "channel_send.h",
33     "channel_send_frame_transformer_delegate.cc",
34     "channel_send_frame_transformer_delegate.h",
35     "conversion.h",
36     "remix_resample.cc",
37     "remix_resample.h",
38   ]
40   deps = [
41     "../api:array_view",
42     "../api:call_api",
43     "../api:field_trials_view",
44     "../api:frame_transformer_interface",
45     "../api:function_view",
46     "../api:rtp_headers",
47     "../api:rtp_parameters",
48     "../api:scoped_refptr",
49     "../api:sequence_checker",
50     "../api:transport_api",
51     "../api/audio:aec3_factory",
52     "../api/audio:audio_frame_api",
53     "../api/audio:audio_frame_processor",
54     "../api/audio:audio_mixer_api",
55     "../api/audio_codecs:audio_codecs_api",
56     "../api/crypto:frame_decryptor_interface",
57     "../api/crypto:frame_encryptor_interface",
58     "../api/crypto:options",
59     "../api/neteq:neteq_api",
60     "../api/rtc_event_log",
61     "../api/task_queue",
62     "../api/task_queue:pending_task_safety_flag",
63     "../api/transport/rtp:rtp_source",
64     "../api/units:time_delta",
65     "../call:audio_sender_interface",
66     "../call:bitrate_allocator",
67     "../call:call_interfaces",
68     "../call:rtp_interfaces",
69     "../common_audio",
70     "../common_audio:common_audio_c",
71     "../logging:rtc_event_audio",
72     "../logging:rtc_stream_config",
73     "../media:media_channel",
74     "../media:rtc_media_base",
75     "../modules/async_audio_processing",
76     "../modules/audio_coding",
77     "../modules/audio_coding:audio_coding_module_typedefs",
78     "../modules/audio_coding:audio_encoder_cng",
79     "../modules/audio_coding:audio_network_adaptor_config",
80     "../modules/audio_coding:red",
81     "../modules/audio_device",
82     "../modules/audio_processing",
83     "../modules/audio_processing:api",
84     "../modules/audio_processing:audio_frame_proxies",
85     "../modules/audio_processing:rms_level",
86     "../modules/pacing",
87     "../modules/rtp_rtcp",
88     "../modules/rtp_rtcp:rtp_rtcp_format",
89     "../rtc_base:audio_format_to_string",
90     "../rtc_base:buffer",
91     "../rtc_base:checks",
92     "../rtc_base:event_tracer",
93     "../rtc_base:logging",
94     "../rtc_base:macromagic",
95     "../rtc_base:race_checker",
96     "../rtc_base:rate_limiter",
97     "../rtc_base:refcount",
98     "../rtc_base:rtc_event",
99     "../rtc_base:rtc_numerics",
100     "../rtc_base:rtc_task_queue",
101     "../rtc_base:safe_conversions",
102     "../rtc_base:safe_minmax",
103     "../rtc_base:stringutils",
104     "../rtc_base:threading",
105     "../rtc_base:timeutils",
106     "../rtc_base/containers:flat_set",
107     "../rtc_base/experiments:field_trial_parser",
108     "../rtc_base/synchronization:mutex",
109     "../rtc_base/system:no_unique_address",
110     "../rtc_base/task_utils:repeating_task",
111     "../system_wrappers",
112     "../system_wrappers:field_trial",
113     "../system_wrappers:metrics",
114     "utility:audio_frame_operations",
115   ]
116   absl_deps = [
117     "//third_party/abseil-cpp/absl/functional:any_invocable",
118     "//third_party/abseil-cpp/absl/memory",
119     "//third_party/abseil-cpp/absl/strings",
120     "//third_party/abseil-cpp/absl/types:optional",
121   ]
123 if (rtc_include_tests) {
124   rtc_library("audio_end_to_end_test") {
125     testonly = true
127     sources = [
128       "test/audio_end_to_end_test.cc",
129       "test/audio_end_to_end_test.h",
130     ]
131     deps = [
132       ":audio",
133       "../api:simulated_network_api",
134       "../api/task_queue",
135       "../call:fake_network",
136       "../call:simulated_network",
137       "../modules/audio_device:audio_device_api",
138       "../modules/audio_device:test_audio_device_module",
139       "../system_wrappers",
140       "../test:test_common",
141       "../test:test_support",
142       "../test:video_test_constants",
143     ]
144   }
146   rtc_library("audio_tests") {
147     testonly = true
149     sources = [
150       "audio_receive_stream_unittest.cc",
151       "audio_send_stream_tests.cc",
152       "audio_send_stream_unittest.cc",
153       "audio_state_unittest.cc",
154       "channel_receive_frame_transformer_delegate_unittest.cc",
155       "channel_send_frame_transformer_delegate_unittest.cc",
156       "channel_send_unittest.cc",
157       "mock_voe_channel_proxy.h",
158       "remix_resample_unittest.cc",
159       "test/audio_stats_test.cc",
160       "test/nack_test.cc",
161       "test/non_sender_rtt_test.cc",
162     ]
163     deps = [
164       ":audio",
165       ":audio_end_to_end_test",
166       ":channel_receive_unittest",
167       "../api:libjingle_peerconnection_api",
168       "../api:mock_audio_mixer",
169       "../api:mock_frame_decryptor",
170       "../api:mock_frame_encryptor",
171       "../api:scoped_refptr",
172       "../api/audio:audio_frame_api",
173       "../api/audio_codecs:audio_codecs_api",
174       "../api/audio_codecs:builtin_audio_encoder_factory",
175       "../api/audio_codecs/opus:audio_decoder_opus",
176       "../api/audio_codecs/opus:audio_encoder_opus",
177       "../api/crypto:frame_decryptor_interface",
178       "../api/rtc_event_log",
179       "../api/task_queue:default_task_queue_factory",
180       "../api/task_queue/test:mock_task_queue_base",
181       "../api/units:time_delta",
182       "../api/units:timestamp",
183       "../call:mock_bitrate_allocator",
184       "../call:mock_call_interfaces",
185       "../call:mock_rtp_interfaces",
186       "../call:rtp_interfaces",
187       "../call:rtp_receiver",
188       "../call:rtp_sender",
189       "../common_audio",
190       "../logging:mocks",
191       "../modules/audio_device:audio_device_api",
192       "../modules/audio_device:audio_device_impl",  # For TestAudioDeviceModule
193       "../modules/audio_device:mock_audio_device",
194       "../modules/audio_mixer:audio_mixer_impl",
195       "../modules/audio_mixer:audio_mixer_test_utils",
196       "../modules/audio_processing:audio_processing_statistics",
197       "../modules/audio_processing:mocks",
198       "../modules/pacing",
199       "../modules/rtp_rtcp:mock_rtp_rtcp",
200       "../modules/rtp_rtcp:rtp_rtcp_format",
201       "../rtc_base:checks",
202       "../rtc_base:gunit_helpers",
203       "../rtc_base:macromagic",
204       "../rtc_base:refcount",
205       "../rtc_base:rtc_base_tests_utils",
206       "../rtc_base:safe_compare",
207       "../rtc_base:task_queue_for_test",
208       "../rtc_base:threading",
209       "../rtc_base:timeutils",
210       "../system_wrappers",
211       "../test:audio_codec_mocks",
212       "../test:field_trial",
213       "../test:mock_frame_transformer",
214       "../test:mock_transformable_frame",
215       "../test:mock_transport",
216       "../test:rtp_test_utils",
217       "../test:run_loop",
218       "../test:scoped_key_value_config",
219       "../test:test_common",
220       "../test:test_support",
221       "../test:video_test_constants",
222       "../test/time_controller:time_controller",
223       "utility:utility_tests",
224       "//testing/gtest",
225     ]
226   }
228   rtc_library("channel_receive_unittest") {
229     testonly = true
230     sources = [ "channel_receive_unittest.cc" ]
231     deps = [
232       ":audio",
233       "../api/audio_codecs:builtin_audio_decoder_factory",
234       "../api/crypto:frame_decryptor_interface",
235       "../api/task_queue:default_task_queue_factory",
236       "../logging:mocks",
237       "../modules/audio_device:audio_device_api",
238       "../modules/audio_device:mock_audio_device",
239       "../modules/rtp_rtcp",
240       "../modules/rtp_rtcp:rtp_rtcp_format",
241       "../rtc_base:logging",
242       "../rtc_base:threading",
243       "../test:audio_codec_mocks",
244       "../test:mock_transport",
245       "../test:test_support",
246       "../test/time_controller",
247     ]
248     absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
249   }
251   if (rtc_enable_protobuf && !build_with_chromium) {
252     rtc_test("low_bandwidth_audio_test") {
253       testonly = true
255       sources = [
256         "test/low_bandwidth_audio_test.cc",
257         "test/low_bandwidth_audio_test_flags.cc",
258         "test/pc_low_bandwidth_audio_test.cc",
259       ]
261       deps = [
262         ":audio_end_to_end_test",
263         "../api:create_network_emulation_manager",
264         "../api:create_peerconnection_quality_test_fixture",
265         "../api:network_emulation_manager_api",
266         "../api:peer_connection_quality_test_fixture_api",
267         "../api:simulated_network_api",
268         "../api:time_controller",
269         "../api/test/metrics:chrome_perf_dashboard_metrics_exporter",
270         "../api/test/metrics:global_metrics_logger_and_exporter",
271         "../api/test/metrics:metrics_exporter",
272         "../api/test/metrics:stdout_metrics_exporter",
273         "../api/test/pclf:media_configuration",
274         "../api/test/pclf:media_quality_test_params",
275         "../api/test/pclf:peer_configurer",
276         "../call:simulated_network",
277         "../common_audio",
278         "../system_wrappers",
279         "../test:fileutils",
280         "../test:test_common",
281         "../test:test_main",
282         "../test:test_support",
283         "../test:video_test_constants",
284         "../test/pc/e2e:network_quality_metrics_reporter",
285         "//testing/gtest",
286       ]
287       absl_deps = [
288         "//third_party/abseil-cpp/absl/flags:flag",
289         "//third_party/abseil-cpp/absl/strings",
290       ]
291       if (is_android) {
292         use_default_launcher = false
293         deps += [
294           "//build/android/gtest_apk:native_test_instrumentation_test_runner_java",
295           "//testing/android/native_test:native_test_java",
296           "//testing/android/native_test:native_test_support",
297         ]
298       }
299       data = [
300         "../resources/voice_engine/audio_tiny16.wav",
301         "../resources/voice_engine/audio_tiny48.wav",
302       ]
303     }
305     group("low_bandwidth_audio_perf_test") {
306       testonly = true
308       deps = [
309         ":low_bandwidth_audio_test",
310         "//third_party/catapult/tracing/tracing/proto:histogram_proto",
311         "//third_party/protobuf:py_proto_runtime",
312       ]
314       data = [
315         "test/low_bandwidth_audio_test.py",
316         "../resources/voice_engine/audio_tiny16.wav",
317         "../resources/voice_engine/audio_tiny48.wav",
318         "${root_out_dir}/pyproto/tracing/tracing/proto/histogram_pb2.py",
319       ]
321       # TODO(http://crbug.com/1029452): Create a cleaner target with just the
322       # tracing python code. We don't need Polymer for instance.
323       data_deps = [ "//third_party/catapult/tracing:convert_chart_json" ]
325       if (is_win) {
326         data += [ "${root_out_dir}/low_bandwidth_audio_test.exe" ]
327       } else {
328         data += [ "${root_out_dir}/low_bandwidth_audio_test" ]
329       }
331       if (is_linux || is_chromeos || is_android || is_fuchsia) {
332         data += [
333           "../tools_webrtc/audio_quality/linux/PolqaOem64",
334           "../tools_webrtc/audio_quality/linux/pesq",
335         ]
336       }
337       if (is_win) {
338         data += [
339           "../tools_webrtc/audio_quality/win/PolqaOem64.dll",
340           "../tools_webrtc/audio_quality/win/PolqaOem64.exe",
341           "../tools_webrtc/audio_quality/win/pesq.exe",
342           "../tools_webrtc/audio_quality/win/vcomp120.dll",
343         ]
344       }
345       if (is_mac) {
346         data += [ "../tools_webrtc/audio_quality/mac/pesq" ]
347       }
348     }
349   }