blob: 39a6697c8e0aab2b19a826ea71b2b7e237e393a0 [file] [log] [blame]
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +00001# Copyright (c) 2014 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")
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000010
kwiberg97744472017-01-10 01:12:51 -080011rtc_static_library("audio_coder") {
12 sources = [
13 "coder.cc",
14 "coder.h",
15 ]
16 deps = [
17 "..:webrtc_common",
kwiberg087bd342017-02-10 08:15:44 -080018 "../api/audio_codecs:builtin_audio_decoder_factory",
kwiberg97744472017-01-10 01:12:51 -080019 "../modules/audio_coding",
20 "../modules/audio_coding:audio_format_conversion",
kwiberg97744472017-01-10 01:12:51 -080021 "../modules/audio_coding:rent_a_codec",
22 ]
23
24 if (!build_with_chromium && is_clang) {
25 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
26 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
27 }
28}
29
30rtc_static_library("file_player") {
31 sources = [
32 "file_player.cc",
33 "file_player.h",
34 ]
35 deps = [
36 ":audio_coder",
37 "..:webrtc_common",
38 "../common_audio",
39 "../modules/media_file",
40 "../system_wrappers",
41 ]
42
43 if (!build_with_chromium && is_clang) {
44 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
45 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
46 }
47}
48
49rtc_static_library("file_recorder") {
50 sources = [
51 "file_recorder.cc",
52 "file_recorder.h",
53 ]
54 deps = [
55 ":audio_coder",
56 "..:webrtc_common",
57 "../base:rtc_base_approved",
58 "../common_audio",
59 "../modules/media_file:media_file",
60 "../system_wrappers",
61 ]
62
63 if (!build_with_chromium && is_clang) {
64 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
65 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
66 }
67}
68
kjellanderb62dbbe2016-09-23 00:38:52 -070069rtc_static_library("voice_engine") {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000070 sources = [
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020071 "channel.cc",
72 "channel.h",
73 "channel_manager.cc",
74 "channel_manager.h",
solenberg13725082015-11-25 08:16:52 -080075 "channel_proxy.cc",
76 "channel_proxy.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000077 "include/voe_audio_processing.h",
78 "include/voe_base.h",
79 "include/voe_codec.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000080 "include/voe_errors.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000081 "include/voe_file.h",
82 "include/voe_hardware.h",
83 "include/voe_neteq_stats.h",
84 "include/voe_network.h",
85 "include/voe_rtp_rtcp.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000086 "include/voe_volume_control.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000087 "monitor_module.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000088 "output_mixer.cc",
89 "output_mixer.h",
90 "shared_data.cc",
91 "shared_data.h",
92 "statistics.cc",
93 "statistics.h",
94 "transmit_mixer.cc",
95 "transmit_mixer.h",
minyue435ddf92017-01-23 08:07:05 -080096 "transport_feedback_packet_loss_tracker.cc",
97 "transport_feedback_packet_loss_tracker.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000098 "utility.cc",
99 "utility.h",
100 "voe_audio_processing_impl.cc",
101 "voe_audio_processing_impl.h",
102 "voe_base_impl.cc",
103 "voe_base_impl.h",
104 "voe_codec_impl.cc",
105 "voe_codec_impl.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000106 "voe_file_impl.cc",
107 "voe_file_impl.h",
108 "voe_hardware_impl.cc",
109 "voe_hardware_impl.h",
110 "voe_neteq_stats_impl.cc",
111 "voe_neteq_stats_impl.h",
112 "voe_network_impl.cc",
113 "voe_network_impl.h",
114 "voe_rtp_rtcp_impl.cc",
115 "voe_rtp_rtcp_impl.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000116 "voe_volume_control_impl.cc",
117 "voe_volume_control_impl.h",
118 "voice_engine_defines.h",
119 "voice_engine_impl.cc",
120 "voice_engine_impl.h",
121 ]
122
123 if (is_win) {
124 defines = [ "WEBRTC_DRIFT_COMPENSATION_SUPPORTED" ]
kjellander@webrtc.org8649fed2015-01-08 21:22:01 +0000125
126 cflags = [
127 # TODO(kjellander): Bug 261: fix this warning.
ossua16f7a82016-07-08 02:12:55 -0700128 "/wd4373", # Virtual function override.
kjellander@webrtc.org8649fed2015-01-08 21:22:01 +0000129 ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000130 }
131
kjellandere40a7ee2016-10-16 23:56:12 -0700132 if (!build_with_chromium && is_clang) {
133 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700134 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000135 }
136
ehmaldonado53cec042016-09-09 05:32:14 -0700137 public_deps = [
138 "../modules/audio_coding",
139 ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000140 deps = [
kwiberg97744472017-01-10 01:12:51 -0800141 ":file_player",
142 ":file_recorder",
aleloie6ca9ec2016-08-10 05:01:51 -0700143 ":level_indicator",
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000144 "..:webrtc_common",
aleloiaed581a2016-10-20 06:32:39 -0700145 "../api:audio_mixer_api",
kjellandera69d9732016-08-31 07:33:05 -0700146 "../api:call_api",
aleloia8eb7562016-11-28 07:02:13 -0800147 "../api:transport_api",
kwiberg087bd342017-02-10 08:15:44 -0800148 "../api/audio_codecs:audio_codecs_api",
149 "../api/audio_codecs:builtin_audio_decoder_factory",
aleloi6321b492016-12-05 01:46:09 -0800150 "../audio/utility:audio_frame_operations",
kjellander@webrtc.org7ffeab52016-02-26 22:46:09 +0100151 "../base:rtc_base_approved",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000152 "../common_audio",
skvladcc91d282016-10-03 18:31:22 -0700153 "../logging:rtc_event_log_api",
kwibergda2bf4e2016-10-24 13:47:09 -0700154 "../modules/audio_coding:audio_format_conversion",
aleloi9ae585d2016-10-13 06:57:16 -0700155 "../modules/audio_coding:rent_a_codec",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000156 "../modules/audio_conference_mixer",
157 "../modules/audio_device",
158 "../modules/audio_processing",
159 "../modules/bitrate_controller",
160 "../modules/media_file",
Stefan Holmerb86d4e42015-12-07 10:26:18 +0100161 "../modules/pacing",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000162 "../modules/rtp_rtcp",
163 "../modules/utility",
164 "../system_wrappers",
165 ]
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000166}
ossua16f7a82016-07-08 02:12:55 -0700167
kjellanderb62dbbe2016-09-23 00:38:52 -0700168rtc_static_library("level_indicator") {
aleloie6ca9ec2016-08-10 05:01:51 -0700169 sources = [
170 "level_indicator.cc",
171 "level_indicator.h",
172 ]
173
aleloie6ca9ec2016-08-10 05:01:51 -0700174 deps = [
175 "..:webrtc_common",
176 "../base:rtc_base_approved",
177 "../common_audio",
178 ]
179}
180
ossua16f7a82016-07-08 02:12:55 -0700181if (rtc_include_tests) {
solenbergba56b6c2016-09-13 07:29:12 -0700182 config("channel_transport_warnings_config") {
183 if (is_win) {
184 cflags = [ "/wd4302" ] # cast truncation
185
186 if (is_clang) {
187 # GN orders flags on a target before flags from configs. The default
188 # config adds -Wall, and this flag have to be after -Wall -- so they need
189 # to come from a config and cannot be on the target directly.
190 cflags += [
191 "-Wno-parentheses-equality",
192 "-Wno-reorder",
193 "-Wno-tautological-constant-out-of-range-compare",
194
195 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6268
196 # for -Wno-thread-safety-analysis
197 "-Wno-thread-safety-analysis",
198 "-Wno-unused-private-field",
199 ]
200 }
201 }
202 }
203
kjellanderb62dbbe2016-09-23 00:38:52 -0700204 rtc_static_library("channel_transport") {
solenbergba56b6c2016-09-13 07:29:12 -0700205 testonly = true
206 sources = [
207 "test/channel_transport/channel_transport.cc",
208 "test/channel_transport/channel_transport.h",
209 "test/channel_transport/traffic_control_win.cc",
210 "test/channel_transport/traffic_control_win.h",
211 "test/channel_transport/udp_socket2_manager_win.cc",
212 "test/channel_transport/udp_socket2_manager_win.h",
213 "test/channel_transport/udp_socket2_win.cc",
214 "test/channel_transport/udp_socket2_win.h",
215 "test/channel_transport/udp_socket_manager_posix.cc",
216 "test/channel_transport/udp_socket_manager_posix.h",
217 "test/channel_transport/udp_socket_manager_wrapper.cc",
218 "test/channel_transport/udp_socket_manager_wrapper.h",
219 "test/channel_transport/udp_socket_posix.cc",
220 "test/channel_transport/udp_socket_posix.h",
221 "test/channel_transport/udp_socket_wrapper.cc",
222 "test/channel_transport/udp_socket_wrapper.h",
223 "test/channel_transport/udp_transport.h",
224 "test/channel_transport/udp_transport_impl.cc",
225 "test/channel_transport/udp_transport_impl.h",
226 ]
227
228 configs += [ ":channel_transport_warnings_config" ]
229
kjellandere40a7ee2016-10-16 23:56:12 -0700230 if (!build_with_chromium && is_clang) {
231 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
solenbergba56b6c2016-09-13 07:29:12 -0700232 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
233 }
234
235 deps = [
236 "..:webrtc_common",
aleloia8eb7562016-11-28 07:02:13 -0800237 "../api:transport_api",
solenbergba56b6c2016-09-13 07:29:12 -0700238 "../system_wrappers",
239 "//testing/gtest",
240 ]
241 }
242
ehmaldonado38a21322016-09-02 04:10:34 -0700243 rtc_test("voice_engine_unittests") {
ossua16f7a82016-07-08 02:12:55 -0700244 deps = [
solenbergba56b6c2016-09-13 07:29:12 -0700245 ":channel_transport",
ossua16f7a82016-07-08 02:12:55 -0700246 ":voice_engine",
247 "//testing/gmock",
248 "//testing/gtest",
kwiberg97744472017-01-10 01:12:51 -0800249 "//third_party/gflags",
ossua16f7a82016-07-08 02:12:55 -0700250 "//webrtc/common_audio",
251 "//webrtc/modules/audio_coding",
252 "//webrtc/modules/audio_conference_mixer",
253 "//webrtc/modules/audio_device",
254 "//webrtc/modules/audio_processing",
255 "//webrtc/modules/media_file",
256 "//webrtc/modules/rtp_rtcp",
solenberg71b9b582016-11-25 11:45:05 -0800257 "//webrtc/modules/utility",
ossua16f7a82016-07-08 02:12:55 -0700258 "//webrtc/system_wrappers",
ehmaldonado26bddb92016-11-30 06:12:01 -0800259 "//webrtc/test:test_main",
ossua16f7a82016-07-08 02:12:55 -0700260 ]
261
262 if (is_android) {
263 deps += [ "//testing/android/native_test:native_test_native_code" ]
sakal714dd4e2016-08-15 02:29:11 -0700264 shard_timeout = 900
ossua16f7a82016-07-08 02:12:55 -0700265 }
266
267 sources = [
268 "channel_unittest.cc",
kwiberg97744472017-01-10 01:12:51 -0800269 "file_player_unittests.cc",
solenbergba56b6c2016-09-13 07:29:12 -0700270 "test/channel_transport/udp_socket_manager_unittest.cc",
271 "test/channel_transport/udp_socket_wrapper_unittest.cc",
272 "test/channel_transport/udp_transport_unittest.cc",
minyue435ddf92017-01-23 08:07:05 -0800273 "transport_feedback_packet_loss_tracker_unittest.cc",
ossua16f7a82016-07-08 02:12:55 -0700274 "utility_unittest.cc",
275 "voe_audio_processing_unittest.cc",
276 "voe_base_unittest.cc",
277 "voe_codec_unittest.cc",
278 "voe_network_unittest.cc",
279 "voice_engine_fixture.cc",
280 "voice_engine_fixture.h",
281 ]
282
kwiberg97744472017-01-10 01:12:51 -0800283 data = [
284 "//resources/utility/encapsulated_pcm16b_8khz.wav",
285 "//resources/utility/encapsulated_pcmu_8khz.wav",
286 ]
287
ossua16f7a82016-07-08 02:12:55 -0700288 if (is_win) {
289 defines = [ "WEBRTC_DRIFT_COMPENSATION_SUPPORTED" ]
290
291 cflags = [
292 # TODO(kjellander): Bug 261: fix this warning.
293 "/wd4373", # Virtual function override.
294 ]
295 }
296
kjellandere40a7ee2016-10-16 23:56:12 -0700297 if (!build_with_chromium && is_clang) {
298 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700299 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
ossua16f7a82016-07-08 02:12:55 -0700300 }
301 }
302
solenbergfb2c1d02016-09-15 13:12:02 -0700303 rtc_executable("voe_cmd_test") {
304 testonly = true
305
306 deps = [
307 ":channel_transport",
308 ":voice_engine",
309 "//testing/gtest",
310 "//third_party/gflags",
skvladcc91d282016-10-03 18:31:22 -0700311 "//webrtc/logging:rtc_event_log_api",
solenbergfb2c1d02016-09-15 13:12:02 -0700312 "//webrtc/system_wrappers",
313 "//webrtc/system_wrappers:system_wrappers_default",
314 "//webrtc/test:test_support",
315 ]
316
317 sources = [
318 "test/cmd_test/voe_cmd_test.cc",
319 ]
320
kjellandere40a7ee2016-10-16 23:56:12 -0700321 if (!build_with_chromium && is_clang) {
322 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
solenbergfb2c1d02016-09-15 13:12:02 -0700323 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
324 }
325 }
326
ossua16f7a82016-07-08 02:12:55 -0700327 if (!is_ios) {
ehmaldonado38a21322016-09-02 04:10:34 -0700328 rtc_executable("voe_auto_test") {
ossua16f7a82016-07-08 02:12:55 -0700329 testonly = true
330
331 deps = [
solenbergba56b6c2016-09-13 07:29:12 -0700332 ":channel_transport",
ossua16f7a82016-07-08 02:12:55 -0700333 ":voice_engine",
334 "//testing/gmock",
335 "//testing/gtest",
336 "//third_party/gflags",
skvladcc91d282016-10-03 18:31:22 -0700337 "//webrtc/logging:rtc_event_log_api",
ossua16f7a82016-07-08 02:12:55 -0700338 "//webrtc/modules/video_capture",
339 "//webrtc/system_wrappers",
340 "//webrtc/system_wrappers/:system_wrappers_default",
ossua16f7a82016-07-08 02:12:55 -0700341 "//webrtc/test/:test_common",
342 "//webrtc/test/:test_support",
ehmaldonado656610f2017-02-06 02:21:11 -0800343 "//webrtc/test/:video_test_common",
ossua16f7a82016-07-08 02:12:55 -0700344 ]
345
346 sources = [
347 "test/auto_test/automated_mode.cc",
348 "test/auto_test/extended/agc_config_test.cc",
349 "test/auto_test/extended/ec_metrics_test.cc",
350 "test/auto_test/fakes/conference_transport.cc",
351 "test/auto_test/fakes/conference_transport.h",
352 "test/auto_test/fakes/loudest_filter.cc",
353 "test/auto_test/fakes/loudest_filter.h",
354 "test/auto_test/fixtures/after_initialization_fixture.cc",
355 "test/auto_test/fixtures/after_initialization_fixture.h",
356 "test/auto_test/fixtures/after_streaming_fixture.cc",
357 "test/auto_test/fixtures/after_streaming_fixture.h",
358 "test/auto_test/fixtures/before_initialization_fixture.cc",
359 "test/auto_test/fixtures/before_initialization_fixture.h",
360 "test/auto_test/fixtures/before_streaming_fixture.cc",
361 "test/auto_test/fixtures/before_streaming_fixture.h",
ossua16f7a82016-07-08 02:12:55 -0700362 "test/auto_test/standard/audio_processing_test.cc",
363 "test/auto_test/standard/codec_before_streaming_test.cc",
364 "test/auto_test/standard/codec_test.cc",
365 "test/auto_test/standard/dtmf_test.cc",
ossua16f7a82016-07-08 02:12:55 -0700366 "test/auto_test/standard/file_before_streaming_test.cc",
367 "test/auto_test/standard/file_test.cc",
368 "test/auto_test/standard/hardware_before_initializing_test.cc",
369 "test/auto_test/standard/hardware_test.cc",
370 "test/auto_test/standard/mixing_test.cc",
371 "test/auto_test/standard/neteq_stats_test.cc",
372 "test/auto_test/standard/rtp_rtcp_before_streaming_test.cc",
373 "test/auto_test/standard/rtp_rtcp_extensions.cc",
374 "test/auto_test/standard/rtp_rtcp_test.cc",
ossua16f7a82016-07-08 02:12:55 -0700375 "test/auto_test/standard/voe_base_misc_test.cc",
376 "test/auto_test/standard/volume_test.cc",
377 "test/auto_test/voe_conference_test.cc",
ossua16f7a82016-07-08 02:12:55 -0700378 "test/auto_test/voe_standard_test.cc",
379 "test/auto_test/voe_standard_test.h",
ossua16f7a82016-07-08 02:12:55 -0700380 "test/auto_test/voe_test_defines.h",
381 "test/auto_test/voe_test_interface.h",
382 ]
383
384 if (!is_android) {
385 # Some tests are not supported on android yet, exclude these tests.
386 sources +=
387 [ "test/auto_test/standard/hardware_before_streaming_test.cc" ]
388 }
389
390 defines = []
391
392 if (rtc_enable_protobuf) {
393 defines = [ "ENABLE_RTC_EVENT_LOG" ]
394 }
395
396 if (is_win) {
397 defines += [ "WEBRTC_DRIFT_COMPENSATION_SUPPORTED" ]
398
399 cflags = [
400 "/wd4267", # size_t to int truncation.
401 "/wd4373", # Virtual function override.
402 # TODO(kjellander): Bug 261: fix this warning.
403 ]
404 }
405
kjellandere40a7ee2016-10-16 23:56:12 -0700406 if (!build_with_chromium && is_clang) {
407 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700408 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
ossua16f7a82016-07-08 02:12:55 -0700409 }
410 }
411 }
412}