blob: 8a8050b7eedeb6757b4fdcbeb6319648ca9d1064 [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
ehmaldonado38a21322016-09-02 04:10:34 -070011rtc_source_set("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",
33 "network_predictor.cc",
34 "network_predictor.h",
35 "output_mixer.cc",
36 "output_mixer.h",
37 "shared_data.cc",
38 "shared_data.h",
39 "statistics.cc",
40 "statistics.h",
41 "transmit_mixer.cc",
42 "transmit_mixer.h",
43 "utility.cc",
44 "utility.h",
45 "voe_audio_processing_impl.cc",
46 "voe_audio_processing_impl.h",
47 "voe_base_impl.cc",
48 "voe_base_impl.h",
49 "voe_codec_impl.cc",
50 "voe_codec_impl.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000051 "voe_external_media_impl.cc",
52 "voe_external_media_impl.h",
53 "voe_file_impl.cc",
54 "voe_file_impl.h",
55 "voe_hardware_impl.cc",
56 "voe_hardware_impl.h",
57 "voe_neteq_stats_impl.cc",
58 "voe_neteq_stats_impl.h",
59 "voe_network_impl.cc",
60 "voe_network_impl.h",
61 "voe_rtp_rtcp_impl.cc",
62 "voe_rtp_rtcp_impl.h",
63 "voe_video_sync_impl.cc",
64 "voe_video_sync_impl.h",
65 "voe_volume_control_impl.cc",
66 "voe_volume_control_impl.h",
67 "voice_engine_defines.h",
68 "voice_engine_impl.cc",
69 "voice_engine_impl.h",
70 ]
71
72 if (is_win) {
73 defines = [ "WEBRTC_DRIFT_COMPENSATION_SUPPORTED" ]
kjellander@webrtc.org8649fed2015-01-08 21:22:01 +000074
75 cflags = [
76 # TODO(kjellander): Bug 261: fix this warning.
ossua16f7a82016-07-08 02:12:55 -070077 "/wd4373", # Virtual function override.
kjellander@webrtc.org8649fed2015-01-08 21:22:01 +000078 ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000079 }
80
81 if (is_clang) {
82 # Suppress warnings from Chrome's Clang plugins.
83 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -070084 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000085 }
86
ehmaldonado53cec042016-09-09 05:32:14 -070087 public_deps = [
88 "../modules/audio_coding",
89 ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000090 deps = [
aleloie6ca9ec2016-08-10 05:01:51 -070091 ":level_indicator",
ivocb04965c2015-09-09 00:09:43 -070092 "..:rtc_event_log",
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000093 "..:webrtc_common",
kjellandera69d9732016-08-31 07:33:05 -070094 "../api:call_api",
kjellander@webrtc.org7ffeab52016-02-26 22:46:09 +010095 "../base:rtc_base_approved",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000096 "../common_audio",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000097 "../modules/audio_conference_mixer",
98 "../modules/audio_device",
99 "../modules/audio_processing",
100 "../modules/bitrate_controller",
101 "../modules/media_file",
Stefan Holmerb86d4e42015-12-07 10:26:18 +0100102 "../modules/pacing",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000103 "../modules/rtp_rtcp",
104 "../modules/utility",
105 "../system_wrappers",
106 ]
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000107}
ossua16f7a82016-07-08 02:12:55 -0700108
ehmaldonado38a21322016-09-02 04:10:34 -0700109rtc_source_set("level_indicator") {
aleloie6ca9ec2016-08-10 05:01:51 -0700110 sources = [
111 "level_indicator.cc",
112 "level_indicator.h",
113 ]
114
aleloie6ca9ec2016-08-10 05:01:51 -0700115 deps = [
116 "..:webrtc_common",
117 "../base:rtc_base_approved",
118 "../common_audio",
119 ]
120}
121
ossua16f7a82016-07-08 02:12:55 -0700122if (rtc_include_tests) {
solenbergba56b6c2016-09-13 07:29:12 -0700123 config("channel_transport_warnings_config") {
124 if (is_win) {
125 cflags = [ "/wd4302" ] # cast truncation
126
127 if (is_clang) {
128 # GN orders flags on a target before flags from configs. The default
129 # config adds -Wall, and this flag have to be after -Wall -- so they need
130 # to come from a config and cannot be on the target directly.
131 cflags += [
132 "-Wno-parentheses-equality",
133 "-Wno-reorder",
134 "-Wno-tautological-constant-out-of-range-compare",
135
136 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6268
137 # for -Wno-thread-safety-analysis
138 "-Wno-thread-safety-analysis",
139 "-Wno-unused-private-field",
140 ]
141 }
142 }
143 }
144
145 rtc_source_set("channel_transport") {
146 testonly = true
147 sources = [
148 "test/channel_transport/channel_transport.cc",
149 "test/channel_transport/channel_transport.h",
150 "test/channel_transport/traffic_control_win.cc",
151 "test/channel_transport/traffic_control_win.h",
152 "test/channel_transport/udp_socket2_manager_win.cc",
153 "test/channel_transport/udp_socket2_manager_win.h",
154 "test/channel_transport/udp_socket2_win.cc",
155 "test/channel_transport/udp_socket2_win.h",
156 "test/channel_transport/udp_socket_manager_posix.cc",
157 "test/channel_transport/udp_socket_manager_posix.h",
158 "test/channel_transport/udp_socket_manager_wrapper.cc",
159 "test/channel_transport/udp_socket_manager_wrapper.h",
160 "test/channel_transport/udp_socket_posix.cc",
161 "test/channel_transport/udp_socket_posix.h",
162 "test/channel_transport/udp_socket_wrapper.cc",
163 "test/channel_transport/udp_socket_wrapper.h",
164 "test/channel_transport/udp_transport.h",
165 "test/channel_transport/udp_transport_impl.cc",
166 "test/channel_transport/udp_transport_impl.h",
167 ]
168
169 configs += [ ":channel_transport_warnings_config" ]
170
171 if (is_clang && !is_nacl) {
172 # Suppress warnings from the Chromium Clang plugin.
173 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
174 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
175 }
176
177 deps = [
178 "..:webrtc_common",
179 "../system_wrappers",
180 "//testing/gtest",
181 ]
182 }
183
ehmaldonado38a21322016-09-02 04:10:34 -0700184 rtc_test("voice_engine_unittests") {
ossua16f7a82016-07-08 02:12:55 -0700185 deps = [
solenbergba56b6c2016-09-13 07:29:12 -0700186 ":channel_transport",
ossua16f7a82016-07-08 02:12:55 -0700187 ":voice_engine",
188 "//testing/gmock",
189 "//testing/gtest",
190 "//webrtc/common_audio",
191 "//webrtc/modules/audio_coding",
192 "//webrtc/modules/audio_conference_mixer",
193 "//webrtc/modules/audio_device",
194 "//webrtc/modules/audio_processing",
195 "//webrtc/modules/media_file",
196 "//webrtc/modules/rtp_rtcp",
197 "//webrtc/modules/utility",
198 "//webrtc/system_wrappers",
199 "//webrtc/test:test_support_main",
200 ]
201
202 if (is_android) {
203 deps += [ "//testing/android/native_test:native_test_native_code" ]
sakal714dd4e2016-08-15 02:29:11 -0700204 shard_timeout = 900
ossua16f7a82016-07-08 02:12:55 -0700205 }
206
207 sources = [
208 "channel_unittest.cc",
209 "network_predictor_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
232 if (is_clang) {
233 # Suppress warnings from Chrome's Clang plugins.
234 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700235 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
ossua16f7a82016-07-08 02:12:55 -0700236 }
237 }
238
solenbergfb2c1d02016-09-15 13:12:02 -0700239 rtc_executable("voe_cmd_test") {
240 testonly = true
241
242 deps = [
243 ":channel_transport",
244 ":voice_engine",
245 "//testing/gtest",
246 "//third_party/gflags",
247 "//webrtc:rtc_event_log",
248 "//webrtc/system_wrappers",
249 "//webrtc/system_wrappers:system_wrappers_default",
250 "//webrtc/test:test_support",
251 ]
252
253 sources = [
254 "test/cmd_test/voe_cmd_test.cc",
255 ]
256
257 if (is_clang) {
258 # Suppress warnings from Chrome's Clang plugins.
259 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
260 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
261 }
262 }
263
ossua16f7a82016-07-08 02:12:55 -0700264 if (!is_ios) {
ehmaldonado38a21322016-09-02 04:10:34 -0700265 rtc_executable("voe_auto_test") {
ossua16f7a82016-07-08 02:12:55 -0700266 testonly = true
267
268 deps = [
solenbergba56b6c2016-09-13 07:29:12 -0700269 ":channel_transport",
ossua16f7a82016-07-08 02:12:55 -0700270 ":voice_engine",
271 "//testing/gmock",
272 "//testing/gtest",
273 "//third_party/gflags",
274 "//webrtc/:rtc_event_log",
275 "//webrtc/modules/video_capture",
276 "//webrtc/system_wrappers",
277 "//webrtc/system_wrappers/:system_wrappers_default",
ossua16f7a82016-07-08 02:12:55 -0700278 "//webrtc/test/:test_common",
279 "//webrtc/test/:test_support",
280 ]
281
282 sources = [
283 "test/auto_test/automated_mode.cc",
284 "test/auto_test/extended/agc_config_test.cc",
285 "test/auto_test/extended/ec_metrics_test.cc",
286 "test/auto_test/fakes/conference_transport.cc",
287 "test/auto_test/fakes/conference_transport.h",
288 "test/auto_test/fakes/loudest_filter.cc",
289 "test/auto_test/fakes/loudest_filter.h",
290 "test/auto_test/fixtures/after_initialization_fixture.cc",
291 "test/auto_test/fixtures/after_initialization_fixture.h",
292 "test/auto_test/fixtures/after_streaming_fixture.cc",
293 "test/auto_test/fixtures/after_streaming_fixture.h",
294 "test/auto_test/fixtures/before_initialization_fixture.cc",
295 "test/auto_test/fixtures/before_initialization_fixture.h",
296 "test/auto_test/fixtures/before_streaming_fixture.cc",
297 "test/auto_test/fixtures/before_streaming_fixture.h",
298 "test/auto_test/resource_manager.cc",
299 "test/auto_test/standard/audio_processing_test.cc",
300 "test/auto_test/standard/codec_before_streaming_test.cc",
301 "test/auto_test/standard/codec_test.cc",
302 "test/auto_test/standard/dtmf_test.cc",
303 "test/auto_test/standard/external_media_test.cc",
304 "test/auto_test/standard/file_before_streaming_test.cc",
305 "test/auto_test/standard/file_test.cc",
306 "test/auto_test/standard/hardware_before_initializing_test.cc",
307 "test/auto_test/standard/hardware_test.cc",
308 "test/auto_test/standard/mixing_test.cc",
309 "test/auto_test/standard/neteq_stats_test.cc",
310 "test/auto_test/standard/rtp_rtcp_before_streaming_test.cc",
311 "test/auto_test/standard/rtp_rtcp_extensions.cc",
312 "test/auto_test/standard/rtp_rtcp_test.cc",
313 "test/auto_test/standard/video_sync_test.cc",
314 "test/auto_test/standard/voe_base_misc_test.cc",
315 "test/auto_test/standard/volume_test.cc",
316 "test/auto_test/voe_conference_test.cc",
317 "test/auto_test/voe_cpu_test.cc",
318 "test/auto_test/voe_cpu_test.h",
319 "test/auto_test/voe_output_test.cc",
320 "test/auto_test/voe_standard_test.cc",
321 "test/auto_test/voe_standard_test.h",
322 "test/auto_test/voe_stress_test.cc",
323 "test/auto_test/voe_stress_test.h",
324 "test/auto_test/voe_test_defines.h",
325 "test/auto_test/voe_test_interface.h",
326 ]
327
328 if (!is_android) {
329 # Some tests are not supported on android yet, exclude these tests.
330 sources +=
331 [ "test/auto_test/standard/hardware_before_streaming_test.cc" ]
332 }
333
334 defines = []
335
336 if (rtc_enable_protobuf) {
337 defines = [ "ENABLE_RTC_EVENT_LOG" ]
338 }
339
340 if (is_win) {
341 defines += [ "WEBRTC_DRIFT_COMPENSATION_SUPPORTED" ]
342
343 cflags = [
344 "/wd4267", # size_t to int truncation.
345 "/wd4373", # Virtual function override.
346 # TODO(kjellander): Bug 261: fix this warning.
347 ]
348 }
349
350 if (is_clang) {
351 # Suppress warnings from Chrome's Clang plugins.
352 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700353 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
ossua16f7a82016-07-08 02:12:55 -0700354 }
355 }
356 }
357}