blob: 84c1d9ec631035c2ff03d43911392dd59fcb8719 [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 = [
68 "$rtc_libyuv_dir",
Mirko Bonadeic3da1e62017-12-05 11:25:29 +010069
70 # TODO(bugs.webrtc.org/6828): api:optional should be a dependency
71 # of rtc_base:rtc_base_approved_generic but that causes a circular
72 # dependency. In order to fix the chromium build on MSVC64 (dbg)
73 # this dependency has to be added here so the linker can find the
74 # symbols it needs.
75 "../api:optional",
Mirko Bonadeif5ff67c2017-12-06 16:31:18 +010076 "../common_video",
kjellanderd2b63cf2017-06-30 03:04:59 -070077 ]
78}
79
80rtc_executable("frame_analyzer") {
81 sources = [
82 "frame_analyzer/frame_analyzer.cc",
83 ]
84
85 deps = [
86 ":command_line_parser",
87 ":video_quality_analysis",
Mirko Bonadei0250be52017-12-01 13:53:04 +010088 "$rtc_libyuv_dir",
kjellanderd2b63cf2017-06-30 03:04:59 -070089 "//build/win:default_exe_manifest",
90 ]
91}
92
kjellander6af0cbf2017-09-04 23:42:45 -070093# Only expose the targets needed by Chromium (e.g. frame_analyzer) to avoid
94# building a lot of redundant code as part of Chromium builds.
95if (!build_with_chromium) {
96 rtc_executable("psnr_ssim_analyzer") {
kjellanderd2b63cf2017-06-30 03:04:59 -070097 sources = [
kjellander6af0cbf2017-09-04 23:42:45 -070098 "psnr_ssim_analyzer/psnr_ssim_analyzer.cc",
kjellanderd2b63cf2017-06-30 03:04:59 -070099 ]
100
kjellanderd2b63cf2017-06-30 03:04:59 -0700101 deps = [
kjellander6af0cbf2017-09-04 23:42:45 -0700102 ":command_line_parser",
103 ":video_quality_analysis",
Mirko Bonadei0250be52017-12-01 13:53:04 +0100104 "$rtc_libyuv_dir",
kjellanderd2b63cf2017-06-30 03:04:59 -0700105 "//build/win:default_exe_manifest",
106 ]
107 }
kjellanderd2b63cf2017-06-30 03:04:59 -0700108
kjellander6af0cbf2017-09-04 23:42:45 -0700109 rtc_static_library("reference_less_video_analysis_lib") {
kjellanderd2b63cf2017-06-30 03:04:59 -0700110 sources = [
kjellander6af0cbf2017-09-04 23:42:45 -0700111 "frame_analyzer/reference_less_video_analysis_lib.cc",
112 "frame_analyzer/reference_less_video_analysis_lib.h",
kjellanderd2b63cf2017-06-30 03:04:59 -0700113 ]
kjellander6af0cbf2017-09-04 23:42:45 -0700114
115 deps = [
116 ":video_quality_analysis",
Mirko Bonadei0250be52017-12-01 13:53:04 +0100117 "$rtc_libyuv_dir",
kjellander6af0cbf2017-09-04 23:42:45 -0700118 ]
kjellanderd2b63cf2017-06-30 03:04:59 -0700119 }
120
kjellander6af0cbf2017-09-04 23:42:45 -0700121 rtc_executable("reference_less_video_analysis") {
kjellanderd2b63cf2017-06-30 03:04:59 -0700122 sources = [
kjellander6af0cbf2017-09-04 23:42:45 -0700123 "frame_analyzer/reference_less_video_analysis.cc",
kjellanderd2b63cf2017-06-30 03:04:59 -0700124 ]
kjellander6af0cbf2017-09-04 23:42:45 -0700125
126 deps = [
127 ":command_line_parser",
128 ":reference_less_video_analysis_lib",
129 "//build/win:default_exe_manifest",
130 ]
131 }
132
133 rtc_executable("rgba_to_i420_converter") {
134 sources = [
135 "converter/converter.cc",
136 "converter/converter.h",
137 "converter/rgba_to_i420_converter.cc",
138 ]
139
140 deps = [
141 ":command_line_parser",
Mirko Bonadei0250be52017-12-01 13:53:04 +0100142 "$rtc_libyuv_dir",
kjellander6af0cbf2017-09-04 23:42:45 -0700143 "../common_video",
144 "//build/win:default_exe_manifest",
145 ]
146 }
147
148 rtc_static_library("frame_editing_lib") {
149 sources = [
150 "frame_editing/frame_editing_lib.cc",
151 "frame_editing/frame_editing_lib.h",
152 ]
153
154 # TODO(jschuh): Bug 1348: fix this warning.
155 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
156
kjellanderd2b63cf2017-06-30 03:04:59 -0700157 if (!build_with_chromium && is_clang) {
158 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
159 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
160 }
kjellanderd2b63cf2017-06-30 03:04:59 -0700161
kjellander6af0cbf2017-09-04 23:42:45 -0700162 deps = [
163 "..:webrtc_common",
164 "../common_video",
kjellanderd2b63cf2017-06-30 03:04:59 -0700165 ]
kjellander6af0cbf2017-09-04 23:42:45 -0700166 }
167
168 rtc_executable("frame_editor") {
169 sources = [
170 "frame_editing/frame_editing.cc",
kjellanderd2b63cf2017-06-30 03:04:59 -0700171 ]
kjellander6af0cbf2017-09-04 23:42:45 -0700172
173 deps = [
174 ":command_line_parser",
175 ":frame_editing_lib",
176 "//build/win:default_exe_manifest",
177 ]
178 }
179
180 # It doesn't make sense to build this tool without the ADM enabled.
181 if (rtc_include_internal_audio_device) {
182 rtc_executable("force_mic_volume_max") {
183 sources = [
184 "force_mic_volume_max/force_mic_volume_max.cc",
185 ]
186
187 if (!build_with_chromium && is_clang) {
188 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
189 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
190 }
191
192 deps = [
193 "../modules/audio_device",
194 "../system_wrappers:system_wrappers_default",
195 "//build/win:default_exe_manifest",
196 ]
197 }
198 }
199
200 if (rtc_enable_protobuf) {
201 proto_library("chart_proto") {
202 sources = [
203 "event_log_visualizer/chart.proto",
204 ]
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200205 proto_out_dir = "rtc_tools/event_log_visualizer"
kjellander6af0cbf2017-09-04 23:42:45 -0700206 }
207
208 rtc_static_library("event_log_visualizer_utils") {
209 sources = [
210 "event_log_visualizer/analyzer.cc",
211 "event_log_visualizer/analyzer.h",
212 "event_log_visualizer/plot_base.cc",
213 "event_log_visualizer/plot_base.h",
214 "event_log_visualizer/plot_protobuf.cc",
215 "event_log_visualizer/plot_protobuf.h",
216 "event_log_visualizer/plot_python.cc",
217 "event_log_visualizer/plot_python.h",
Bjorn Terelius2eb31882017-11-30 15:15:25 +0100218 "event_log_visualizer/triage_notifications.h",
kjellander6af0cbf2017-09-04 23:42:45 -0700219 ]
220 if (!build_with_chromium && is_clang) {
221 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
222 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
223 }
224 defines = [ "ENABLE_RTC_EVENT_LOG" ]
225 deps = [
Mirko Bonadeif5ff67c2017-12-06 16:31:18 +0100226 ":chart_proto",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100227 "../:webrtc_common",
kjellander6af0cbf2017-09-04 23:42:45 -0700228 "../call:call_interfaces",
229 "../call:video_stream_api",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100230 "../logging:rtc_event_log_api",
kjellander6af0cbf2017-09-04 23:42:45 -0700231 "../logging:rtc_event_log_impl",
232 "../logging:rtc_event_log_parser",
233 "../modules:module_api",
234 "../modules/audio_coding:ana_debug_dump_proto",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100235 "../modules/audio_coding:audio_network_adaptor",
kjellander6af0cbf2017-09-04 23:42:45 -0700236 "../modules/audio_coding:neteq_tools",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100237 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100238 "../rtc_base:checks",
kjellander6af0cbf2017-09-04 23:42:45 -0700239 "../rtc_base:rtc_base_approved",
Bjorn Terelius0295a962017-10-25 17:42:41 +0200240 "../rtc_base:rtc_numerics",
kjellander6af0cbf2017-09-04 23:42:45 -0700241
242 # TODO(kwiberg): Remove this dependency.
243 "../api/audio_codecs:audio_codecs_api",
244 "../modules/congestion_controller",
Niels Möllerfd6c0912017-10-31 10:19:10 +0100245 "../modules/pacing",
kjellander6af0cbf2017-09-04 23:42:45 -0700246 "../modules/rtp_rtcp",
247 "../system_wrappers:system_wrappers_default",
248 "//build/config:exe_and_shlib_deps",
249 ]
kjellander6af0cbf2017-09-04 23:42:45 -0700250 }
kjellanderd2b63cf2017-06-30 03:04:59 -0700251 }
252}
253
kjellanderd2b63cf2017-06-30 03:04:59 -0700254if (rtc_include_tests) {
255 if (rtc_enable_protobuf) {
256 rtc_executable("event_log_visualizer") {
257 testonly = true
258 sources = [
259 "event_log_visualizer/main.cc",
260 ]
261
262 if (!build_with_chromium && is_clang) {
263 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
264 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
265 }
266
267 defines = [ "ENABLE_RTC_EVENT_LOG" ]
268 deps = [
269 ":event_log_visualizer_utils",
Mirko Bonadeif5ff67c2017-12-06 16:31:18 +0100270 "../logging:rtc_event_log_parser",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100271 "../rtc_base:protobuf_utils",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700272 "../rtc_base:rtc_base_approved",
kjellanderd2b63cf2017-06-30 03:04:59 -0700273 "../test:field_trial",
274 "../test:test_support",
275 ]
276 }
277 }
278
279 rtc_executable("activity_metric") {
280 testonly = true
281 sources = [
282 "agc/activity_metric.cc",
283 ]
284
285 if (!build_with_chromium && is_clang) {
286 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
287 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
288 }
289
290 deps = [
kjellanderd2b63cf2017-06-30 03:04:59 -0700291 "../modules:module_api",
292 "../modules/audio_processing",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700293 "../rtc_base:rtc_base_approved",
kjellanderd2b63cf2017-06-30 03:04:59 -0700294 "../system_wrappers:metrics_default",
295 "../test:test_support",
296 "//build/win:default_exe_manifest",
297 "//testing/gtest",
298 ]
299 }
300
301 tools_unittests_resources = [
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200302 "../resources/foreman_cif.yuv",
303 "../resources/reference_less_video_test_file.y4m",
304 "../resources/video_quality_analysis_frame.txt",
kjellanderd2b63cf2017-06-30 03:04:59 -0700305 ]
306
307 if (is_ios) {
308 bundle_data("tools_unittests_bundle_data") {
309 testonly = true
310 sources = tools_unittests_resources
311 outputs = [
312 "{{bundle_resources_dir}}/{{source_file_part}}",
313 ]
314 }
315 }
316
317 rtc_test("tools_unittests") {
318 testonly = true
319
320 sources = [
321 "frame_analyzer/reference_less_video_analysis_unittest.cc",
322 "frame_analyzer/video_quality_analysis_unittest.cc",
323 "frame_editing/frame_editing_unittest.cc",
Oleh Prypin66ca7e32017-09-14 13:05:00 +0200324 "sanitizers_unittest.cc",
kjellanderd2b63cf2017-06-30 03:04:59 -0700325 "simple_command_line_parser_unittest.cc",
326 ]
327
328 # TODO(jschuh): Bug 1348: fix this warning.
329 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
330
331 if (!build_with_chromium && is_clang) {
332 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
333 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
334 }
335
336 deps = [
337 ":command_line_parser",
338 ":frame_editing_lib",
339 ":reference_less_video_analysis_lib",
340 ":video_quality_analysis",
Mirko Bonadei0250be52017-12-01 13:53:04 +0100341 "$rtc_libyuv_dir",
342 "../common_video:common_video",
Oleh Prypin66ca7e32017-09-14 13:05:00 +0200343 "../rtc_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100344 "../rtc_base:checks",
kjellanderd2b63cf2017-06-30 03:04:59 -0700345 "../test:test_main",
346 "//testing/gtest",
347 ]
348
349 if (rtc_enable_protobuf) {
350 deps += [ "network_tester:network_tester_unittests" ]
351 }
352
353 data = tools_unittests_resources
354 if (is_android) {
355 deps += [ "//testing/android/native_test:native_test_support" ]
356 shard_timeout = 900
357 }
358 if (is_ios) {
359 deps += [ ":tools_unittests_bundle_data" ]
360 }
361 }
362
363 if (rtc_enable_protobuf) {
364 copy("rtp_analyzer") {
365 sources = [
366 "py_event_log_analyzer/misc.py",
367 "py_event_log_analyzer/pb_parse.py",
368 "py_event_log_analyzer/rtp_analyzer.py",
369 "py_event_log_analyzer/rtp_analyzer.sh",
370 ]
371 outputs = [
372 "$root_build_dir/{{source_file_part}}",
373 ]
374 deps = [
375 "../logging:rtc_event_log_proto",
376 ]
Patrik Höglund844ce8b2017-12-12 15:53:31 +0100377 } # rtp_analyzer
378
379 rtc_executable("unpack_aecdump") {
380 testonly = true
381 sources = [
382 "unpack_aecdump/unpack.cc",
383 ]
384
385 deps = [
386 "..:webrtc_common",
387 "../common_audio",
388 "../modules/audio_processing",
389 "../modules/audio_processing:audioproc_debug_proto",
390 "../modules/audio_processing:audioproc_debug_proto",
391 "../modules/audio_processing:audioproc_protobuf_utils",
392 "../modules/audio_processing:audioproc_test_utils",
393 "../rtc_base:protobuf_utils",
394 "../rtc_base:rtc_base_approved",
395 "../system_wrappers:system_wrappers_default",
396 ]
397 } # unpack_aecdump
kjellanderd2b63cf2017-06-30 03:04:59 -0700398 }
399}