blob: 2b5d029b2fbac013be7d9b280a81cd1df4a14b50 [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",
96 "../modules/audio_coding:builtin_audio_decoder_factory",
97 "../modules/audio_coding:rent_a_codec",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000098 "../modules/audio_conference_mixer",
99 "../modules/audio_device",
100 "../modules/audio_processing",
101 "../modules/bitrate_controller",
102 "../modules/media_file",
Stefan Holmerb86d4e42015-12-07 10:26:18 +0100103 "../modules/pacing",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000104 "../modules/rtp_rtcp",
105 "../modules/utility",
106 "../system_wrappers",
107 ]
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000108}
ossua16f7a82016-07-08 02:12:55 -0700109
kjellanderb62dbbe2016-09-23 00:38:52 -0700110rtc_static_library("level_indicator") {
aleloie6ca9ec2016-08-10 05:01:51 -0700111 sources = [
112 "level_indicator.cc",
113 "level_indicator.h",
114 ]
115
aleloie6ca9ec2016-08-10 05:01:51 -0700116 deps = [
117 "..:webrtc_common",
118 "../base:rtc_base_approved",
119 "../common_audio",
120 ]
121}
122
ossua16f7a82016-07-08 02:12:55 -0700123if (rtc_include_tests) {
solenbergba56b6c2016-09-13 07:29:12 -0700124 config("channel_transport_warnings_config") {
125 if (is_win) {
126 cflags = [ "/wd4302" ] # cast truncation
127
128 if (is_clang) {
129 # GN orders flags on a target before flags from configs. The default
130 # config adds -Wall, and this flag have to be after -Wall -- so they need
131 # to come from a config and cannot be on the target directly.
132 cflags += [
133 "-Wno-parentheses-equality",
134 "-Wno-reorder",
135 "-Wno-tautological-constant-out-of-range-compare",
136
137 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6268
138 # for -Wno-thread-safety-analysis
139 "-Wno-thread-safety-analysis",
140 "-Wno-unused-private-field",
141 ]
142 }
143 }
144 }
145
kjellanderb62dbbe2016-09-23 00:38:52 -0700146 rtc_static_library("channel_transport") {
solenbergba56b6c2016-09-13 07:29:12 -0700147 testonly = true
148 sources = [
149 "test/channel_transport/channel_transport.cc",
150 "test/channel_transport/channel_transport.h",
151 "test/channel_transport/traffic_control_win.cc",
152 "test/channel_transport/traffic_control_win.h",
153 "test/channel_transport/udp_socket2_manager_win.cc",
154 "test/channel_transport/udp_socket2_manager_win.h",
155 "test/channel_transport/udp_socket2_win.cc",
156 "test/channel_transport/udp_socket2_win.h",
157 "test/channel_transport/udp_socket_manager_posix.cc",
158 "test/channel_transport/udp_socket_manager_posix.h",
159 "test/channel_transport/udp_socket_manager_wrapper.cc",
160 "test/channel_transport/udp_socket_manager_wrapper.h",
161 "test/channel_transport/udp_socket_posix.cc",
162 "test/channel_transport/udp_socket_posix.h",
163 "test/channel_transport/udp_socket_wrapper.cc",
164 "test/channel_transport/udp_socket_wrapper.h",
165 "test/channel_transport/udp_transport.h",
166 "test/channel_transport/udp_transport_impl.cc",
167 "test/channel_transport/udp_transport_impl.h",
168 ]
169
170 configs += [ ":channel_transport_warnings_config" ]
171
kjellandere40a7ee2016-10-16 23:56:12 -0700172 if (!build_with_chromium && is_clang) {
173 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
solenbergba56b6c2016-09-13 07:29:12 -0700174 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",
solenbergba56b6c2016-09-13 07:29:12 -0700209 "test/channel_transport/udp_socket_manager_unittest.cc",
210 "test/channel_transport/udp_socket_wrapper_unittest.cc",
211 "test/channel_transport/udp_transport_unittest.cc",
ossua16f7a82016-07-08 02:12:55 -0700212 "transmit_mixer_unittest.cc",
213 "utility_unittest.cc",
214 "voe_audio_processing_unittest.cc",
215 "voe_base_unittest.cc",
216 "voe_codec_unittest.cc",
217 "voe_network_unittest.cc",
218 "voice_engine_fixture.cc",
219 "voice_engine_fixture.h",
220 ]
221
222 if (is_win) {
223 defines = [ "WEBRTC_DRIFT_COMPENSATION_SUPPORTED" ]
224
225 cflags = [
226 # TODO(kjellander): Bug 261: fix this warning.
227 "/wd4373", # Virtual function override.
228 ]
229 }
230
kjellandere40a7ee2016-10-16 23:56:12 -0700231 if (!build_with_chromium && is_clang) {
232 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700233 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
ossua16f7a82016-07-08 02:12:55 -0700234 }
235 }
236
solenbergfb2c1d02016-09-15 13:12:02 -0700237 rtc_executable("voe_cmd_test") {
238 testonly = true
239
240 deps = [
241 ":channel_transport",
242 ":voice_engine",
243 "//testing/gtest",
244 "//third_party/gflags",
skvladcc91d282016-10-03 18:31:22 -0700245 "//webrtc/logging:rtc_event_log_api",
solenbergfb2c1d02016-09-15 13:12:02 -0700246 "//webrtc/system_wrappers",
247 "//webrtc/system_wrappers:system_wrappers_default",
248 "//webrtc/test:test_support",
249 ]
250
251 sources = [
252 "test/cmd_test/voe_cmd_test.cc",
253 ]
254
kjellandere40a7ee2016-10-16 23:56:12 -0700255 if (!build_with_chromium && is_clang) {
256 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
solenbergfb2c1d02016-09-15 13:12:02 -0700257 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
258 }
259 }
260
ossua16f7a82016-07-08 02:12:55 -0700261 if (!is_ios) {
ehmaldonado38a21322016-09-02 04:10:34 -0700262 rtc_executable("voe_auto_test") {
ossua16f7a82016-07-08 02:12:55 -0700263 testonly = true
264
265 deps = [
solenbergba56b6c2016-09-13 07:29:12 -0700266 ":channel_transport",
ossua16f7a82016-07-08 02:12:55 -0700267 ":voice_engine",
268 "//testing/gmock",
269 "//testing/gtest",
270 "//third_party/gflags",
skvladcc91d282016-10-03 18:31:22 -0700271 "//webrtc/logging:rtc_event_log_api",
ossua16f7a82016-07-08 02:12:55 -0700272 "//webrtc/modules/video_capture",
273 "//webrtc/system_wrappers",
274 "//webrtc/system_wrappers/:system_wrappers_default",
ossua16f7a82016-07-08 02:12:55 -0700275 "//webrtc/test/:test_common",
276 "//webrtc/test/:test_support",
277 ]
278
279 sources = [
280 "test/auto_test/automated_mode.cc",
281 "test/auto_test/extended/agc_config_test.cc",
282 "test/auto_test/extended/ec_metrics_test.cc",
283 "test/auto_test/fakes/conference_transport.cc",
284 "test/auto_test/fakes/conference_transport.h",
285 "test/auto_test/fakes/loudest_filter.cc",
286 "test/auto_test/fakes/loudest_filter.h",
287 "test/auto_test/fixtures/after_initialization_fixture.cc",
288 "test/auto_test/fixtures/after_initialization_fixture.h",
289 "test/auto_test/fixtures/after_streaming_fixture.cc",
290 "test/auto_test/fixtures/after_streaming_fixture.h",
291 "test/auto_test/fixtures/before_initialization_fixture.cc",
292 "test/auto_test/fixtures/before_initialization_fixture.h",
293 "test/auto_test/fixtures/before_streaming_fixture.cc",
294 "test/auto_test/fixtures/before_streaming_fixture.h",
295 "test/auto_test/resource_manager.cc",
296 "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}