blob: 840d221b8b6532735cb802d3b0ae074734743ca3 [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 Bonadeic3da1e62017-12-05 11:25:29 +010068 # TODO(bugs.webrtc.org/6828): api:optional should be a dependency
69 # of rtc_base:rtc_base_approved_generic but that causes a circular
70 # dependency. In order to fix the chromium build on MSVC64 (dbg)
71 # this dependency has to be added here so the linker can find the
72 # symbols it needs.
73 "../api:optional",
Mirko Bonadeif5ff67c2017-12-06 16:31:18 +010074 "../common_video",
Mirko Bonadei401d0562017-12-14 11:24:00 +010075 "//third_party/libyuv",
kjellanderd2b63cf2017-06-30 03:04:59 -070076 ]
77}
78
79rtc_executable("frame_analyzer") {
80 sources = [
81 "frame_analyzer/frame_analyzer.cc",
82 ]
83
84 deps = [
85 ":command_line_parser",
86 ":video_quality_analysis",
87 "//build/win:default_exe_manifest",
88 ]
89}
90
kjellander6af0cbf2017-09-04 23:42:45 -070091# Only expose the targets needed by Chromium (e.g. frame_analyzer) to avoid
92# building a lot of redundant code as part of Chromium builds.
93if (!build_with_chromium) {
94 rtc_executable("psnr_ssim_analyzer") {
kjellanderd2b63cf2017-06-30 03:04:59 -070095 sources = [
kjellander6af0cbf2017-09-04 23:42:45 -070096 "psnr_ssim_analyzer/psnr_ssim_analyzer.cc",
kjellanderd2b63cf2017-06-30 03:04:59 -070097 ]
98
kjellanderd2b63cf2017-06-30 03:04:59 -070099 deps = [
kjellander6af0cbf2017-09-04 23:42:45 -0700100 ":command_line_parser",
101 ":video_quality_analysis",
kjellanderd2b63cf2017-06-30 03:04:59 -0700102 "//build/win:default_exe_manifest",
103 ]
104 }
kjellanderd2b63cf2017-06-30 03:04:59 -0700105
kjellander6af0cbf2017-09-04 23:42:45 -0700106 rtc_static_library("reference_less_video_analysis_lib") {
kjellanderd2b63cf2017-06-30 03:04:59 -0700107 sources = [
kjellander6af0cbf2017-09-04 23:42:45 -0700108 "frame_analyzer/reference_less_video_analysis_lib.cc",
109 "frame_analyzer/reference_less_video_analysis_lib.h",
kjellanderd2b63cf2017-06-30 03:04:59 -0700110 ]
kjellander6af0cbf2017-09-04 23:42:45 -0700111
112 deps = [
113 ":video_quality_analysis",
114 ]
kjellanderd2b63cf2017-06-30 03:04:59 -0700115 }
116
kjellander6af0cbf2017-09-04 23:42:45 -0700117 rtc_executable("reference_less_video_analysis") {
kjellanderd2b63cf2017-06-30 03:04:59 -0700118 sources = [
kjellander6af0cbf2017-09-04 23:42:45 -0700119 "frame_analyzer/reference_less_video_analysis.cc",
kjellanderd2b63cf2017-06-30 03:04:59 -0700120 ]
kjellander6af0cbf2017-09-04 23:42:45 -0700121
122 deps = [
123 ":command_line_parser",
124 ":reference_less_video_analysis_lib",
125 "//build/win:default_exe_manifest",
126 ]
127 }
128
129 rtc_executable("rgba_to_i420_converter") {
130 sources = [
131 "converter/converter.cc",
132 "converter/converter.h",
133 "converter/rgba_to_i420_converter.cc",
134 ]
135
136 deps = [
137 ":command_line_parser",
138 "../common_video",
139 "//build/win:default_exe_manifest",
Mirko Bonadei401d0562017-12-14 11:24:00 +0100140 "//third_party/libyuv",
kjellander6af0cbf2017-09-04 23:42:45 -0700141 ]
142 }
143
144 rtc_static_library("frame_editing_lib") {
145 sources = [
146 "frame_editing/frame_editing_lib.cc",
147 "frame_editing/frame_editing_lib.h",
148 ]
149
150 # TODO(jschuh): Bug 1348: fix this warning.
151 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
152
kjellanderd2b63cf2017-06-30 03:04:59 -0700153 if (!build_with_chromium && is_clang) {
154 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
155 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
156 }
kjellanderd2b63cf2017-06-30 03:04:59 -0700157
kjellander6af0cbf2017-09-04 23:42:45 -0700158 deps = [
159 "..:webrtc_common",
Patrik Höglund3e113432017-12-15 14:40:10 +0100160 "../:typedefs",
kjellander6af0cbf2017-09-04 23:42:45 -0700161 "../common_video",
kjellanderd2b63cf2017-06-30 03:04:59 -0700162 ]
kjellander6af0cbf2017-09-04 23:42:45 -0700163 }
164
165 rtc_executable("frame_editor") {
166 sources = [
167 "frame_editing/frame_editing.cc",
kjellanderd2b63cf2017-06-30 03:04:59 -0700168 ]
kjellander6af0cbf2017-09-04 23:42:45 -0700169
170 deps = [
171 ":command_line_parser",
172 ":frame_editing_lib",
173 "//build/win:default_exe_manifest",
174 ]
175 }
176
177 # It doesn't make sense to build this tool without the ADM enabled.
178 if (rtc_include_internal_audio_device) {
179 rtc_executable("force_mic_volume_max") {
180 sources = [
181 "force_mic_volume_max/force_mic_volume_max.cc",
182 ]
183
184 if (!build_with_chromium && is_clang) {
185 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
186 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
187 }
188
189 deps = [
190 "../modules/audio_device",
191 "../system_wrappers:system_wrappers_default",
192 "//build/win:default_exe_manifest",
193 ]
194 }
195 }
196
197 if (rtc_enable_protobuf) {
198 proto_library("chart_proto") {
199 sources = [
200 "event_log_visualizer/chart.proto",
201 ]
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200202 proto_out_dir = "rtc_tools/event_log_visualizer"
kjellander6af0cbf2017-09-04 23:42:45 -0700203 }
204
205 rtc_static_library("event_log_visualizer_utils") {
206 sources = [
207 "event_log_visualizer/analyzer.cc",
208 "event_log_visualizer/analyzer.h",
209 "event_log_visualizer/plot_base.cc",
210 "event_log_visualizer/plot_base.h",
211 "event_log_visualizer/plot_protobuf.cc",
212 "event_log_visualizer/plot_protobuf.h",
213 "event_log_visualizer/plot_python.cc",
214 "event_log_visualizer/plot_python.h",
Bjorn Terelius2eb31882017-11-30 15:15:25 +0100215 "event_log_visualizer/triage_notifications.h",
kjellander6af0cbf2017-09-04 23:42:45 -0700216 ]
217 if (!build_with_chromium && is_clang) {
218 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
219 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
220 }
221 defines = [ "ENABLE_RTC_EVENT_LOG" ]
222 deps = [
Mirko Bonadeif5ff67c2017-12-06 16:31:18 +0100223 ":chart_proto",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100224 "../:webrtc_common",
kjellander6af0cbf2017-09-04 23:42:45 -0700225 "../call:call_interfaces",
226 "../call:video_stream_api",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100227 "../logging:rtc_event_log_api",
kjellander6af0cbf2017-09-04 23:42:45 -0700228 "../logging:rtc_event_log_impl",
229 "../logging:rtc_event_log_parser",
230 "../modules:module_api",
231 "../modules/audio_coding:ana_debug_dump_proto",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100232 "../modules/audio_coding:audio_network_adaptor",
kjellander6af0cbf2017-09-04 23:42:45 -0700233 "../modules/audio_coding:neteq_tools",
Patrik Höglund76134542018-01-02 09:15:05 +0100234 "../modules/congestion_controller:estimators",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100235 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100236 "../rtc_base:checks",
kjellander6af0cbf2017-09-04 23:42:45 -0700237 "../rtc_base:rtc_base_approved",
Bjorn Terelius0295a962017-10-25 17:42:41 +0200238 "../rtc_base:rtc_numerics",
kjellander6af0cbf2017-09-04 23:42:45 -0700239
240 # TODO(kwiberg): Remove this dependency.
241 "../api/audio_codecs:audio_codecs_api",
242 "../modules/congestion_controller",
Niels Möllerfd6c0912017-10-31 10:19:10 +0100243 "../modules/pacing",
kjellander6af0cbf2017-09-04 23:42:45 -0700244 "../modules/rtp_rtcp",
245 "../system_wrappers:system_wrappers_default",
246 "//build/config:exe_and_shlib_deps",
247 ]
kjellander6af0cbf2017-09-04 23:42:45 -0700248 }
kjellanderd2b63cf2017-06-30 03:04:59 -0700249 }
250}
251
kjellanderd2b63cf2017-06-30 03:04:59 -0700252if (rtc_include_tests) {
253 if (rtc_enable_protobuf) {
254 rtc_executable("event_log_visualizer") {
255 testonly = true
256 sources = [
257 "event_log_visualizer/main.cc",
258 ]
259
260 if (!build_with_chromium && is_clang) {
261 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
262 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
263 }
264
265 defines = [ "ENABLE_RTC_EVENT_LOG" ]
266 deps = [
267 ":event_log_visualizer_utils",
Mirko Bonadeif5ff67c2017-12-06 16:31:18 +0100268 "../logging:rtc_event_log_parser",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100269 "../rtc_base:protobuf_utils",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700270 "../rtc_base:rtc_base_approved",
kjellanderd2b63cf2017-06-30 03:04:59 -0700271 "../test:field_trial",
272 "../test:test_support",
273 ]
274 }
275 }
276
277 rtc_executable("activity_metric") {
278 testonly = true
279 sources = [
280 "agc/activity_metric.cc",
281 ]
282
283 if (!build_with_chromium && is_clang) {
284 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
285 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
286 }
287
288 deps = [
kjellanderd2b63cf2017-06-30 03:04:59 -0700289 "../modules:module_api",
290 "../modules/audio_processing",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700291 "../rtc_base:rtc_base_approved",
kjellanderd2b63cf2017-06-30 03:04:59 -0700292 "../system_wrappers:metrics_default",
293 "../test:test_support",
294 "//build/win:default_exe_manifest",
295 "//testing/gtest",
296 ]
297 }
298
299 tools_unittests_resources = [
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200300 "../resources/foreman_cif.yuv",
301 "../resources/reference_less_video_test_file.y4m",
302 "../resources/video_quality_analysis_frame.txt",
kjellanderd2b63cf2017-06-30 03:04:59 -0700303 ]
304
305 if (is_ios) {
306 bundle_data("tools_unittests_bundle_data") {
307 testonly = true
308 sources = tools_unittests_resources
309 outputs = [
310 "{{bundle_resources_dir}}/{{source_file_part}}",
311 ]
312 }
313 }
314
315 rtc_test("tools_unittests") {
316 testonly = true
317
318 sources = [
319 "frame_analyzer/reference_less_video_analysis_unittest.cc",
320 "frame_analyzer/video_quality_analysis_unittest.cc",
321 "frame_editing/frame_editing_unittest.cc",
Oleh Prypin66ca7e32017-09-14 13:05:00 +0200322 "sanitizers_unittest.cc",
kjellanderd2b63cf2017-06-30 03:04:59 -0700323 "simple_command_line_parser_unittest.cc",
324 ]
325
326 # TODO(jschuh): Bug 1348: fix this warning.
327 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
328
329 if (!build_with_chromium && is_clang) {
330 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
331 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
332 }
333
334 deps = [
335 ":command_line_parser",
336 ":frame_editing_lib",
337 ":reference_less_video_analysis_lib",
338 ":video_quality_analysis",
Mirko Bonadei0250be52017-12-01 13:53:04 +0100339 "../common_video:common_video",
Oleh Prypin66ca7e32017-09-14 13:05:00 +0200340 "../rtc_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100341 "../rtc_base:checks",
kjellanderd2b63cf2017-06-30 03:04:59 -0700342 "../test:test_main",
343 "//testing/gtest",
344 ]
345
346 if (rtc_enable_protobuf) {
347 deps += [ "network_tester:network_tester_unittests" ]
348 }
349
350 data = tools_unittests_resources
351 if (is_android) {
352 deps += [ "//testing/android/native_test:native_test_support" ]
353 shard_timeout = 900
354 }
355 if (is_ios) {
356 deps += [ ":tools_unittests_bundle_data" ]
357 }
358 }
359
360 if (rtc_enable_protobuf) {
361 copy("rtp_analyzer") {
362 sources = [
363 "py_event_log_analyzer/misc.py",
364 "py_event_log_analyzer/pb_parse.py",
365 "py_event_log_analyzer/rtp_analyzer.py",
366 "py_event_log_analyzer/rtp_analyzer.sh",
367 ]
368 outputs = [
369 "$root_build_dir/{{source_file_part}}",
370 ]
371 deps = [
372 "../logging:rtc_event_log_proto",
373 ]
Patrik Höglund844ce8b2017-12-12 15:53:31 +0100374 } # rtp_analyzer
375
376 rtc_executable("unpack_aecdump") {
377 testonly = true
378 sources = [
379 "unpack_aecdump/unpack.cc",
380 ]
381
382 deps = [
383 "..:webrtc_common",
Patrik Höglund3e113432017-12-15 14:40:10 +0100384 "../:typedefs",
Patrik Höglund844ce8b2017-12-12 15:53:31 +0100385 "../common_audio",
386 "../modules/audio_processing",
387 "../modules/audio_processing:audioproc_debug_proto",
388 "../modules/audio_processing:audioproc_debug_proto",
389 "../modules/audio_processing:audioproc_protobuf_utils",
390 "../modules/audio_processing:audioproc_test_utils",
391 "../rtc_base:protobuf_utils",
392 "../rtc_base:rtc_base_approved",
393 "../system_wrappers:system_wrappers_default",
394 ]
395 } # unpack_aecdump
kjellanderd2b63cf2017-06-30 03:04:59 -0700396 }
397}