• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# 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
9import("../webrtc.gni")
10if (is_android) {
11  import("//build/config/android/config.gni")
12  import("//build/config/android/rules.gni")
13}
14
15rtc_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    "null_audio_poller.cc",
37    "null_audio_poller.h",
38    "remix_resample.cc",
39    "remix_resample.h",
40  ]
41
42  deps = [
43    "../api:array_view",
44    "../api:call_api",
45    "../api:frame_transformer_interface",
46    "../api:function_view",
47    "../api:rtp_headers",
48    "../api:rtp_parameters",
49    "../api:scoped_refptr",
50    "../api:transport_api",
51    "../api/audio:aec3_factory",
52    "../api/audio:audio_frame_api",
53    "../api/audio:audio_mixer_api",
54    "../api/audio_codecs:audio_codecs_api",
55    "../api/crypto:frame_decryptor_interface",
56    "../api/crypto:frame_encryptor_interface",
57    "../api/crypto:options",
58    "../api/neteq:neteq_api",
59    "../api/rtc_event_log",
60    "../api/task_queue",
61    "../api/transport/rtp:rtp_source",
62    "../call:audio_sender_interface",
63    "../call:bitrate_allocator",
64    "../call:call_interfaces",
65    "../call:rtp_interfaces",
66    "../common_audio",
67    "../common_audio:common_audio_c",
68    "../logging:rtc_event_audio",
69    "../logging:rtc_stream_config",
70    "../modules/audio_coding",
71    "../modules/audio_coding:audio_coding_module_typedefs",
72    "../modules/audio_coding:audio_encoder_cng",
73    "../modules/audio_coding:audio_network_adaptor_config",
74    "../modules/audio_coding:red",
75    "../modules/audio_device",
76    "../modules/audio_processing",
77    "../modules/audio_processing:api",
78    "../modules/audio_processing:audio_frame_proxies",
79    "../modules/audio_processing:rms_level",
80    "../modules/pacing",
81    "../modules/remote_bitrate_estimator",
82    "../modules/rtp_rtcp",
83    "../modules/rtp_rtcp:rtp_rtcp_format",
84    "../modules/utility",
85    "../rtc_base",
86    "../rtc_base:audio_format_to_string",
87    "../rtc_base:checks",
88    "../rtc_base:rate_limiter",
89    "../rtc_base:rtc_base_approved",
90    "../rtc_base:rtc_task_queue",
91    "../rtc_base:safe_minmax",
92    "../rtc_base/experiments:field_trial_parser",
93    "../rtc_base/synchronization:mutex",
94    "../rtc_base/synchronization:sequence_checker",
95    "../rtc_base/task_utils:to_queued_task",
96    "../system_wrappers",
97    "../system_wrappers:field_trial",
98    "../system_wrappers:metrics",
99    "utility:audio_frame_operations",
100  ]
101  absl_deps = [
102    "//third_party/abseil-cpp/absl/memory",
103    "//third_party/abseil-cpp/absl/types:optional",
104  ]
105}
106if (rtc_include_tests) {
107  rtc_library("audio_end_to_end_test") {
108    testonly = true
109
110    sources = [
111      "test/audio_end_to_end_test.cc",
112      "test/audio_end_to_end_test.h",
113    ]
114    deps = [
115      ":audio",
116      "../api:simulated_network_api",
117      "../api/task_queue",
118      "../call:fake_network",
119      "../call:simulated_network",
120      "../system_wrappers",
121      "../test:test_common",
122      "../test:test_support",
123    ]
124  }
125
126  rtc_library("audio_tests") {
127    testonly = true
128
129    sources = [
130      "audio_receive_stream_unittest.cc",
131      "audio_send_stream_tests.cc",
132      "audio_send_stream_unittest.cc",
133      "audio_state_unittest.cc",
134      "channel_receive_frame_transformer_delegate_unittest.cc",
135      "channel_send_frame_transformer_delegate_unittest.cc",
136      "mock_voe_channel_proxy.h",
137      "remix_resample_unittest.cc",
138      "test/audio_stats_test.cc",
139    ]
140    deps = [
141      ":audio",
142      ":audio_end_to_end_test",
143      "../api:libjingle_peerconnection_api",
144      "../api:mock_audio_mixer",
145      "../api:mock_frame_decryptor",
146      "../api:mock_frame_encryptor",
147      "../api/audio:audio_frame_api",
148      "../api/audio_codecs:audio_codecs_api",
149      "../api/audio_codecs/opus:audio_decoder_opus",
150      "../api/audio_codecs/opus:audio_encoder_opus",
151      "../api/rtc_event_log",
152      "../api/task_queue:default_task_queue_factory",
153      "../api/units:time_delta",
154      "../call:mock_bitrate_allocator",
155      "../call:mock_call_interfaces",
156      "../call:mock_rtp_interfaces",
157      "../call:rtp_interfaces",
158      "../call:rtp_receiver",
159      "../call:rtp_sender",
160      "../common_audio",
161      "../logging:mocks",
162      "../modules/audio_device:audio_device_impl",  # For TestAudioDeviceModule
163      "../modules/audio_device:mock_audio_device",
164      "../modules/audio_mixer:audio_mixer_impl",
165      "../modules/audio_mixer:audio_mixer_test_utils",
166      "../modules/audio_processing:audio_processing_statistics",
167      "../modules/audio_processing:mocks",
168      "../modules/pacing",
169      "../modules/rtp_rtcp:mock_rtp_rtcp",
170      "../modules/rtp_rtcp:rtp_rtcp_format",
171      "../modules/utility",
172      "../rtc_base:checks",
173      "../rtc_base:rtc_base_approved",
174      "../rtc_base:rtc_base_tests_utils",
175      "../rtc_base:safe_compare",
176      "../rtc_base:task_queue_for_test",
177      "../rtc_base:timeutils",
178      "../system_wrappers",
179      "../test:audio_codec_mocks",
180      "../test:field_trial",
181      "../test:mock_frame_transformer",
182      "../test:mock_transformable_frame",
183      "../test:mock_transport",
184      "../test:rtp_test_utils",
185      "../test:test_common",
186      "../test:test_support",
187      "utility:utility_tests",
188      "//testing/gtest",
189    ]
190  }
191
192  if (rtc_enable_protobuf) {
193    rtc_test("low_bandwidth_audio_test") {
194      testonly = true
195
196      sources = [
197        "test/low_bandwidth_audio_test.cc",
198        "test/low_bandwidth_audio_test_flags.cc",
199        "test/pc_low_bandwidth_audio_test.cc",
200      ]
201
202      deps = [
203        ":audio_end_to_end_test",
204        "../api:create_network_emulation_manager",
205        "../api:create_peerconnection_quality_test_fixture",
206        "../api:network_emulation_manager_api",
207        "../api:peer_connection_quality_test_fixture_api",
208        "../api:simulated_network_api",
209        "../api:time_controller",
210        "../call:simulated_network",
211        "../common_audio",
212        "../system_wrappers",
213        "../test:fileutils",
214        "../test:perf_test",
215        "../test:test_common",
216        "../test:test_main",
217        "../test:test_support",
218        "../test/pc/e2e:network_quality_metrics_reporter",
219        "//testing/gtest",
220        "//third_party/abseil-cpp/absl/flags:flag",
221      ]
222      if (is_android) {
223        deps += [ "//testing/android/native_test:native_test_native_code" ]
224      }
225      data = [
226        "../resources/voice_engine/audio_tiny16.wav",
227        "../resources/voice_engine/audio_tiny48.wav",
228      ]
229    }
230
231    group("low_bandwidth_audio_perf_test") {
232      testonly = true
233
234      deps = [
235        ":low_bandwidth_audio_test",
236        "//third_party/catapult/tracing/tracing/proto:histogram_proto",
237        "//third_party/protobuf:py_proto_runtime",
238      ]
239
240      data = [
241        "test/low_bandwidth_audio_test.py",
242        "../resources/voice_engine/audio_tiny16.wav",
243        "../resources/voice_engine/audio_tiny48.wav",
244        "${root_out_dir}/pyproto/tracing/tracing/proto/histogram_pb2.py",
245      ]
246
247      # TODO(http://crbug.com/1029452): Create a cleaner target with just the
248      # tracing python code. We don't need Polymer for instance.
249      data_deps = [ "//third_party/catapult/tracing:convert_chart_json" ]
250
251      if (is_win) {
252        data += [ "${root_out_dir}/low_bandwidth_audio_test.exe" ]
253      } else {
254        data += [ "${root_out_dir}/low_bandwidth_audio_test" ]
255      }
256
257      if (is_linux || is_android) {
258        data += [
259          "../tools_webrtc/audio_quality/linux/PolqaOem64",
260          "../tools_webrtc/audio_quality/linux/pesq",
261        ]
262      }
263      if (is_win) {
264        data += [
265          "../tools_webrtc/audio_quality/win/PolqaOem64.dll",
266          "../tools_webrtc/audio_quality/win/PolqaOem64.exe",
267          "../tools_webrtc/audio_quality/win/pesq.exe",
268          "../tools_webrtc/audio_quality/win/vcomp120.dll",
269        ]
270      }
271      if (is_mac) {
272        data += [ "../tools_webrtc/audio_quality/mac/pesq" ]
273      }
274
275      write_runtime_deps = "${root_out_dir}/${target_name}.runtime_deps"
276    }
277  }
278
279  rtc_library("audio_perf_tests") {
280    testonly = true
281
282    sources = [
283      "test/audio_bwe_integration_test.cc",
284      "test/audio_bwe_integration_test.h",
285    ]
286    deps = [
287      "../api:simulated_network_api",
288      "../api/task_queue",
289      "../call:fake_network",
290      "../call:simulated_network",
291      "../common_audio",
292      "../rtc_base:rtc_base_approved",
293      "../rtc_base:task_queue_for_test",
294      "../system_wrappers",
295      "../test:field_trial",
296      "../test:fileutils",
297      "../test:test_common",
298      "../test:test_main",
299      "../test:test_support",
300      "//testing/gtest",
301    ]
302
303    data = [ "//resources/voice_engine/audio_dtx16.wav" ]
304  }
305}
306