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 "remix_resample.cc", 37 "remix_resample.h", 38 ] 39 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:rtc_media_base", 74 "../modules/async_audio_processing", 75 "../modules/audio_coding", 76 "../modules/audio_coding:audio_coding_module_typedefs", 77 "../modules/audio_coding:audio_encoder_cng", 78 "../modules/audio_coding:audio_network_adaptor_config", 79 "../modules/audio_coding:red", 80 "../modules/audio_device", 81 "../modules/audio_processing", 82 "../modules/audio_processing:api", 83 "../modules/audio_processing:audio_frame_proxies", 84 "../modules/audio_processing:rms_level", 85 "../modules/pacing", 86 "../modules/rtp_rtcp", 87 "../modules/rtp_rtcp:rtp_rtcp_format", 88 "../modules/utility:utility", 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_task_queue", 100 "../rtc_base:safe_conversions", 101 "../rtc_base:safe_minmax", 102 "../rtc_base:stringutils", 103 "../rtc_base:threading", 104 "../rtc_base:timeutils", 105 "../rtc_base/containers:flat_set", 106 "../rtc_base/experiments:field_trial_parser", 107 "../rtc_base/synchronization:mutex", 108 "../rtc_base/system:no_unique_address", 109 "../rtc_base/task_utils:repeating_task", 110 "../system_wrappers", 111 "../system_wrappers:field_trial", 112 "../system_wrappers:metrics", 113 "utility:audio_frame_operations", 114 ] 115 absl_deps = [ 116 "//third_party/abseil-cpp/absl/functional:any_invocable", 117 "//third_party/abseil-cpp/absl/memory", 118 "//third_party/abseil-cpp/absl/strings", 119 "//third_party/abseil-cpp/absl/types:optional", 120 ] 121} 122if (rtc_include_tests) { 123 rtc_library("audio_end_to_end_test") { 124 testonly = true 125 126 sources = [ 127 "test/audio_end_to_end_test.cc", 128 "test/audio_end_to_end_test.h", 129 ] 130 deps = [ 131 ":audio", 132 "../api:simulated_network_api", 133 "../api/task_queue", 134 "../call:fake_network", 135 "../call:simulated_network", 136 "../system_wrappers", 137 "../test:test_common", 138 "../test:test_support", 139 ] 140 } 141 142 rtc_library("audio_tests") { 143 testonly = true 144 145 sources = [ 146 "audio_receive_stream_unittest.cc", 147 "audio_send_stream_tests.cc", 148 "audio_send_stream_unittest.cc", 149 "audio_state_unittest.cc", 150 "channel_receive_frame_transformer_delegate_unittest.cc", 151 "channel_send_frame_transformer_delegate_unittest.cc", 152 "mock_voe_channel_proxy.h", 153 "remix_resample_unittest.cc", 154 "test/audio_stats_test.cc", 155 "test/nack_test.cc", 156 "test/non_sender_rtt_test.cc", 157 ] 158 deps = [ 159 ":audio", 160 ":audio_end_to_end_test", 161 "../api:libjingle_peerconnection_api", 162 "../api:mock_audio_mixer", 163 "../api:mock_frame_decryptor", 164 "../api:mock_frame_encryptor", 165 "../api/audio:audio_frame_api", 166 "../api/audio_codecs:audio_codecs_api", 167 "../api/audio_codecs/opus:audio_decoder_opus", 168 "../api/audio_codecs/opus:audio_encoder_opus", 169 "../api/crypto:frame_decryptor_interface", 170 "../api/rtc_event_log", 171 "../api/task_queue:default_task_queue_factory", 172 "../api/task_queue/test:mock_task_queue_base", 173 "../api/units:time_delta", 174 "../call:mock_bitrate_allocator", 175 "../call:mock_call_interfaces", 176 "../call:mock_rtp_interfaces", 177 "../call:rtp_interfaces", 178 "../call:rtp_receiver", 179 "../call:rtp_sender", 180 "../common_audio", 181 "../logging:mocks", 182 "../modules/audio_device:audio_device_impl", # For TestAudioDeviceModule 183 "../modules/audio_device:mock_audio_device", 184 "../modules/audio_mixer:audio_mixer_impl", 185 "../modules/audio_mixer:audio_mixer_test_utils", 186 "../modules/audio_processing:audio_processing_statistics", 187 "../modules/audio_processing:mocks", 188 "../modules/pacing", 189 "../modules/rtp_rtcp:mock_rtp_rtcp", 190 "../modules/rtp_rtcp:rtp_rtcp_format", 191 "../modules/utility:utility", 192 "../rtc_base:checks", 193 "../rtc_base:macromagic", 194 "../rtc_base:refcount", 195 "../rtc_base:rtc_base_tests_utils", 196 "../rtc_base:safe_compare", 197 "../rtc_base:task_queue_for_test", 198 "../rtc_base:timeutils", 199 "../system_wrappers", 200 "../test:audio_codec_mocks", 201 "../test:field_trial", 202 "../test:mock_frame_transformer", 203 "../test:mock_transformable_frame", 204 "../test:mock_transport", 205 "../test:rtp_test_utils", 206 "../test:scoped_key_value_config", 207 "../test:test_common", 208 "../test:test_support", 209 "../test/time_controller:time_controller", 210 "utility:utility_tests", 211 "//testing/gtest", 212 ] 213 } 214 215 if (rtc_enable_protobuf && !build_with_chromium) { 216 rtc_test("low_bandwidth_audio_test") { 217 testonly = true 218 219 sources = [ 220 "test/low_bandwidth_audio_test.cc", 221 "test/low_bandwidth_audio_test_flags.cc", 222 "test/pc_low_bandwidth_audio_test.cc", 223 ] 224 225 deps = [ 226 ":audio_end_to_end_test", 227 "../api:create_network_emulation_manager", 228 "../api:create_peerconnection_quality_test_fixture", 229 "../api:network_emulation_manager_api", 230 "../api:peer_connection_quality_test_fixture_api", 231 "../api:simulated_network_api", 232 "../api:time_controller", 233 "../api/test/metrics:chrome_perf_dashboard_metrics_exporter", 234 "../api/test/metrics:global_metrics_logger_and_exporter", 235 "../api/test/metrics:metrics_exporter", 236 "../api/test/metrics:stdout_metrics_exporter", 237 "../api/test/pclf:media_configuration", 238 "../api/test/pclf:media_quality_test_params", 239 "../api/test/pclf:peer_configurer", 240 "../call:simulated_network", 241 "../common_audio", 242 "../system_wrappers", 243 "../test:fileutils", 244 "../test:test_common", 245 "../test:test_main", 246 "../test:test_support", 247 "../test/pc/e2e:network_quality_metrics_reporter", 248 "//testing/gtest", 249 ] 250 absl_deps = [ 251 "//third_party/abseil-cpp/absl/flags:flag", 252 "//third_party/abseil-cpp/absl/strings", 253 ] 254 if (is_android) { 255 use_default_launcher = false 256 deps += [ 257 "//build/android/gtest_apk:native_test_instrumentation_test_runner_java", 258 "//testing/android/native_test:native_test_java", 259 "//testing/android/native_test:native_test_support", 260 ] 261 } 262 data = [ 263 "../resources/voice_engine/audio_tiny16.wav", 264 "../resources/voice_engine/audio_tiny48.wav", 265 ] 266 } 267 268 group("low_bandwidth_audio_perf_test") { 269 testonly = true 270 271 deps = [ 272 ":low_bandwidth_audio_test", 273 "//third_party/catapult/tracing/tracing/proto:histogram_proto", 274 "//third_party/protobuf:py_proto_runtime", 275 ] 276 277 data = [ 278 "test/low_bandwidth_audio_test.py", 279 "../resources/voice_engine/audio_tiny16.wav", 280 "../resources/voice_engine/audio_tiny48.wav", 281 "${root_out_dir}/pyproto/tracing/tracing/proto/histogram_pb2.py", 282 ] 283 284 # TODO(http://crbug.com/1029452): Create a cleaner target with just the 285 # tracing python code. We don't need Polymer for instance. 286 data_deps = [ "//third_party/catapult/tracing:convert_chart_json" ] 287 288 if (is_win) { 289 data += [ "${root_out_dir}/low_bandwidth_audio_test.exe" ] 290 } else { 291 data += [ "${root_out_dir}/low_bandwidth_audio_test" ] 292 } 293 294 if (is_linux || is_chromeos || is_android || is_fuchsia) { 295 data += [ 296 "../tools_webrtc/audio_quality/linux/PolqaOem64", 297 "../tools_webrtc/audio_quality/linux/pesq", 298 ] 299 } 300 if (is_win) { 301 data += [ 302 "../tools_webrtc/audio_quality/win/PolqaOem64.dll", 303 "../tools_webrtc/audio_quality/win/PolqaOem64.exe", 304 "../tools_webrtc/audio_quality/win/pesq.exe", 305 "../tools_webrtc/audio_quality/win/vcomp120.dll", 306 ] 307 } 308 if (is_mac) { 309 data += [ "../tools_webrtc/audio_quality/mac/pesq" ] 310 } 311 } 312 } 313 314 if (!build_with_chromium) { 315 rtc_library("audio_perf_tests") { 316 testonly = true 317 318 sources = [ 319 "test/audio_bwe_integration_test.cc", 320 "test/audio_bwe_integration_test.h", 321 ] 322 deps = [ 323 "../api:simulated_network_api", 324 "../api/task_queue", 325 "../call:fake_network", 326 "../call:simulated_network", 327 "../common_audio", 328 "../rtc_base:task_queue_for_test", 329 "../system_wrappers", 330 "../test:field_trial", 331 "../test:fileutils", 332 "../test:test_common", 333 "../test:test_main", 334 "../test:test_support", 335 "//testing/gtest", 336 ] 337 absl_deps = [ "//third_party/abseil-cpp/absl/functional:any_invocable" ] 338 data = [ "//resources/voice_engine/audio_dtx16.wav" ] 339 } 340 } 341} 342