| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 1 | # 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 |  | 
|  | 9 | import("//third_party/protobuf/proto_library.gni") | 
|  | 10 | import("../webrtc.gni") | 
|  | 11 |  | 
|  | 12 | group("rtc_tools") { | 
|  | 13 | # This target shall build all targets in tools/. | 
|  | 14 | testonly = true | 
|  | 15 |  | 
|  | 16 | public_deps = [ | 
|  | 17 | ":command_line_parser", | 
|  | 18 | ":frame_analyzer", | 
| kjellander | 6af0cbf | 2017-09-04 23:42:45 -0700 | [diff] [blame] | 19 | ":video_quality_analysis", | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 20 | ] | 
| kjellander | 6af0cbf | 2017-09-04 23:42:45 -0700 | [diff] [blame] | 21 | if (!build_with_chromium) { | 
|  | 22 | public_deps += [ | 
|  | 23 | ":frame_editor", | 
|  | 24 | ":psnr_ssim_analyzer", | 
|  | 25 | ":rgba_to_i420_converter", | 
|  | 26 | ] | 
|  | 27 | if (rtc_include_internal_audio_device) { | 
|  | 28 | public_deps += [ ":force_mic_volume_max" ] | 
|  | 29 | } | 
|  | 30 | if (rtc_enable_protobuf) { | 
|  | 31 | public_deps += [ ":chart_proto" ] | 
|  | 32 | } | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 33 | } | 
|  | 34 |  | 
|  | 35 | if (rtc_include_tests) { | 
|  | 36 | public_deps += [ | 
|  | 37 | ":activity_metric", | 
|  | 38 | ":tools_unittests", | 
|  | 39 | ] | 
|  | 40 | if (rtc_enable_protobuf) { | 
|  | 41 | public_deps += [ | 
|  | 42 | ":event_log_visualizer", | 
|  | 43 | ":rtp_analyzer", | 
|  | 44 | "network_tester", | 
|  | 45 | ] | 
|  | 46 | } | 
|  | 47 | } | 
|  | 48 | } | 
|  | 49 |  | 
|  | 50 | rtc_static_library("command_line_parser") { | 
|  | 51 | sources = [ | 
|  | 52 | "simple_command_line_parser.cc", | 
|  | 53 | "simple_command_line_parser.h", | 
|  | 54 | ] | 
|  | 55 | deps = [ | 
| ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 56 | "../rtc_base:gtest_prod", | 
|  | 57 | "../rtc_base:rtc_base_approved", | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 58 | ] | 
|  | 59 | } | 
|  | 60 |  | 
|  | 61 | rtc_static_library("video_quality_analysis") { | 
|  | 62 | sources = [ | 
|  | 63 | "frame_analyzer/video_quality_analysis.cc", | 
|  | 64 | "frame_analyzer/video_quality_analysis.h", | 
|  | 65 | ] | 
|  | 66 |  | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 67 | public_deps = [ | 
|  | 68 | "../common_video", | 
|  | 69 | ] | 
|  | 70 | } | 
|  | 71 |  | 
|  | 72 | rtc_executable("frame_analyzer") { | 
|  | 73 | sources = [ | 
|  | 74 | "frame_analyzer/frame_analyzer.cc", | 
|  | 75 | ] | 
|  | 76 |  | 
|  | 77 | deps = [ | 
|  | 78 | ":command_line_parser", | 
|  | 79 | ":video_quality_analysis", | 
|  | 80 | "//build/win:default_exe_manifest", | 
|  | 81 | ] | 
|  | 82 | } | 
|  | 83 |  | 
| kjellander | 6af0cbf | 2017-09-04 23:42:45 -0700 | [diff] [blame] | 84 | # Only expose the targets needed by Chromium (e.g. frame_analyzer) to avoid | 
|  | 85 | # building a lot of redundant code as part of Chromium builds. | 
|  | 86 | if (!build_with_chromium) { | 
|  | 87 | rtc_executable("psnr_ssim_analyzer") { | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 88 | sources = [ | 
| kjellander | 6af0cbf | 2017-09-04 23:42:45 -0700 | [diff] [blame] | 89 | "psnr_ssim_analyzer/psnr_ssim_analyzer.cc", | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 90 | ] | 
|  | 91 |  | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 92 | deps = [ | 
| kjellander | 6af0cbf | 2017-09-04 23:42:45 -0700 | [diff] [blame] | 93 | ":command_line_parser", | 
|  | 94 | ":video_quality_analysis", | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 95 | "//build/win:default_exe_manifest", | 
|  | 96 | ] | 
|  | 97 | } | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 98 |  | 
| kjellander | 6af0cbf | 2017-09-04 23:42:45 -0700 | [diff] [blame] | 99 | rtc_static_library("reference_less_video_analysis_lib") { | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 100 | sources = [ | 
| kjellander | 6af0cbf | 2017-09-04 23:42:45 -0700 | [diff] [blame] | 101 | "frame_analyzer/reference_less_video_analysis_lib.cc", | 
|  | 102 | "frame_analyzer/reference_less_video_analysis_lib.h", | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 103 | ] | 
| kjellander | 6af0cbf | 2017-09-04 23:42:45 -0700 | [diff] [blame] | 104 |  | 
|  | 105 | deps = [ | 
|  | 106 | ":video_quality_analysis", | 
|  | 107 | ] | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 108 | } | 
|  | 109 |  | 
| kjellander | 6af0cbf | 2017-09-04 23:42:45 -0700 | [diff] [blame] | 110 | rtc_executable("reference_less_video_analysis") { | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 111 | sources = [ | 
| kjellander | 6af0cbf | 2017-09-04 23:42:45 -0700 | [diff] [blame] | 112 | "frame_analyzer/reference_less_video_analysis.cc", | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 113 | ] | 
| kjellander | 6af0cbf | 2017-09-04 23:42:45 -0700 | [diff] [blame] | 114 |  | 
|  | 115 | deps = [ | 
|  | 116 | ":command_line_parser", | 
|  | 117 | ":reference_less_video_analysis_lib", | 
|  | 118 | "//build/win:default_exe_manifest", | 
|  | 119 | ] | 
|  | 120 | } | 
|  | 121 |  | 
|  | 122 | rtc_executable("rgba_to_i420_converter") { | 
|  | 123 | sources = [ | 
|  | 124 | "converter/converter.cc", | 
|  | 125 | "converter/converter.h", | 
|  | 126 | "converter/rgba_to_i420_converter.cc", | 
|  | 127 | ] | 
|  | 128 |  | 
|  | 129 | deps = [ | 
|  | 130 | ":command_line_parser", | 
|  | 131 | "../common_video", | 
|  | 132 | "//build/win:default_exe_manifest", | 
|  | 133 | ] | 
|  | 134 | } | 
|  | 135 |  | 
|  | 136 | rtc_static_library("frame_editing_lib") { | 
|  | 137 | sources = [ | 
|  | 138 | "frame_editing/frame_editing_lib.cc", | 
|  | 139 | "frame_editing/frame_editing_lib.h", | 
|  | 140 | ] | 
|  | 141 |  | 
|  | 142 | # TODO(jschuh): Bug 1348: fix this warning. | 
|  | 143 | configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] | 
|  | 144 |  | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 145 | if (!build_with_chromium && is_clang) { | 
|  | 146 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | 
|  | 147 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | 
|  | 148 | } | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 149 |  | 
| kjellander | 6af0cbf | 2017-09-04 23:42:45 -0700 | [diff] [blame] | 150 | deps = [ | 
|  | 151 | "..:webrtc_common", | 
|  | 152 | "../common_video", | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 153 | ] | 
| kjellander | 6af0cbf | 2017-09-04 23:42:45 -0700 | [diff] [blame] | 154 | } | 
|  | 155 |  | 
|  | 156 | rtc_executable("frame_editor") { | 
|  | 157 | sources = [ | 
|  | 158 | "frame_editing/frame_editing.cc", | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 159 | ] | 
| kjellander | 6af0cbf | 2017-09-04 23:42:45 -0700 | [diff] [blame] | 160 |  | 
|  | 161 | deps = [ | 
|  | 162 | ":command_line_parser", | 
|  | 163 | ":frame_editing_lib", | 
|  | 164 | "//build/win:default_exe_manifest", | 
|  | 165 | ] | 
|  | 166 | } | 
|  | 167 |  | 
|  | 168 | # It doesn't make sense to build this tool without the ADM enabled. | 
|  | 169 | if (rtc_include_internal_audio_device) { | 
|  | 170 | rtc_executable("force_mic_volume_max") { | 
|  | 171 | sources = [ | 
|  | 172 | "force_mic_volume_max/force_mic_volume_max.cc", | 
|  | 173 | ] | 
|  | 174 |  | 
|  | 175 | if (!build_with_chromium && is_clang) { | 
|  | 176 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | 
|  | 177 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | 
|  | 178 | } | 
|  | 179 |  | 
|  | 180 | deps = [ | 
|  | 181 | "../modules/audio_device", | 
|  | 182 | "../system_wrappers:system_wrappers_default", | 
|  | 183 | "//build/win:default_exe_manifest", | 
|  | 184 | ] | 
|  | 185 | } | 
|  | 186 | } | 
|  | 187 |  | 
|  | 188 | if (rtc_enable_protobuf) { | 
|  | 189 | proto_library("chart_proto") { | 
|  | 190 | sources = [ | 
|  | 191 | "event_log_visualizer/chart.proto", | 
|  | 192 | ] | 
| Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 193 | proto_out_dir = "rtc_tools/event_log_visualizer" | 
| kjellander | 6af0cbf | 2017-09-04 23:42:45 -0700 | [diff] [blame] | 194 | } | 
|  | 195 |  | 
|  | 196 | rtc_static_library("event_log_visualizer_utils") { | 
|  | 197 | sources = [ | 
|  | 198 | "event_log_visualizer/analyzer.cc", | 
|  | 199 | "event_log_visualizer/analyzer.h", | 
|  | 200 | "event_log_visualizer/plot_base.cc", | 
|  | 201 | "event_log_visualizer/plot_base.h", | 
|  | 202 | "event_log_visualizer/plot_protobuf.cc", | 
|  | 203 | "event_log_visualizer/plot_protobuf.h", | 
|  | 204 | "event_log_visualizer/plot_python.cc", | 
|  | 205 | "event_log_visualizer/plot_python.h", | 
|  | 206 | ] | 
|  | 207 | if (!build_with_chromium && is_clang) { | 
|  | 208 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | 
|  | 209 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | 
|  | 210 | } | 
|  | 211 | defines = [ "ENABLE_RTC_EVENT_LOG" ] | 
|  | 212 | deps = [ | 
|  | 213 | "../call:call_interfaces", | 
|  | 214 | "../call:video_stream_api", | 
|  | 215 | "../logging:rtc_event_log_impl", | 
|  | 216 | "../logging:rtc_event_log_parser", | 
|  | 217 | "../modules:module_api", | 
|  | 218 | "../modules/audio_coding:ana_debug_dump_proto", | 
|  | 219 | "../modules/audio_coding:neteq_tools", | 
|  | 220 | "../rtc_base:rtc_base_approved", | 
|  | 221 |  | 
|  | 222 | # TODO(kwiberg): Remove this dependency. | 
|  | 223 | "../api/audio_codecs:audio_codecs_api", | 
|  | 224 | "../modules/congestion_controller", | 
|  | 225 | "../modules/rtp_rtcp", | 
|  | 226 | "../system_wrappers:system_wrappers_default", | 
|  | 227 | "//build/config:exe_and_shlib_deps", | 
|  | 228 | ] | 
|  | 229 | public_deps = [ | 
|  | 230 | ":chart_proto", | 
|  | 231 | "../logging:rtc_event_log_parser", | 
|  | 232 | ] | 
|  | 233 | } | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 234 | } | 
|  | 235 | } | 
|  | 236 |  | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 237 | if (rtc_include_tests) { | 
|  | 238 | if (rtc_enable_protobuf) { | 
|  | 239 | rtc_executable("event_log_visualizer") { | 
|  | 240 | testonly = true | 
|  | 241 | sources = [ | 
|  | 242 | "event_log_visualizer/main.cc", | 
|  | 243 | ] | 
|  | 244 |  | 
|  | 245 | if (!build_with_chromium && is_clang) { | 
|  | 246 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | 
|  | 247 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | 
|  | 248 | } | 
|  | 249 |  | 
|  | 250 | defines = [ "ENABLE_RTC_EVENT_LOG" ] | 
|  | 251 | deps = [ | 
|  | 252 | ":event_log_visualizer_utils", | 
| ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 253 | "../rtc_base:rtc_base_approved", | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 254 | "../test:field_trial", | 
|  | 255 | "../test:test_support", | 
|  | 256 | ] | 
|  | 257 | } | 
|  | 258 | } | 
|  | 259 |  | 
|  | 260 | rtc_executable("activity_metric") { | 
|  | 261 | testonly = true | 
|  | 262 | sources = [ | 
|  | 263 | "agc/activity_metric.cc", | 
|  | 264 | ] | 
|  | 265 |  | 
|  | 266 | if (!build_with_chromium && is_clang) { | 
|  | 267 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | 
|  | 268 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | 
|  | 269 | } | 
|  | 270 |  | 
|  | 271 | deps = [ | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 272 | "../modules:module_api", | 
|  | 273 | "../modules/audio_processing", | 
| ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 274 | "../rtc_base:rtc_base_approved", | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 275 | "../system_wrappers:metrics_default", | 
|  | 276 | "../test:test_support", | 
|  | 277 | "//build/win:default_exe_manifest", | 
|  | 278 | "//testing/gtest", | 
|  | 279 | ] | 
|  | 280 | } | 
|  | 281 |  | 
|  | 282 | tools_unittests_resources = [ | 
| Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 283 | "../resources/foreman_cif.yuv", | 
|  | 284 | "../resources/reference_less_video_test_file.y4m", | 
|  | 285 | "../resources/video_quality_analysis_frame.txt", | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 286 | ] | 
|  | 287 |  | 
|  | 288 | if (is_ios) { | 
|  | 289 | bundle_data("tools_unittests_bundle_data") { | 
|  | 290 | testonly = true | 
|  | 291 | sources = tools_unittests_resources | 
|  | 292 | outputs = [ | 
|  | 293 | "{{bundle_resources_dir}}/{{source_file_part}}", | 
|  | 294 | ] | 
|  | 295 | } | 
|  | 296 | } | 
|  | 297 |  | 
|  | 298 | rtc_test("tools_unittests") { | 
|  | 299 | testonly = true | 
|  | 300 |  | 
|  | 301 | sources = [ | 
|  | 302 | "frame_analyzer/reference_less_video_analysis_unittest.cc", | 
|  | 303 | "frame_analyzer/video_quality_analysis_unittest.cc", | 
|  | 304 | "frame_editing/frame_editing_unittest.cc", | 
| Oleh Prypin | 66ca7e3 | 2017-09-14 13:05:00 +0200 | [diff] [blame] | 305 | "sanitizers_unittest.cc", | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 306 | "simple_command_line_parser_unittest.cc", | 
|  | 307 | ] | 
|  | 308 |  | 
|  | 309 | # TODO(jschuh): Bug 1348: fix this warning. | 
|  | 310 | configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] | 
|  | 311 |  | 
|  | 312 | if (!build_with_chromium && is_clang) { | 
|  | 313 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | 
|  | 314 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | 
|  | 315 | } | 
|  | 316 |  | 
|  | 317 | deps = [ | 
|  | 318 | ":command_line_parser", | 
|  | 319 | ":frame_editing_lib", | 
|  | 320 | ":reference_less_video_analysis_lib", | 
|  | 321 | ":video_quality_analysis", | 
| Oleh Prypin | 66ca7e3 | 2017-09-14 13:05:00 +0200 | [diff] [blame] | 322 | "../rtc_base", | 
| kjellander | d2b63cf | 2017-06-30 03:04:59 -0700 | [diff] [blame] | 323 | "../test:test_main", | 
|  | 324 | "//testing/gtest", | 
|  | 325 | ] | 
|  | 326 |  | 
|  | 327 | if (rtc_enable_protobuf) { | 
|  | 328 | deps += [ "network_tester:network_tester_unittests" ] | 
|  | 329 | } | 
|  | 330 |  | 
|  | 331 | data = tools_unittests_resources | 
|  | 332 | if (is_android) { | 
|  | 333 | deps += [ "//testing/android/native_test:native_test_support" ] | 
|  | 334 | shard_timeout = 900 | 
|  | 335 | } | 
|  | 336 | if (is_ios) { | 
|  | 337 | deps += [ ":tools_unittests_bundle_data" ] | 
|  | 338 | } | 
|  | 339 | } | 
|  | 340 |  | 
|  | 341 | if (rtc_enable_protobuf) { | 
|  | 342 | copy("rtp_analyzer") { | 
|  | 343 | sources = [ | 
|  | 344 | "py_event_log_analyzer/misc.py", | 
|  | 345 | "py_event_log_analyzer/pb_parse.py", | 
|  | 346 | "py_event_log_analyzer/rtp_analyzer.py", | 
|  | 347 | "py_event_log_analyzer/rtp_analyzer.sh", | 
|  | 348 | ] | 
|  | 349 | outputs = [ | 
|  | 350 | "$root_build_dir/{{source_file_part}}", | 
|  | 351 | ] | 
|  | 352 | deps = [ | 
|  | 353 | "../logging:rtc_event_log_proto", | 
|  | 354 | ] | 
|  | 355 | } | 
|  | 356 | } | 
|  | 357 | } |