blob: 8a04b14138ae1b92282ce5f555b939d9357ab73b [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",
Mirko Bonadei401d0562017-12-14 11:24:00 +010069 "//third_party/libyuv",
kjellanderd2b63cf2017-06-30 03:04:59 -070070 ]
71}
72
73rtc_executable("frame_analyzer") {
74 sources = [
75 "frame_analyzer/frame_analyzer.cc",
76 ]
77
78 deps = [
79 ":command_line_parser",
80 ":video_quality_analysis",
81 "//build/win:default_exe_manifest",
82 ]
83}
84
kjellander6af0cbf2017-09-04 23:42:45 -070085# Only expose the targets needed by Chromium (e.g. frame_analyzer) to avoid
86# building a lot of redundant code as part of Chromium builds.
87if (!build_with_chromium) {
88 rtc_executable("psnr_ssim_analyzer") {
kjellanderd2b63cf2017-06-30 03:04:59 -070089 sources = [
kjellander6af0cbf2017-09-04 23:42:45 -070090 "psnr_ssim_analyzer/psnr_ssim_analyzer.cc",
kjellanderd2b63cf2017-06-30 03:04:59 -070091 ]
92
kjellanderd2b63cf2017-06-30 03:04:59 -070093 deps = [
kjellander6af0cbf2017-09-04 23:42:45 -070094 ":command_line_parser",
95 ":video_quality_analysis",
kjellanderd2b63cf2017-06-30 03:04:59 -070096 "//build/win:default_exe_manifest",
97 ]
98 }
kjellanderd2b63cf2017-06-30 03:04:59 -070099
kjellander6af0cbf2017-09-04 23:42:45 -0700100 rtc_static_library("reference_less_video_analysis_lib") {
kjellanderd2b63cf2017-06-30 03:04:59 -0700101 sources = [
kjellander6af0cbf2017-09-04 23:42:45 -0700102 "frame_analyzer/reference_less_video_analysis_lib.cc",
103 "frame_analyzer/reference_less_video_analysis_lib.h",
kjellanderd2b63cf2017-06-30 03:04:59 -0700104 ]
kjellander6af0cbf2017-09-04 23:42:45 -0700105
106 deps = [
107 ":video_quality_analysis",
108 ]
kjellanderd2b63cf2017-06-30 03:04:59 -0700109 }
110
kjellander6af0cbf2017-09-04 23:42:45 -0700111 rtc_executable("reference_less_video_analysis") {
kjellanderd2b63cf2017-06-30 03:04:59 -0700112 sources = [
kjellander6af0cbf2017-09-04 23:42:45 -0700113 "frame_analyzer/reference_less_video_analysis.cc",
kjellanderd2b63cf2017-06-30 03:04:59 -0700114 ]
kjellander6af0cbf2017-09-04 23:42:45 -0700115
116 deps = [
117 ":command_line_parser",
118 ":reference_less_video_analysis_lib",
119 "//build/win:default_exe_manifest",
120 ]
121 }
122
123 rtc_executable("rgba_to_i420_converter") {
124 sources = [
125 "converter/converter.cc",
126 "converter/converter.h",
127 "converter/rgba_to_i420_converter.cc",
128 ]
129
130 deps = [
131 ":command_line_parser",
132 "../common_video",
133 "//build/win:default_exe_manifest",
Mirko Bonadei401d0562017-12-14 11:24:00 +0100134 "//third_party/libyuv",
kjellander6af0cbf2017-09-04 23:42:45 -0700135 ]
136 }
137
138 rtc_static_library("frame_editing_lib") {
139 sources = [
140 "frame_editing/frame_editing_lib.cc",
141 "frame_editing/frame_editing_lib.h",
142 ]
143
144 # TODO(jschuh): Bug 1348: fix this warning.
145 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
146
kjellanderd2b63cf2017-06-30 03:04:59 -0700147 if (!build_with_chromium && is_clang) {
148 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
149 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
150 }
kjellanderd2b63cf2017-06-30 03:04:59 -0700151
kjellander6af0cbf2017-09-04 23:42:45 -0700152 deps = [
153 "..:webrtc_common",
Patrik Höglund3e113432017-12-15 14:40:10 +0100154 "../:typedefs",
kjellander6af0cbf2017-09-04 23:42:45 -0700155 "../common_video",
kjellanderd2b63cf2017-06-30 03:04:59 -0700156 ]
kjellander6af0cbf2017-09-04 23:42:45 -0700157 }
158
159 rtc_executable("frame_editor") {
160 sources = [
161 "frame_editing/frame_editing.cc",
kjellanderd2b63cf2017-06-30 03:04:59 -0700162 ]
kjellander6af0cbf2017-09-04 23:42:45 -0700163
164 deps = [
165 ":command_line_parser",
166 ":frame_editing_lib",
167 "//build/win:default_exe_manifest",
168 ]
169 }
170
171 # It doesn't make sense to build this tool without the ADM enabled.
172 if (rtc_include_internal_audio_device) {
173 rtc_executable("force_mic_volume_max") {
174 sources = [
175 "force_mic_volume_max/force_mic_volume_max.cc",
176 ]
177
178 if (!build_with_chromium && is_clang) {
179 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
180 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
181 }
182
183 deps = [
184 "../modules/audio_device",
185 "../system_wrappers:system_wrappers_default",
186 "//build/win:default_exe_manifest",
187 ]
188 }
189 }
190
191 if (rtc_enable_protobuf) {
192 proto_library("chart_proto") {
193 sources = [
194 "event_log_visualizer/chart.proto",
195 ]
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200196 proto_out_dir = "rtc_tools/event_log_visualizer"
kjellander6af0cbf2017-09-04 23:42:45 -0700197 }
198
199 rtc_static_library("event_log_visualizer_utils") {
200 sources = [
201 "event_log_visualizer/analyzer.cc",
202 "event_log_visualizer/analyzer.h",
203 "event_log_visualizer/plot_base.cc",
204 "event_log_visualizer/plot_base.h",
205 "event_log_visualizer/plot_protobuf.cc",
206 "event_log_visualizer/plot_protobuf.h",
207 "event_log_visualizer/plot_python.cc",
208 "event_log_visualizer/plot_python.h",
Bjorn Terelius2eb31882017-11-30 15:15:25 +0100209 "event_log_visualizer/triage_notifications.h",
kjellander6af0cbf2017-09-04 23:42:45 -0700210 ]
211 if (!build_with_chromium && is_clang) {
212 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
213 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
214 }
215 defines = [ "ENABLE_RTC_EVENT_LOG" ]
216 deps = [
Mirko Bonadeif5ff67c2017-12-06 16:31:18 +0100217 ":chart_proto",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100218 "../:webrtc_common",
kjellander6af0cbf2017-09-04 23:42:45 -0700219 "../call:call_interfaces",
220 "../call:video_stream_api",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100221 "../logging:rtc_event_log_api",
kjellander6af0cbf2017-09-04 23:42:45 -0700222 "../logging:rtc_event_log_impl",
223 "../logging:rtc_event_log_parser",
224 "../modules:module_api",
225 "../modules/audio_coding:ana_debug_dump_proto",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100226 "../modules/audio_coding:audio_network_adaptor",
kjellander6af0cbf2017-09-04 23:42:45 -0700227 "../modules/audio_coding:neteq_tools",
Patrik Höglund76134542018-01-02 09:15:05 +0100228 "../modules/congestion_controller:estimators",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100229 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100230 "../rtc_base:checks",
kjellander6af0cbf2017-09-04 23:42:45 -0700231 "../rtc_base:rtc_base_approved",
Bjorn Terelius0295a962017-10-25 17:42:41 +0200232 "../rtc_base:rtc_numerics",
kjellander6af0cbf2017-09-04 23:42:45 -0700233
234 # TODO(kwiberg): Remove this dependency.
235 "../api/audio_codecs:audio_codecs_api",
236 "../modules/congestion_controller",
Niels Möllerfd6c0912017-10-31 10:19:10 +0100237 "../modules/pacing",
kjellander6af0cbf2017-09-04 23:42:45 -0700238 "../modules/rtp_rtcp",
239 "../system_wrappers:system_wrappers_default",
240 "//build/config:exe_and_shlib_deps",
241 ]
kjellander6af0cbf2017-09-04 23:42:45 -0700242 }
kjellanderd2b63cf2017-06-30 03:04:59 -0700243 }
244}
245
kjellanderd2b63cf2017-06-30 03:04:59 -0700246if (rtc_include_tests) {
247 if (rtc_enable_protobuf) {
248 rtc_executable("event_log_visualizer") {
249 testonly = true
250 sources = [
251 "event_log_visualizer/main.cc",
252 ]
253
254 if (!build_with_chromium && is_clang) {
255 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
256 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
257 }
258
259 defines = [ "ENABLE_RTC_EVENT_LOG" ]
260 deps = [
261 ":event_log_visualizer_utils",
Mirko Bonadeif5ff67c2017-12-06 16:31:18 +0100262 "../logging:rtc_event_log_parser",
Mirko Bonadei818d9102017-12-12 12:46:13 +0100263 "../rtc_base:protobuf_utils",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700264 "../rtc_base:rtc_base_approved",
kjellanderd2b63cf2017-06-30 03:04:59 -0700265 "../test:field_trial",
266 "../test:test_support",
267 ]
268 }
269 }
270
271 rtc_executable("activity_metric") {
272 testonly = true
273 sources = [
274 "agc/activity_metric.cc",
275 ]
276
277 if (!build_with_chromium && is_clang) {
278 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
279 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
280 }
281
282 deps = [
kjellanderd2b63cf2017-06-30 03:04:59 -0700283 "../modules:module_api",
284 "../modules/audio_processing",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700285 "../rtc_base:rtc_base_approved",
kjellanderd2b63cf2017-06-30 03:04:59 -0700286 "../system_wrappers:metrics_default",
287 "../test:test_support",
288 "//build/win:default_exe_manifest",
289 "//testing/gtest",
290 ]
291 }
292
293 tools_unittests_resources = [
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200294 "../resources/foreman_cif.yuv",
295 "../resources/reference_less_video_test_file.y4m",
296 "../resources/video_quality_analysis_frame.txt",
kjellanderd2b63cf2017-06-30 03:04:59 -0700297 ]
298
299 if (is_ios) {
300 bundle_data("tools_unittests_bundle_data") {
301 testonly = true
302 sources = tools_unittests_resources
303 outputs = [
304 "{{bundle_resources_dir}}/{{source_file_part}}",
305 ]
306 }
307 }
308
309 rtc_test("tools_unittests") {
310 testonly = true
311
312 sources = [
313 "frame_analyzer/reference_less_video_analysis_unittest.cc",
314 "frame_analyzer/video_quality_analysis_unittest.cc",
315 "frame_editing/frame_editing_unittest.cc",
Oleh Prypin66ca7e32017-09-14 13:05:00 +0200316 "sanitizers_unittest.cc",
kjellanderd2b63cf2017-06-30 03:04:59 -0700317 "simple_command_line_parser_unittest.cc",
318 ]
319
320 # TODO(jschuh): Bug 1348: fix this warning.
321 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
322
323 if (!build_with_chromium && is_clang) {
324 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
325 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
326 }
327
328 deps = [
329 ":command_line_parser",
330 ":frame_editing_lib",
331 ":reference_less_video_analysis_lib",
332 ":video_quality_analysis",
Mirko Bonadei0250be52017-12-01 13:53:04 +0100333 "../common_video:common_video",
Oleh Prypin66ca7e32017-09-14 13:05:00 +0200334 "../rtc_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100335 "../rtc_base:checks",
kjellanderd2b63cf2017-06-30 03:04:59 -0700336 "../test:test_main",
337 "//testing/gtest",
338 ]
339
340 if (rtc_enable_protobuf) {
341 deps += [ "network_tester:network_tester_unittests" ]
342 }
343
344 data = tools_unittests_resources
345 if (is_android) {
346 deps += [ "//testing/android/native_test:native_test_support" ]
347 shard_timeout = 900
348 }
349 if (is_ios) {
350 deps += [ ":tools_unittests_bundle_data" ]
351 }
352 }
353
354 if (rtc_enable_protobuf) {
355 copy("rtp_analyzer") {
356 sources = [
357 "py_event_log_analyzer/misc.py",
358 "py_event_log_analyzer/pb_parse.py",
359 "py_event_log_analyzer/rtp_analyzer.py",
360 "py_event_log_analyzer/rtp_analyzer.sh",
361 ]
362 outputs = [
363 "$root_build_dir/{{source_file_part}}",
364 ]
365 deps = [
366 "../logging:rtc_event_log_proto",
367 ]
Patrik Höglund844ce8b2017-12-12 15:53:31 +0100368 } # rtp_analyzer
369
370 rtc_executable("unpack_aecdump") {
371 testonly = true
372 sources = [
373 "unpack_aecdump/unpack.cc",
374 ]
375
376 deps = [
377 "..:webrtc_common",
Patrik Höglund3e113432017-12-15 14:40:10 +0100378 "../:typedefs",
Patrik Höglund844ce8b2017-12-12 15:53:31 +0100379 "../common_audio",
380 "../modules/audio_processing",
381 "../modules/audio_processing:audioproc_debug_proto",
382 "../modules/audio_processing:audioproc_debug_proto",
383 "../modules/audio_processing:audioproc_protobuf_utils",
384 "../modules/audio_processing:audioproc_test_utils",
385 "../rtc_base:protobuf_utils",
386 "../rtc_base:rtc_base_approved",
387 "../system_wrappers:system_wrappers_default",
388 ]
389 } # unpack_aecdump
kjellanderd2b63cf2017-06-30 03:04:59 -0700390 }
391}