blob: 0cc7792fc99560b63998c35893ad42c2f8705eb4 [file] [log] [blame]
kjellanderd2b63cf2017-06-30 03:04:59 -07001# 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("//third_party/protobuf/proto_library.gni")
10import("../webrtc.gni")
11
12group("rtc_tools") {
13 # This target shall build all targets in tools/.
14 testonly = true
15
Mirko Bonadeif5ff67c2017-12-06 16:31:18 +010016 deps = [
kjellanderd2b63cf2017-06-30 03:04:59 -070017 ":command_line_parser",
18 ":frame_analyzer",
kjellander6af0cbf2017-09-04 23:42:45 -070019 ":video_quality_analysis",
kjellanderd2b63cf2017-06-30 03:04:59 -070020 ]
kjellander6af0cbf2017-09-04 23:42:45 -070021 if (!build_with_chromium) {
Mirko Bonadeif5ff67c2017-12-06 16:31:18 +010022 deps += [
kjellander6af0cbf2017-09-04 23:42:45 -070023 ":frame_editor",
24 ":psnr_ssim_analyzer",
25 ":rgba_to_i420_converter",
26 ]
27 if (rtc_include_internal_audio_device) {
Mirko Bonadeif5ff67c2017-12-06 16:31:18 +010028 deps += [ ":force_mic_volume_max" ]
kjellander6af0cbf2017-09-04 23:42:45 -070029 }
30 if (rtc_enable_protobuf) {
Mirko Bonadeif5ff67c2017-12-06 16:31:18 +010031 deps += [ ":chart_proto" ]
kjellander6af0cbf2017-09-04 23:42:45 -070032 }
kjellanderd2b63cf2017-06-30 03:04:59 -070033 }
34
35 if (rtc_include_tests) {
Mirko Bonadeif5ff67c2017-12-06 16:31:18 +010036 deps += [
kjellanderd2b63cf2017-06-30 03:04:59 -070037 ":activity_metric",
38 ":tools_unittests",
39 ]
40 if (rtc_enable_protobuf) {
Mirko Bonadeif5ff67c2017-12-06 16:31:18 +010041 deps += [
kjellanderd2b63cf2017-06-30 03:04:59 -070042 ":event_log_visualizer",
43 ":rtp_analyzer",
Patrik Höglund844ce8b2017-12-12 15:53:31 +010044 ":unpack_aecdump",
kjellanderd2b63cf2017-06-30 03:04:59 -070045 "network_tester",
46 ]
47 }
48 }
49}
50
51rtc_static_library("command_line_parser") {
52 sources = [
53 "simple_command_line_parser.cc",
54 "simple_command_line_parser.h",
55 ]
56 deps = [
ehmaldonadof6a861a2017-07-19 10:40:47 -070057 "../rtc_base:gtest_prod",
58 "../rtc_base:rtc_base_approved",
kjellanderd2b63cf2017-06-30 03:04:59 -070059 ]
60}
61
62rtc_static_library("video_quality_analysis") {
63 sources = [
64 "frame_analyzer/video_quality_analysis.cc",
65 "frame_analyzer/video_quality_analysis.h",
66 ]
Mirko Bonadei0250be52017-12-01 13:53:04 +010067 deps = [
Mirko Bonadeif5ff67c2017-12-06 16:31:18 +010068 "../common_video",
Edward Lemur2e5966b2018-01-30 15:33:02 +010069 "../test:perf_test",
Mirko Bonadei401d0562017-12-14 11:24:00 +010070 "//third_party/libyuv",
kjellanderd2b63cf2017-06-30 03:04:59 -070071 ]
72}
73
74rtc_executable("frame_analyzer") {
Per Kjellandera7f2d842018-01-10 15:54:53 +000075 visibility = [ "*" ]
kjellanderd2b63cf2017-06-30 03:04:59 -070076 sources = [
77 "frame_analyzer/frame_analyzer.cc",
78 ]
79
80 deps = [
81 ":command_line_parser",
82 ":video_quality_analysis",
Edward Lemur2e5966b2018-01-30 15:33:02 +010083 "../test:perf_test",
kjellanderd2b63cf2017-06-30 03:04:59 -070084 "//build/win:default_exe_manifest",
85 ]
86}
87
kjellander6af0cbf2017-09-04 23:42:45 -070088# Only expose the targets needed by Chromium (e.g. frame_analyzer) to avoid
89# building a lot of redundant code as part of Chromium builds.
90if (!build_with_chromium) {
91 rtc_executable("psnr_ssim_analyzer") {
kjellanderd2b63cf2017-06-30 03:04:59 -070092 sources = [
kjellander6af0cbf2017-09-04 23:42:45 -070093 "psnr_ssim_analyzer/psnr_ssim_analyzer.cc",
kjellanderd2b63cf2017-06-30 03:04:59 -070094 ]
95
kjellanderd2b63cf2017-06-30 03:04:59 -070096 deps = [
kjellander6af0cbf2017-09-04 23:42:45 -070097 ":command_line_parser",
98 ":video_quality_analysis",
kjellanderd2b63cf2017-06-30 03:04:59 -070099 "//build/win:default_exe_manifest",
100 ]
101 }
kjellanderd2b63cf2017-06-30 03:04:59 -0700102
kjellander6af0cbf2017-09-04 23:42:45 -0700103 rtc_static_library("reference_less_video_analysis_lib") {
kjellanderd2b63cf2017-06-30 03:04:59 -0700104 sources = [
kjellander6af0cbf2017-09-04 23:42:45 -0700105 "frame_analyzer/reference_less_video_analysis_lib.cc",
106 "frame_analyzer/reference_less_video_analysis_lib.h",
kjellanderd2b63cf2017-06-30 03:04:59 -0700107 ]
kjellander6af0cbf2017-09-04 23:42:45 -0700108
109 deps = [
110 ":video_quality_analysis",
111 ]
kjellanderd2b63cf2017-06-30 03:04:59 -0700112 }
113
kjellander6af0cbf2017-09-04 23:42:45 -0700114 rtc_executable("reference_less_video_analysis") {
kjellanderd2b63cf2017-06-30 03:04:59 -0700115 sources = [
kjellander6af0cbf2017-09-04 23:42:45 -0700116 "frame_analyzer/reference_less_video_analysis.cc",
kjellanderd2b63cf2017-06-30 03:04:59 -0700117 ]
kjellander6af0cbf2017-09-04 23:42:45 -0700118
119 deps = [
120 ":command_line_parser",
121 ":reference_less_video_analysis_lib",
122 "//build/win:default_exe_manifest",
123 ]
124 }
125
126 rtc_executable("rgba_to_i420_converter") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000127 visibility = [ "*" ]
kjellander6af0cbf2017-09-04 23:42:45 -0700128 sources = [
129 "converter/converter.cc",
130 "converter/converter.h",
131 "converter/rgba_to_i420_converter.cc",
132 ]
133
134 deps = [
135 ":command_line_parser",
136 "../common_video",
137 "//build/win:default_exe_manifest",
Mirko Bonadei401d0562017-12-14 11:24:00 +0100138 "//third_party/libyuv",
kjellander6af0cbf2017-09-04 23:42:45 -0700139 ]
140 }
141
142 rtc_static_library("frame_editing_lib") {
143 sources = [
144 "frame_editing/frame_editing_lib.cc",
145 "frame_editing/frame_editing_lib.h",
146 ]
147
148 # TODO(jschuh): Bug 1348: fix this warning.
149 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
150
kjellanderd2b63cf2017-06-30 03:04:59 -0700151 if (!build_with_chromium && is_clang) {
152 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
153 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
154 }
kjellanderd2b63cf2017-06-30 03:04:59 -0700155
kjellander6af0cbf2017-09-04 23:42:45 -0700156 deps = [
157 "..:webrtc_common",
Patrik Höglund3e113432017-12-15 14:40:10 +0100158 "../:typedefs",
kjellander6af0cbf2017-09-04 23:42:45 -0700159 "../common_video",
kjellanderd2b63cf2017-06-30 03:04:59 -0700160 ]
kjellander6af0cbf2017-09-04 23:42:45 -0700161 }
162
163 rtc_executable("frame_editor") {
164 sources = [
165 "frame_editing/frame_editing.cc",
kjellanderd2b63cf2017-06-30 03:04:59 -0700166 ]
kjellander6af0cbf2017-09-04 23:42:45 -0700167
168 deps = [
169 ":command_line_parser",
170 ":frame_editing_lib",
171 "//build/win:default_exe_manifest",
172 ]
173 }
174
175 # It doesn't make sense to build this tool without the ADM enabled.
176 if (rtc_include_internal_audio_device) {
177 rtc_executable("force_mic_volume_max") {
178 sources = [
179 "force_mic_volume_max/force_mic_volume_max.cc",
180 ]
181
182 if (!build_with_chromium && is_clang) {
183 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
184 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
185 }
186
187 deps = [
188 "../modules/audio_device",
Paulina Hensman7bd79a02018-03-15 12:44:12 +0100189 "../modules/audio_device:audio_device_impl",
kjellander6af0cbf2017-09-04 23:42:45 -0700190 "../system_wrappers:system_wrappers_default",
191 "//build/win:default_exe_manifest",
192 ]
193 }
194 }
195
196 if (rtc_enable_protobuf) {
197 proto_library("chart_proto") {
198 sources = [
199 "event_log_visualizer/chart.proto",
200 ]
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200201 proto_out_dir = "rtc_tools/event_log_visualizer"
kjellander6af0cbf2017-09-04 23:42:45 -0700202 }
203
204 rtc_static_library("event_log_visualizer_utils") {
Per Kjellandera0f5f602018-01-10 15:57:32 +0000205 visibility = [ "*" ]
Karl Wibergbb23c832018-04-22 19:55:00 +0200206 allow_poison = [ "audio_codecs" ] # TODO(bugs.webrtc.org/8396): Remove.
kjellander6af0cbf2017-09-04 23:42:45 -0700207 sources = [
208 "event_log_visualizer/analyzer.cc",
209 "event_log_visualizer/analyzer.h",
210 "event_log_visualizer/plot_base.cc",
211 "event_log_visualizer/plot_base.h",
212 "event_log_visualizer/plot_protobuf.cc",
213 "event_log_visualizer/plot_protobuf.h",
214 "event_log_visualizer/plot_python.cc",
215 "event_log_visualizer/plot_python.h",
Bjorn Terelius2eb31882017-11-30 15:15:25 +0100216 "event_log_visualizer/triage_notifications.h",
kjellander6af0cbf2017-09-04 23:42:45 -0700217 ]
218 if (!build_with_chromium && is_clang) {
219 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
220 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
221 }
222 defines = [ "ENABLE_RTC_EVENT_LOG" ]
223 deps = [
Mirko Bonadeif5ff67c2017-12-06 16:31:18 +0100224 ":chart_proto",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100225 "../:webrtc_common",
kjellander6af0cbf2017-09-04 23:42:45 -0700226 "../call:call_interfaces",
227 "../call:video_stream_api",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100228 "../logging:rtc_event_log_api",
Qingsi Wang970b0882018-02-01 11:04:46 -0800229 "../logging:rtc_event_log_impl_base",
kjellander6af0cbf2017-09-04 23:42:45 -0700230 "../logging:rtc_event_log_parser",
Qingsi Wang970b0882018-02-01 11:04:46 -0800231 "../logging:rtc_stream_config",
kjellander6af0cbf2017-09-04 23:42:45 -0700232 "../modules:module_api",
233 "../modules/audio_coding:ana_debug_dump_proto",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100234 "../modules/audio_coding:audio_network_adaptor",
kjellander6af0cbf2017-09-04 23:42:45 -0700235 "../modules/audio_coding:neteq_tools",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100236 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100237 "../rtc_base:checks",
kjellander6af0cbf2017-09-04 23:42:45 -0700238 "../rtc_base:rtc_base_approved",
Bjorn Terelius0295a962017-10-25 17:42:41 +0200239 "../rtc_base:rtc_numerics",
Bjorn Tereliusc4ca1d32018-04-27 14:33:34 +0200240 "../rtc_base:stringutils",
kjellander6af0cbf2017-09-04 23:42:45 -0700241
242 # TODO(kwiberg): Remove this dependency.
243 "../api/audio_codecs:audio_codecs_api",
244 "../modules/congestion_controller",
Sebastian Jansson439f0bc2018-02-20 10:46:39 +0100245 "../modules/congestion_controller:delay_based_bwe",
Sebastian Jansson172fd852018-05-24 14:17:06 +0200246 "../modules/congestion_controller/goog_cc:estimators",
Niels Möllerfd6c0912017-10-31 10:19:10 +0100247 "../modules/pacing",
kjellander6af0cbf2017-09-04 23:42:45 -0700248 "../modules/rtp_rtcp",
249 "../system_wrappers:system_wrappers_default",
250 "//build/config:exe_and_shlib_deps",
251 ]
kjellander6af0cbf2017-09-04 23:42:45 -0700252 }
kjellanderd2b63cf2017-06-30 03:04:59 -0700253 }
254}
255
kjellanderd2b63cf2017-06-30 03:04:59 -0700256if (rtc_include_tests) {
257 if (rtc_enable_protobuf) {
258 rtc_executable("event_log_visualizer") {
259 testonly = true
260 sources = [
261 "event_log_visualizer/main.cc",
262 ]
263
264 if (!build_with_chromium && is_clang) {
265 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
266 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
267 }
268
269 defines = [ "ENABLE_RTC_EVENT_LOG" ]
270 deps = [
271 ":event_log_visualizer_utils",
Mirko Bonadeif5ff67c2017-12-06 16:31:18 +0100272 "../logging:rtc_event_log_parser",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100273 "../rtc_base:protobuf_utils",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700274 "../rtc_base:rtc_base_approved",
Bjorn Tereliusedab3012018-01-31 17:23:40 +0100275 "../system_wrappers:field_trial_default",
kjellanderd2b63cf2017-06-30 03:04:59 -0700276 "../test:field_trial",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100277 "../test:fileutils",
kjellanderd2b63cf2017-06-30 03:04:59 -0700278 "../test:test_support",
279 ]
280 }
281 }
282
283 rtc_executable("activity_metric") {
284 testonly = true
285 sources = [
286 "agc/activity_metric.cc",
287 ]
288
289 if (!build_with_chromium && is_clang) {
290 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
291 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
292 }
293
294 deps = [
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +0200295 "../api/audio:audio_frame_api",
kjellanderd2b63cf2017-06-30 03:04:59 -0700296 "../modules/audio_processing",
Alex Loiko0488fcf2018-02-05 11:15:23 +0100297 "../modules/audio_processing/vad",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700298 "../rtc_base:rtc_base_approved",
Karl Wiberg12edf4c2018-03-07 14:18:56 +0100299 "../rtc_base:safe_minmax",
kjellanderd2b63cf2017-06-30 03:04:59 -0700300 "../system_wrappers:metrics_default",
301 "../test:test_support",
302 "//build/win:default_exe_manifest",
303 "//testing/gtest",
304 ]
305 }
306
307 tools_unittests_resources = [
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200308 "../resources/foreman_cif.yuv",
309 "../resources/reference_less_video_test_file.y4m",
310 "../resources/video_quality_analysis_frame.txt",
kjellanderd2b63cf2017-06-30 03:04:59 -0700311 ]
312
313 if (is_ios) {
314 bundle_data("tools_unittests_bundle_data") {
315 testonly = true
316 sources = tools_unittests_resources
317 outputs = [
318 "{{bundle_resources_dir}}/{{source_file_part}}",
319 ]
320 }
321 }
322
323 rtc_test("tools_unittests") {
324 testonly = true
325
326 sources = [
327 "frame_analyzer/reference_less_video_analysis_unittest.cc",
328 "frame_analyzer/video_quality_analysis_unittest.cc",
329 "frame_editing/frame_editing_unittest.cc",
Oleh Prypin66ca7e32017-09-14 13:05:00 +0200330 "sanitizers_unittest.cc",
kjellanderd2b63cf2017-06-30 03:04:59 -0700331 "simple_command_line_parser_unittest.cc",
332 ]
333
334 # TODO(jschuh): Bug 1348: fix this warning.
335 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
336
337 if (!build_with_chromium && is_clang) {
338 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
339 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
340 }
341
342 deps = [
343 ":command_line_parser",
344 ":frame_editing_lib",
345 ":reference_less_video_analysis_lib",
346 ":video_quality_analysis",
Mirko Bonadei0250be52017-12-01 13:53:04 +0100347 "../common_video:common_video",
Oleh Prypin66ca7e32017-09-14 13:05:00 +0200348 "../rtc_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100349 "../rtc_base:checks",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100350 "../test:fileutils",
kjellanderd2b63cf2017-06-30 03:04:59 -0700351 "../test:test_main",
352 "//testing/gtest",
353 ]
354
355 if (rtc_enable_protobuf) {
356 deps += [ "network_tester:network_tester_unittests" ]
357 }
358
359 data = tools_unittests_resources
360 if (is_android) {
361 deps += [ "//testing/android/native_test:native_test_support" ]
362 shard_timeout = 900
363 }
364 if (is_ios) {
365 deps += [ ":tools_unittests_bundle_data" ]
366 }
367 }
368
369 if (rtc_enable_protobuf) {
370 copy("rtp_analyzer") {
371 sources = [
372 "py_event_log_analyzer/misc.py",
373 "py_event_log_analyzer/pb_parse.py",
374 "py_event_log_analyzer/rtp_analyzer.py",
375 "py_event_log_analyzer/rtp_analyzer.sh",
376 ]
377 outputs = [
378 "$root_build_dir/{{source_file_part}}",
379 ]
380 deps = [
381 "../logging:rtc_event_log_proto",
382 ]
Patrik Höglund844ce8b2017-12-12 15:53:31 +0100383 } # rtp_analyzer
384
385 rtc_executable("unpack_aecdump") {
Mirko Bonadeie5a93a72018-01-10 22:18:27 +0100386 visibility = [ "*" ]
Patrik Höglund844ce8b2017-12-12 15:53:31 +0100387 testonly = true
388 sources = [
389 "unpack_aecdump/unpack.cc",
390 ]
391
392 deps = [
393 "..:webrtc_common",
Patrik Höglund3e113432017-12-15 14:40:10 +0100394 "../:typedefs",
Patrik Höglund844ce8b2017-12-12 15:53:31 +0100395 "../common_audio",
396 "../modules/audio_processing",
397 "../modules/audio_processing:audioproc_debug_proto",
398 "../modules/audio_processing:audioproc_debug_proto",
399 "../modules/audio_processing:audioproc_protobuf_utils",
400 "../modules/audio_processing:audioproc_test_utils",
401 "../rtc_base:protobuf_utils",
402 "../rtc_base:rtc_base_approved",
403 "../system_wrappers:system_wrappers_default",
404 ]
405 } # unpack_aecdump
kjellanderd2b63cf2017-06-30 03:04:59 -0700406 }
407}