blob: 919708e241dc63b52cfd60ab0a556b6e3b8a081d [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
kjellanderb62dbbe2016-09-23 00:38:52 -070011rtc_static_library("voice_engine") {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000012 sources = [
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020013 "channel.cc",
14 "channel.h",
15 "channel_manager.cc",
16 "channel_manager.h",
solenberg13725082015-11-25 08:16:52 -080017 "channel_proxy.cc",
18 "channel_proxy.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000019 "include/voe_audio_processing.h",
20 "include/voe_base.h",
21 "include/voe_codec.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000022 "include/voe_errors.h",
23 "include/voe_external_media.h",
24 "include/voe_file.h",
25 "include/voe_hardware.h",
26 "include/voe_neteq_stats.h",
27 "include/voe_network.h",
28 "include/voe_rtp_rtcp.h",
29 "include/voe_video_sync.h",
30 "include/voe_volume_control.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000031 "monitor_module.cc",
32 "monitor_module.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000033 "output_mixer.cc",
34 "output_mixer.h",
35 "shared_data.cc",
36 "shared_data.h",
37 "statistics.cc",
38 "statistics.h",
39 "transmit_mixer.cc",
40 "transmit_mixer.h",
41 "utility.cc",
42 "utility.h",
43 "voe_audio_processing_impl.cc",
44 "voe_audio_processing_impl.h",
45 "voe_base_impl.cc",
46 "voe_base_impl.h",
47 "voe_codec_impl.cc",
48 "voe_codec_impl.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000049 "voe_external_media_impl.cc",
50 "voe_external_media_impl.h",
51 "voe_file_impl.cc",
52 "voe_file_impl.h",
53 "voe_hardware_impl.cc",
54 "voe_hardware_impl.h",
55 "voe_neteq_stats_impl.cc",
56 "voe_neteq_stats_impl.h",
57 "voe_network_impl.cc",
58 "voe_network_impl.h",
59 "voe_rtp_rtcp_impl.cc",
60 "voe_rtp_rtcp_impl.h",
61 "voe_video_sync_impl.cc",
62 "voe_video_sync_impl.h",
63 "voe_volume_control_impl.cc",
64 "voe_volume_control_impl.h",
65 "voice_engine_defines.h",
66 "voice_engine_impl.cc",
67 "voice_engine_impl.h",
68 ]
69
70 if (is_win) {
71 defines = [ "WEBRTC_DRIFT_COMPENSATION_SUPPORTED" ]
kjellander@webrtc.org8649fed2015-01-08 21:22:01 +000072
73 cflags = [
74 # TODO(kjellander): Bug 261: fix this warning.
ossua16f7a82016-07-08 02:12:55 -070075 "/wd4373", # Virtual function override.
kjellander@webrtc.org8649fed2015-01-08 21:22:01 +000076 ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000077 }
78
kjellandere40a7ee2016-10-16 23:56:12 -070079 if (!build_with_chromium && is_clang) {
80 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070081 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000082 }
83
ehmaldonado53cec042016-09-09 05:32:14 -070084 public_deps = [
85 "../modules/audio_coding",
86 ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000087 deps = [
aleloie6ca9ec2016-08-10 05:01:51 -070088 ":level_indicator",
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000089 "..:webrtc_common",
aleloiaed581a2016-10-20 06:32:39 -070090 "../api:audio_mixer_api",
kjellandera69d9732016-08-31 07:33:05 -070091 "../api:call_api",
kjellander@webrtc.org7ffeab52016-02-26 22:46:09 +010092 "../base:rtc_base_approved",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000093 "../common_audio",
skvladcc91d282016-10-03 18:31:22 -070094 "../logging:rtc_event_log_api",
aleloi9ae585d2016-10-13 06:57:16 -070095 "../modules/audio_coding:audio_decoder_factory_interface",
kwibergda2bf4e2016-10-24 13:47:09 -070096 "../modules/audio_coding:audio_format_conversion",
aleloi9ae585d2016-10-13 06:57:16 -070097 "../modules/audio_coding:builtin_audio_decoder_factory",
98 "../modules/audio_coding:rent_a_codec",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000099 "../modules/audio_conference_mixer",
100 "../modules/audio_device",
101 "../modules/audio_processing",
102 "../modules/bitrate_controller",
103 "../modules/media_file",
Stefan Holmerb86d4e42015-12-07 10:26:18 +0100104 "../modules/pacing",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000105 "../modules/rtp_rtcp",
106 "../modules/utility",
107 "../system_wrappers",
108 ]
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000109}
ossua16f7a82016-07-08 02:12:55 -0700110
kjellanderb62dbbe2016-09-23 00:38:52 -0700111rtc_static_library("level_indicator") {
aleloie6ca9ec2016-08-10 05:01:51 -0700112 sources = [
113 "level_indicator.cc",
114 "level_indicator.h",
115 ]
116
aleloie6ca9ec2016-08-10 05:01:51 -0700117 deps = [
118 "..:webrtc_common",
119 "../base:rtc_base_approved",
120 "../common_audio",
121 ]
122}
123
ossua16f7a82016-07-08 02:12:55 -0700124if (rtc_include_tests) {
solenbergba56b6c2016-09-13 07:29:12 -0700125 config("channel_transport_warnings_config") {
126 if (is_win) {
127 cflags = [ "/wd4302" ] # cast truncation
128
129 if (is_clang) {
130 # GN orders flags on a target before flags from configs. The default
131 # config adds -Wall, and this flag have to be after -Wall -- so they need
132 # to come from a config and cannot be on the target directly.
133 cflags += [
134 "-Wno-parentheses-equality",
135 "-Wno-reorder",
136 "-Wno-tautological-constant-out-of-range-compare",
137
138 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6268
139 # for -Wno-thread-safety-analysis
140 "-Wno-thread-safety-analysis",
141 "-Wno-unused-private-field",
142 ]
143 }
144 }
145 }
146
kjellanderb62dbbe2016-09-23 00:38:52 -0700147 rtc_static_library("channel_transport") {
solenbergba56b6c2016-09-13 07:29:12 -0700148 testonly = true
149 sources = [
150 "test/channel_transport/channel_transport.cc",
151 "test/channel_transport/channel_transport.h",
152 "test/channel_transport/traffic_control_win.cc",
153 "test/channel_transport/traffic_control_win.h",
154 "test/channel_transport/udp_socket2_manager_win.cc",
155 "test/channel_transport/udp_socket2_manager_win.h",
156 "test/channel_transport/udp_socket2_win.cc",
157 "test/channel_transport/udp_socket2_win.h",
158 "test/channel_transport/udp_socket_manager_posix.cc",
159 "test/channel_transport/udp_socket_manager_posix.h",
160 "test/channel_transport/udp_socket_manager_wrapper.cc",
161 "test/channel_transport/udp_socket_manager_wrapper.h",
162 "test/channel_transport/udp_socket_posix.cc",
163 "test/channel_transport/udp_socket_posix.h",
164 "test/channel_transport/udp_socket_wrapper.cc",
165 "test/channel_transport/udp_socket_wrapper.h",
166 "test/channel_transport/udp_transport.h",
167 "test/channel_transport/udp_transport_impl.cc",
168 "test/channel_transport/udp_transport_impl.h",
169 ]
170
171 configs += [ ":channel_transport_warnings_config" ]
172
kjellandere40a7ee2016-10-16 23:56:12 -0700173 if (!build_with_chromium && is_clang) {
174 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
solenbergba56b6c2016-09-13 07:29:12 -0700175 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
176 }
177
178 deps = [
179 "..:webrtc_common",
180 "../system_wrappers",
181 "//testing/gtest",
182 ]
183 }
184
ehmaldonado38a21322016-09-02 04:10:34 -0700185 rtc_test("voice_engine_unittests") {
ossua16f7a82016-07-08 02:12:55 -0700186 deps = [
solenbergba56b6c2016-09-13 07:29:12 -0700187 ":channel_transport",
ossua16f7a82016-07-08 02:12:55 -0700188 ":voice_engine",
189 "//testing/gmock",
190 "//testing/gtest",
191 "//webrtc/common_audio",
192 "//webrtc/modules/audio_coding",
193 "//webrtc/modules/audio_conference_mixer",
194 "//webrtc/modules/audio_device",
195 "//webrtc/modules/audio_processing",
196 "//webrtc/modules/media_file",
197 "//webrtc/modules/rtp_rtcp",
solenberg71b9b582016-11-25 11:45:05 -0800198 "//webrtc/modules/utility",
ossua16f7a82016-07-08 02:12:55 -0700199 "//webrtc/system_wrappers",
200 "//webrtc/test:test_support_main",
201 ]
202
203 if (is_android) {
204 deps += [ "//testing/android/native_test:native_test_native_code" ]
sakal714dd4e2016-08-15 02:29:11 -0700205 shard_timeout = 900
ossua16f7a82016-07-08 02:12:55 -0700206 }
207
208 sources = [
209 "channel_unittest.cc",
solenbergba56b6c2016-09-13 07:29:12 -0700210 "test/channel_transport/udp_socket_manager_unittest.cc",
211 "test/channel_transport/udp_socket_wrapper_unittest.cc",
212 "test/channel_transport/udp_transport_unittest.cc",
ossua16f7a82016-07-08 02:12:55 -0700213 "transmit_mixer_unittest.cc",
214 "utility_unittest.cc",
215 "voe_audio_processing_unittest.cc",
216 "voe_base_unittest.cc",
217 "voe_codec_unittest.cc",
218 "voe_network_unittest.cc",
219 "voice_engine_fixture.cc",
220 "voice_engine_fixture.h",
221 ]
222
223 if (is_win) {
224 defines = [ "WEBRTC_DRIFT_COMPENSATION_SUPPORTED" ]
225
226 cflags = [
227 # TODO(kjellander): Bug 261: fix this warning.
228 "/wd4373", # Virtual function override.
229 ]
230 }
231
kjellandere40a7ee2016-10-16 23:56:12 -0700232 if (!build_with_chromium && is_clang) {
233 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700234 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
ossua16f7a82016-07-08 02:12:55 -0700235 }
236 }
237
solenbergfb2c1d02016-09-15 13:12:02 -0700238 rtc_executable("voe_cmd_test") {
239 testonly = true
240
241 deps = [
242 ":channel_transport",
243 ":voice_engine",
244 "//testing/gtest",
245 "//third_party/gflags",
skvladcc91d282016-10-03 18:31:22 -0700246 "//webrtc/logging:rtc_event_log_api",
solenbergfb2c1d02016-09-15 13:12:02 -0700247 "//webrtc/system_wrappers",
248 "//webrtc/system_wrappers:system_wrappers_default",
249 "//webrtc/test:test_support",
250 ]
251
252 sources = [
253 "test/cmd_test/voe_cmd_test.cc",
254 ]
255
kjellandere40a7ee2016-10-16 23:56:12 -0700256 if (!build_with_chromium && is_clang) {
257 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
solenbergfb2c1d02016-09-15 13:12:02 -0700258 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
259 }
260 }
261
ossua16f7a82016-07-08 02:12:55 -0700262 if (!is_ios) {
ehmaldonado38a21322016-09-02 04:10:34 -0700263 rtc_executable("voe_auto_test") {
ossua16f7a82016-07-08 02:12:55 -0700264 testonly = true
265
266 deps = [
solenbergba56b6c2016-09-13 07:29:12 -0700267 ":channel_transport",
ossua16f7a82016-07-08 02:12:55 -0700268 ":voice_engine",
269 "//testing/gmock",
270 "//testing/gtest",
271 "//third_party/gflags",
skvladcc91d282016-10-03 18:31:22 -0700272 "//webrtc/logging:rtc_event_log_api",
ossua16f7a82016-07-08 02:12:55 -0700273 "//webrtc/modules/video_capture",
274 "//webrtc/system_wrappers",
275 "//webrtc/system_wrappers/:system_wrappers_default",
ossua16f7a82016-07-08 02:12:55 -0700276 "//webrtc/test/:test_common",
277 "//webrtc/test/:test_support",
278 ]
279
280 sources = [
281 "test/auto_test/automated_mode.cc",
282 "test/auto_test/extended/agc_config_test.cc",
283 "test/auto_test/extended/ec_metrics_test.cc",
284 "test/auto_test/fakes/conference_transport.cc",
285 "test/auto_test/fakes/conference_transport.h",
286 "test/auto_test/fakes/loudest_filter.cc",
287 "test/auto_test/fakes/loudest_filter.h",
288 "test/auto_test/fixtures/after_initialization_fixture.cc",
289 "test/auto_test/fixtures/after_initialization_fixture.h",
290 "test/auto_test/fixtures/after_streaming_fixture.cc",
291 "test/auto_test/fixtures/after_streaming_fixture.h",
292 "test/auto_test/fixtures/before_initialization_fixture.cc",
293 "test/auto_test/fixtures/before_initialization_fixture.h",
294 "test/auto_test/fixtures/before_streaming_fixture.cc",
295 "test/auto_test/fixtures/before_streaming_fixture.h",
ossua16f7a82016-07-08 02:12:55 -0700296 "test/auto_test/standard/audio_processing_test.cc",
297 "test/auto_test/standard/codec_before_streaming_test.cc",
298 "test/auto_test/standard/codec_test.cc",
299 "test/auto_test/standard/dtmf_test.cc",
300 "test/auto_test/standard/external_media_test.cc",
301 "test/auto_test/standard/file_before_streaming_test.cc",
302 "test/auto_test/standard/file_test.cc",
303 "test/auto_test/standard/hardware_before_initializing_test.cc",
304 "test/auto_test/standard/hardware_test.cc",
305 "test/auto_test/standard/mixing_test.cc",
306 "test/auto_test/standard/neteq_stats_test.cc",
307 "test/auto_test/standard/rtp_rtcp_before_streaming_test.cc",
308 "test/auto_test/standard/rtp_rtcp_extensions.cc",
309 "test/auto_test/standard/rtp_rtcp_test.cc",
310 "test/auto_test/standard/video_sync_test.cc",
311 "test/auto_test/standard/voe_base_misc_test.cc",
312 "test/auto_test/standard/volume_test.cc",
313 "test/auto_test/voe_conference_test.cc",
314 "test/auto_test/voe_cpu_test.cc",
315 "test/auto_test/voe_cpu_test.h",
316 "test/auto_test/voe_output_test.cc",
317 "test/auto_test/voe_standard_test.cc",
318 "test/auto_test/voe_standard_test.h",
319 "test/auto_test/voe_stress_test.cc",
320 "test/auto_test/voe_stress_test.h",
321 "test/auto_test/voe_test_defines.h",
322 "test/auto_test/voe_test_interface.h",
323 ]
324
325 if (!is_android) {
326 # Some tests are not supported on android yet, exclude these tests.
327 sources +=
328 [ "test/auto_test/standard/hardware_before_streaming_test.cc" ]
329 }
330
331 defines = []
332
333 if (rtc_enable_protobuf) {
334 defines = [ "ENABLE_RTC_EVENT_LOG" ]
335 }
336
337 if (is_win) {
338 defines += [ "WEBRTC_DRIFT_COMPENSATION_SUPPORTED" ]
339
340 cflags = [
341 "/wd4267", # size_t to int truncation.
342 "/wd4373", # Virtual function override.
343 # TODO(kjellander): Bug 261: fix this warning.
344 ]
345 }
346
kjellandere40a7ee2016-10-16 23:56:12 -0700347 if (!build_with_chromium && is_clang) {
348 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700349 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
ossua16f7a82016-07-08 02:12:55 -0700350 }
351 }
352 }
353}