blob: d3af836947e64db2312d3045e0be92d723d24076 [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 = [
17 "audio_receive_stream.cc",
18 "audio_receive_stream.h",
solenbergc7a8b082015-10-16 14:35:07 -070019 "audio_send_stream.cc",
20 "audio_send_stream.h",
solenberg566ef242015-11-06 15:34:49 -080021 "audio_state.cc",
22 "audio_state.h",
Fredrik Solenberg2a877972017-12-15 16:42:15 +010023 "audio_transport_impl.cc",
24 "audio_transport_impl.h",
Fredrik Solenberg4f4ec0a2015-10-22 10:49:27 +020025 "conversion.h",
henrika5f6bf242017-11-01 11:06:56 +010026 "null_audio_poller.cc",
27 "null_audio_poller.h",
sazac58f8c02017-07-19 00:39:19 -070028 "time_interval.cc",
29 "time_interval.h",
Peter Boström5c389d32015-09-25 13:58:30 +020030 ]
31
kjellandere40a7ee2016-10-16 23:56:12 -070032 if (!build_with_chromium && is_clang) {
33 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070034 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Peter Boström5c389d32015-09-25 13:58:30 +020035 }
36
37 deps = [
38 "..:webrtc_common",
aleloiaed581a2016-10-20 06:32:39 -070039 "../api:audio_mixer_api",
kjellander676e08f2016-12-07 08:23:27 -080040 "../api:call_api",
kwiberg84f6a3f2017-09-05 08:43:13 -070041 "../api:optional",
ossueb1fde42017-05-02 06:46:30 -070042 "../api/audio_codecs:audio_codecs_api",
43 "../api/audio_codecs:builtin_audio_encoder_factory",
Mirko Bonadei245660a2017-10-10 14:38:11 +020044 "../call:bitrate_allocator",
ossuf515ab82016-12-07 04:52:58 -080045 "../call:call_interfaces",
nissed76b7b22017-06-01 04:02:35 -070046 "../call:rtp_interfaces",
aleloi04c07222016-11-22 06:42:53 -080047 "../common_audio",
ossu20a4b3f2017-04-27 02:08:52 -070048 "../modules/audio_coding:cng",
aleloidd310712016-11-17 06:28:59 -080049 "../modules/audio_device",
50 "../modules/audio_processing",
stefan7de8d642017-02-07 07:14:08 -080051 "../modules/bitrate_controller:bitrate_controller",
kjellander676e08f2016-12-07 08:23:27 -080052 "../modules/congestion_controller:congestion_controller",
53 "../modules/pacing:pacing",
54 "../modules/remote_bitrate_estimator:remote_bitrate_estimator",
Mirko Bonadeib5728d92017-12-06 07:51:33 +010055 "../modules/rtp_rtcp",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010056 "../rtc_base:checks",
henrika5f6bf242017-11-01 11:06:56 +010057 "../rtc_base:rtc_base",
ehmaldonadof6a861a2017-07-19 10:40:47 -070058 "../rtc_base:rtc_base_approved",
59 "../rtc_base:rtc_task_queue",
Peter Boström5c389d32015-09-25 13:58:30 +020060 "../system_wrappers",
Alex Narestcedd3512017-12-07 20:54:55 +010061 "../system_wrappers:field_trial_api",
Tommif888bb52015-12-12 01:37:01 +010062 "../voice_engine",
Fredrik Solenberg2a877972017-12-15 16:42:15 +010063 "../voice_engine:audio_level",
64 "utility:audio_frame_operations",
Peter Boström5c389d32015-09-25 13:58:30 +020065 ]
66}
Peter Boström02083222016-06-14 12:52:54 +020067if (rtc_include_tests) {
Fredrik Solenberg73276ad2017-09-14 14:46:47 +020068 rtc_source_set("audio_end_to_end_test") {
69 testonly = true
70
71 sources = [
72 "test/audio_end_to_end_test.cc",
73 "test/audio_end_to_end_test.h",
74 ]
75 deps = [
76 ":audio",
77 "../system_wrappers:system_wrappers",
78 "../test:fake_audio_device",
79 "../test:test_common",
80 "../test:test_support",
81 ]
82
83 if (!build_with_chromium && is_clang) {
84 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
85 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
86 }
87 }
88
ehmaldonado38a21322016-09-02 04:10:34 -070089 rtc_source_set("audio_tests") {
Peter Boström02083222016-06-14 12:52:54 +020090 testonly = true
kjellander676e08f2016-12-07 08:23:27 -080091
Peter Boström02083222016-06-14 12:52:54 +020092 sources = [
93 "audio_receive_stream_unittest.cc",
solenberg18f54272017-09-15 09:56:08 -070094 "audio_send_stream_tests.cc",
Peter Boström02083222016-06-14 12:52:54 +020095 "audio_send_stream_unittest.cc",
96 "audio_state_unittest.cc",
sazac58f8c02017-07-19 00:39:19 -070097 "time_interval_unittest.cc",
Peter Boström02083222016-06-14 12:52:54 +020098 ]
99 deps = [
100 ":audio",
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200101 ":audio_end_to_end_test",
aleloi04c07222016-11-22 06:42:53 -0800102 "../api:mock_audio_mixer",
Fredrik Solenberg2a877972017-12-15 16:42:15 +0100103 "../call:mock_call_interfaces",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100104 "../call:mock_rtp_interfaces",
105 "../call:rtp_interfaces",
nisse0f15f922017-06-21 01:05:22 -0700106 "../call:rtp_receiver",
Patrik Höglund731082c2018-01-03 09:08:20 +0100107 "../logging:mocks",
aleloidd310712016-11-17 06:28:59 -0800108 "../modules/audio_device:mock_audio_device",
aleloi04c07222016-11-22 06:42:53 -0800109 "../modules/audio_mixer:audio_mixer_impl",
Ivo Creusen56d46092017-11-24 17:29:59 +0100110 "../modules/audio_processing:audio_processing_statistics",
Patrik Höglund62139292017-12-19 16:44:45 +0100111 "../modules/audio_processing:mocks",
Patrik Höglund94dc1772018-01-02 14:20:17 +0100112 "../modules/bitrate_controller:mocks",
kjellander676e08f2016-12-07 08:23:27 -0800113 "../modules/congestion_controller:congestion_controller",
zstein7cb69d52017-05-08 11:52:38 -0700114 "../modules/congestion_controller:mock_congestion_controller",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100115 "../modules/pacing:mock_paced_sender",
kjellander676e08f2016-12-07 08:23:27 -0800116 "../modules/pacing:pacing",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100117 "../modules/rtp_rtcp:mock_rtp_rtcp",
118 "../modules/rtp_rtcp:rtp_rtcp_format",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700119 "../rtc_base:rtc_base_approved",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100120 "../rtc_base:rtc_base_tests_utils",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700121 "../rtc_base:rtc_task_queue",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100122 "../rtc_base:safe_compare",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100123 "../system_wrappers:system_wrappers",
124 "../test:audio_codec_mocks",
125 "../test:rtp_test_utils",
aleloi10111bc2016-11-17 06:48:48 -0800126 "../test:test_common",
aleloi6321b492016-12-05 01:46:09 -0800127 "../test:test_support",
Patrik Höglundc0e68042017-11-13 17:04:05 +0100128 "../voice_engine",
ehmaldonado894c2bb2017-01-05 06:03:24 -0800129 "utility:utility_tests",
Peter Boström02083222016-06-14 12:52:54 +0200130 "//testing/gmock",
131 "//testing/gtest",
132 ]
oprypin5e1ca782017-03-20 02:06:18 -0700133
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200134 if (!rtc_use_memcheck) {
135 # This test is timing dependent, which rules out running on memcheck bots.
136 sources += [ "test/audio_stats_test.cc" ]
137 }
138
kjellandere40a7ee2016-10-16 23:56:12 -0700139 if (!build_with_chromium && is_clang) {
140 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700141 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
Peter Boström02083222016-06-14 12:52:54 +0200142 }
143 }
kjellander8f8d1a02017-03-06 04:01:16 -0800144
145 if (rtc_enable_protobuf) {
oprypin6d305ba2017-03-30 04:01:30 -0700146 rtc_test("low_bandwidth_audio_test") {
kjellander8f8d1a02017-03-06 04:01:16 -0800147 testonly = true
148
149 sources = [
150 "test/low_bandwidth_audio_test.cc",
151 ]
152
oprypin92220ff2017-03-23 03:40:03 -0700153 deps = [
Fredrik Solenberg73276ad2017-09-14 14:46:47 +0200154 ":audio_end_to_end_test",
oprypin92220ff2017-03-23 03:40:03 -0700155 "../common_audio",
oprypin9b2f20c2017-08-29 05:51:57 -0700156 "../rtc_base:rtc_base_approved",
oprypin92220ff2017-03-23 03:40:03 -0700157 "../system_wrappers",
158 "../test:fake_audio_device",
oprypin92220ff2017-03-23 03:40:03 -0700159 "../test:test_common",
160 "../test:test_main",
tschumim9d117642017-07-17 01:41:41 -0700161 "//testing/gmock",
162 "//testing/gtest",
oprypin92220ff2017-03-23 03:40:03 -0700163 ]
kjellander8f8d1a02017-03-06 04:01:16 -0800164 if (is_android) {
oprypin92220ff2017-03-23 03:40:03 -0700165 deps += [ "//testing/android/native_test:native_test_native_code" ]
166 }
167
168 data = [
Edward Lemur20110752017-09-28 16:14:37 +0200169 "../resources/voice_engine/audio_dtx16.wav",
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200170 "../resources/voice_engine/audio_tiny16.wav",
171 "../resources/voice_engine/audio_tiny48.wav",
Edward Lemur20110752017-09-28 16:14:37 +0200172 "test/low_bandwidth_audio_test.py",
oprypin92220ff2017-03-23 03:40:03 -0700173 ]
Edward Lemur98d40362018-01-15 17:37:04 +0100174 if (is_linux || is_android) {
Edward Lemur20110752017-09-28 16:14:37 +0200175 data += [
176 "../tools_webrtc/audio_quality/linux/PolqaOem64",
177 "../tools_webrtc/audio_quality/linux/pesq",
178 ]
179 }
180 if (is_win) {
181 data += [
182 "../tools_webrtc/audio_quality/win/PolqaOem64.dll",
183 "../tools_webrtc/audio_quality/win/PolqaOem64.exe",
184 "../tools_webrtc/audio_quality/win/pesq.exe",
185 "../tools_webrtc/audio_quality/win/vcomp120.dll",
186 ]
187 }
188 if (is_mac) {
189 data += [ "../tools_webrtc/audio_quality/mac/pesq" ]
190 }
oprypin92220ff2017-03-23 03:40:03 -0700191
192 if (!build_with_chromium && is_clang) {
193 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163)
194 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander8f8d1a02017-03-06 04:01:16 -0800195 }
196 }
197 }
tschumim9d117642017-07-17 01:41:41 -0700198
199 rtc_source_set("audio_perf_tests") {
200 testonly = true
201
tschumim9d117642017-07-17 01:41:41 -0700202 sources = [
203 "test/audio_bwe_integration_test.cc",
204 "test/audio_bwe_integration_test.h",
205 ]
206 deps = [
tschumim9d117642017-07-17 01:41:41 -0700207 "../common_audio",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700208 "../rtc_base:rtc_base_approved",
tschumim9d117642017-07-17 01:41:41 -0700209 "../system_wrappers",
210 "../test:fake_audio_device",
211 "../test:field_trial",
eladalon413ee9a2017-08-22 04:02:52 -0700212 "../test:single_threaded_task_queue",
tschumim9d117642017-07-17 01:41:41 -0700213 "../test:test_common",
214 "../test:test_main",
215 "//testing/gmock",
216 "//testing/gtest",
tschumim9d117642017-07-17 01:41:41 -0700217 ]
218
219 data = [
220 "//resources/voice_engine/audio_dtx16.wav",
221 ]
222
223 if (!build_with_chromium && is_clang) {
224 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
225 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
226 }
227 }
Peter Boström02083222016-06-14 12:52:54 +0200228}