blob: 0591999def5d20ab6bf3e9acde633515b2c1e58b [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
9import("../build/webrtc.gni")
10
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",
18 "../modules/audio_coding",
19 "../modules/audio_coding:audio_format_conversion",
20 "../modules/audio_coding:builtin_audio_decoder_factory",
21 "../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",
81 "include/voe_external_media.h",
82 "include/voe_file.h",
83 "include/voe_hardware.h",
84 "include/voe_neteq_stats.h",
85 "include/voe_network.h",
86 "include/voe_rtp_rtcp.h",
87 "include/voe_video_sync.h",
88 "include/voe_volume_control.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000089 "monitor_module.cc",
90 "monitor_module.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000091 "output_mixer.cc",
92 "output_mixer.h",
93 "shared_data.cc",
94 "shared_data.h",
95 "statistics.cc",
96 "statistics.h",
97 "transmit_mixer.cc",
98 "transmit_mixer.h",
99 "utility.cc",
100 "utility.h",
101 "voe_audio_processing_impl.cc",
102 "voe_audio_processing_impl.h",
103 "voe_base_impl.cc",
104 "voe_base_impl.h",
105 "voe_codec_impl.cc",
106 "voe_codec_impl.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000107 "voe_external_media_impl.cc",
108 "voe_external_media_impl.h",
109 "voe_file_impl.cc",
110 "voe_file_impl.h",
111 "voe_hardware_impl.cc",
112 "voe_hardware_impl.h",
113 "voe_neteq_stats_impl.cc",
114 "voe_neteq_stats_impl.h",
115 "voe_network_impl.cc",
116 "voe_network_impl.h",
117 "voe_rtp_rtcp_impl.cc",
118 "voe_rtp_rtcp_impl.h",
119 "voe_video_sync_impl.cc",
120 "voe_video_sync_impl.h",
121 "voe_volume_control_impl.cc",
122 "voe_volume_control_impl.h",
123 "voice_engine_defines.h",
124 "voice_engine_impl.cc",
125 "voice_engine_impl.h",
126 ]
127
128 if (is_win) {
129 defines = [ "WEBRTC_DRIFT_COMPENSATION_SUPPORTED" ]
kjellander@webrtc.org8649fed2015-01-08 21:22:01 +0000130
131 cflags = [
132 # TODO(kjellander): Bug 261: fix this warning.
ossua16f7a82016-07-08 02:12:55 -0700133 "/wd4373", # Virtual function override.
kjellander@webrtc.org8649fed2015-01-08 21:22:01 +0000134 ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000135 }
136
kjellandere40a7ee2016-10-16 23:56:12 -0700137 if (!build_with_chromium && is_clang) {
138 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700139 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000140 }
141
ehmaldonado53cec042016-09-09 05:32:14 -0700142 public_deps = [
143 "../modules/audio_coding",
144 ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000145 deps = [
kwiberg97744472017-01-10 01:12:51 -0800146 ":file_player",
147 ":file_recorder",
aleloie6ca9ec2016-08-10 05:01:51 -0700148 ":level_indicator",
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000149 "..:webrtc_common",
aleloiaed581a2016-10-20 06:32:39 -0700150 "../api:audio_mixer_api",
kjellandera69d9732016-08-31 07:33:05 -0700151 "../api:call_api",
aleloia8eb7562016-11-28 07:02:13 -0800152 "../api:transport_api",
aleloi6321b492016-12-05 01:46:09 -0800153 "../audio/utility:audio_frame_operations",
kjellander@webrtc.org7ffeab52016-02-26 22:46:09 +0100154 "../base:rtc_base_approved",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000155 "../common_audio",
skvladcc91d282016-10-03 18:31:22 -0700156 "../logging:rtc_event_log_api",
aleloi9ae585d2016-10-13 06:57:16 -0700157 "../modules/audio_coding:audio_decoder_factory_interface",
kwibergda2bf4e2016-10-24 13:47:09 -0700158 "../modules/audio_coding:audio_format_conversion",
aleloi9ae585d2016-10-13 06:57:16 -0700159 "../modules/audio_coding:builtin_audio_decoder_factory",
160 "../modules/audio_coding:rent_a_codec",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000161 "../modules/audio_conference_mixer",
162 "../modules/audio_device",
163 "../modules/audio_processing",
164 "../modules/bitrate_controller",
165 "../modules/media_file",
Stefan Holmerb86d4e42015-12-07 10:26:18 +0100166 "../modules/pacing",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000167 "../modules/rtp_rtcp",
168 "../modules/utility",
169 "../system_wrappers",
170 ]
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000171}
ossua16f7a82016-07-08 02:12:55 -0700172
kjellanderb62dbbe2016-09-23 00:38:52 -0700173rtc_static_library("level_indicator") {
aleloie6ca9ec2016-08-10 05:01:51 -0700174 sources = [
175 "level_indicator.cc",
176 "level_indicator.h",
177 ]
178
aleloie6ca9ec2016-08-10 05:01:51 -0700179 deps = [
180 "..:webrtc_common",
181 "../base:rtc_base_approved",
182 "../common_audio",
183 ]
184}
185
ossua16f7a82016-07-08 02:12:55 -0700186if (rtc_include_tests) {
solenbergba56b6c2016-09-13 07:29:12 -0700187 config("channel_transport_warnings_config") {
188 if (is_win) {
189 cflags = [ "/wd4302" ] # cast truncation
190
191 if (is_clang) {
192 # GN orders flags on a target before flags from configs. The default
193 # config adds -Wall, and this flag have to be after -Wall -- so they need
194 # to come from a config and cannot be on the target directly.
195 cflags += [
196 "-Wno-parentheses-equality",
197 "-Wno-reorder",
198 "-Wno-tautological-constant-out-of-range-compare",
199
200 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6268
201 # for -Wno-thread-safety-analysis
202 "-Wno-thread-safety-analysis",
203 "-Wno-unused-private-field",
204 ]
205 }
206 }
207 }
208
kjellanderb62dbbe2016-09-23 00:38:52 -0700209 rtc_static_library("channel_transport") {
solenbergba56b6c2016-09-13 07:29:12 -0700210 testonly = true
211 sources = [
212 "test/channel_transport/channel_transport.cc",
213 "test/channel_transport/channel_transport.h",
214 "test/channel_transport/traffic_control_win.cc",
215 "test/channel_transport/traffic_control_win.h",
216 "test/channel_transport/udp_socket2_manager_win.cc",
217 "test/channel_transport/udp_socket2_manager_win.h",
218 "test/channel_transport/udp_socket2_win.cc",
219 "test/channel_transport/udp_socket2_win.h",
220 "test/channel_transport/udp_socket_manager_posix.cc",
221 "test/channel_transport/udp_socket_manager_posix.h",
222 "test/channel_transport/udp_socket_manager_wrapper.cc",
223 "test/channel_transport/udp_socket_manager_wrapper.h",
224 "test/channel_transport/udp_socket_posix.cc",
225 "test/channel_transport/udp_socket_posix.h",
226 "test/channel_transport/udp_socket_wrapper.cc",
227 "test/channel_transport/udp_socket_wrapper.h",
228 "test/channel_transport/udp_transport.h",
229 "test/channel_transport/udp_transport_impl.cc",
230 "test/channel_transport/udp_transport_impl.h",
231 ]
232
233 configs += [ ":channel_transport_warnings_config" ]
234
kjellandere40a7ee2016-10-16 23:56:12 -0700235 if (!build_with_chromium && is_clang) {
236 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
solenbergba56b6c2016-09-13 07:29:12 -0700237 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
238 }
239
240 deps = [
241 "..:webrtc_common",
aleloia8eb7562016-11-28 07:02:13 -0800242 "../api:transport_api",
solenbergba56b6c2016-09-13 07:29:12 -0700243 "../system_wrappers",
244 "//testing/gtest",
245 ]
246 }
247
ehmaldonado38a21322016-09-02 04:10:34 -0700248 rtc_test("voice_engine_unittests") {
ossua16f7a82016-07-08 02:12:55 -0700249 deps = [
solenbergba56b6c2016-09-13 07:29:12 -0700250 ":channel_transport",
ossua16f7a82016-07-08 02:12:55 -0700251 ":voice_engine",
252 "//testing/gmock",
253 "//testing/gtest",
kwiberg97744472017-01-10 01:12:51 -0800254 "//third_party/gflags",
ossua16f7a82016-07-08 02:12:55 -0700255 "//webrtc/common_audio",
256 "//webrtc/modules/audio_coding",
257 "//webrtc/modules/audio_conference_mixer",
258 "//webrtc/modules/audio_device",
259 "//webrtc/modules/audio_processing",
260 "//webrtc/modules/media_file",
261 "//webrtc/modules/rtp_rtcp",
solenberg71b9b582016-11-25 11:45:05 -0800262 "//webrtc/modules/utility",
ossua16f7a82016-07-08 02:12:55 -0700263 "//webrtc/system_wrappers",
ehmaldonado26bddb92016-11-30 06:12:01 -0800264 "//webrtc/test:test_main",
ossua16f7a82016-07-08 02:12:55 -0700265 ]
266
267 if (is_android) {
268 deps += [ "//testing/android/native_test:native_test_native_code" ]
sakal714dd4e2016-08-15 02:29:11 -0700269 shard_timeout = 900
ossua16f7a82016-07-08 02:12:55 -0700270 }
271
272 sources = [
273 "channel_unittest.cc",
kwiberg97744472017-01-10 01:12:51 -0800274 "file_player_unittests.cc",
solenbergba56b6c2016-09-13 07:29:12 -0700275 "test/channel_transport/udp_socket_manager_unittest.cc",
276 "test/channel_transport/udp_socket_wrapper_unittest.cc",
277 "test/channel_transport/udp_transport_unittest.cc",
ossua16f7a82016-07-08 02:12:55 -0700278 "transmit_mixer_unittest.cc",
279 "utility_unittest.cc",
280 "voe_audio_processing_unittest.cc",
281 "voe_base_unittest.cc",
282 "voe_codec_unittest.cc",
283 "voe_network_unittest.cc",
284 "voice_engine_fixture.cc",
285 "voice_engine_fixture.h",
286 ]
287
kwiberg97744472017-01-10 01:12:51 -0800288 data = [
289 "//resources/utility/encapsulated_pcm16b_8khz.wav",
290 "//resources/utility/encapsulated_pcmu_8khz.wav",
291 ]
292
ossua16f7a82016-07-08 02:12:55 -0700293 if (is_win) {
294 defines = [ "WEBRTC_DRIFT_COMPENSATION_SUPPORTED" ]
295
296 cflags = [
297 # TODO(kjellander): Bug 261: fix this warning.
298 "/wd4373", # Virtual function override.
299 ]
300 }
301
kjellandere40a7ee2016-10-16 23:56:12 -0700302 if (!build_with_chromium && is_clang) {
303 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700304 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
ossua16f7a82016-07-08 02:12:55 -0700305 }
306 }
307
solenbergfb2c1d02016-09-15 13:12:02 -0700308 rtc_executable("voe_cmd_test") {
309 testonly = true
310
311 deps = [
312 ":channel_transport",
313 ":voice_engine",
314 "//testing/gtest",
315 "//third_party/gflags",
skvladcc91d282016-10-03 18:31:22 -0700316 "//webrtc/logging:rtc_event_log_api",
solenbergfb2c1d02016-09-15 13:12:02 -0700317 "//webrtc/system_wrappers",
318 "//webrtc/system_wrappers:system_wrappers_default",
319 "//webrtc/test:test_support",
320 ]
321
322 sources = [
323 "test/cmd_test/voe_cmd_test.cc",
324 ]
325
kjellandere40a7ee2016-10-16 23:56:12 -0700326 if (!build_with_chromium && is_clang) {
327 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
solenbergfb2c1d02016-09-15 13:12:02 -0700328 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
329 }
330 }
331
ossua16f7a82016-07-08 02:12:55 -0700332 if (!is_ios) {
ehmaldonado38a21322016-09-02 04:10:34 -0700333 rtc_executable("voe_auto_test") {
ossua16f7a82016-07-08 02:12:55 -0700334 testonly = true
335
336 deps = [
solenbergba56b6c2016-09-13 07:29:12 -0700337 ":channel_transport",
ossua16f7a82016-07-08 02:12:55 -0700338 ":voice_engine",
339 "//testing/gmock",
340 "//testing/gtest",
341 "//third_party/gflags",
skvladcc91d282016-10-03 18:31:22 -0700342 "//webrtc/logging:rtc_event_log_api",
ossua16f7a82016-07-08 02:12:55 -0700343 "//webrtc/modules/video_capture",
344 "//webrtc/system_wrappers",
345 "//webrtc/system_wrappers/:system_wrappers_default",
ossua16f7a82016-07-08 02:12:55 -0700346 "//webrtc/test/:test_common",
347 "//webrtc/test/:test_support",
348 ]
349
350 sources = [
351 "test/auto_test/automated_mode.cc",
352 "test/auto_test/extended/agc_config_test.cc",
353 "test/auto_test/extended/ec_metrics_test.cc",
354 "test/auto_test/fakes/conference_transport.cc",
355 "test/auto_test/fakes/conference_transport.h",
356 "test/auto_test/fakes/loudest_filter.cc",
357 "test/auto_test/fakes/loudest_filter.h",
358 "test/auto_test/fixtures/after_initialization_fixture.cc",
359 "test/auto_test/fixtures/after_initialization_fixture.h",
360 "test/auto_test/fixtures/after_streaming_fixture.cc",
361 "test/auto_test/fixtures/after_streaming_fixture.h",
362 "test/auto_test/fixtures/before_initialization_fixture.cc",
363 "test/auto_test/fixtures/before_initialization_fixture.h",
364 "test/auto_test/fixtures/before_streaming_fixture.cc",
365 "test/auto_test/fixtures/before_streaming_fixture.h",
ossua16f7a82016-07-08 02:12:55 -0700366 "test/auto_test/standard/audio_processing_test.cc",
367 "test/auto_test/standard/codec_before_streaming_test.cc",
368 "test/auto_test/standard/codec_test.cc",
369 "test/auto_test/standard/dtmf_test.cc",
370 "test/auto_test/standard/external_media_test.cc",
371 "test/auto_test/standard/file_before_streaming_test.cc",
372 "test/auto_test/standard/file_test.cc",
373 "test/auto_test/standard/hardware_before_initializing_test.cc",
374 "test/auto_test/standard/hardware_test.cc",
375 "test/auto_test/standard/mixing_test.cc",
376 "test/auto_test/standard/neteq_stats_test.cc",
377 "test/auto_test/standard/rtp_rtcp_before_streaming_test.cc",
378 "test/auto_test/standard/rtp_rtcp_extensions.cc",
379 "test/auto_test/standard/rtp_rtcp_test.cc",
380 "test/auto_test/standard/video_sync_test.cc",
381 "test/auto_test/standard/voe_base_misc_test.cc",
382 "test/auto_test/standard/volume_test.cc",
383 "test/auto_test/voe_conference_test.cc",
384 "test/auto_test/voe_cpu_test.cc",
385 "test/auto_test/voe_cpu_test.h",
386 "test/auto_test/voe_output_test.cc",
387 "test/auto_test/voe_standard_test.cc",
388 "test/auto_test/voe_standard_test.h",
389 "test/auto_test/voe_stress_test.cc",
390 "test/auto_test/voe_stress_test.h",
391 "test/auto_test/voe_test_defines.h",
392 "test/auto_test/voe_test_interface.h",
393 ]
394
395 if (!is_android) {
396 # Some tests are not supported on android yet, exclude these tests.
397 sources +=
398 [ "test/auto_test/standard/hardware_before_streaming_test.cc" ]
399 }
400
401 defines = []
402
403 if (rtc_enable_protobuf) {
404 defines = [ "ENABLE_RTC_EVENT_LOG" ]
405 }
406
407 if (is_win) {
408 defines += [ "WEBRTC_DRIFT_COMPENSATION_SUPPORTED" ]
409
410 cflags = [
411 "/wd4267", # size_t to int truncation.
412 "/wd4373", # Virtual function override.
413 # TODO(kjellander): Bug 261: fix this warning.
414 ]
415 }
416
kjellandere40a7ee2016-10-16 23:56:12 -0700417 if (!build_with_chromium && is_clang) {
418 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700419 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
ossua16f7a82016-07-08 02:12:55 -0700420 }
421 }
422 }
423}