blob: 37f015c1ea7050fdd53989fcfa4215c29424b56a [file] [log] [blame]
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +00001# 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
tereliusb246a292016-08-23 18:15:25 -07009import("//third_party/protobuf/proto_library.gni")
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000010import("../build/webrtc.gni")
11
ehmaldonado38a21322016-09-02 04:10:34 -070012rtc_source_set("tools") {
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000013 deps = [
14 ":command_line_parser",
15 ]
kjellandera8119682016-06-06 02:00:18 -070016
17 if (!build_with_chromium) {
18 # TODO(kjellander): Enable these when webrtc:5970 is fixed.
19 deps += [
20 ":frame_analyzer",
21 ":rgba_to_i420_converter",
22 ]
23 }
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000024}
25
ehmaldonado38a21322016-09-02 04:10:34 -070026rtc_source_set("command_line_parser") {
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000027 sources = [
Henrik Kjellanderfa16dda2015-04-01 22:53:56 +020028 "simple_command_line_parser.cc",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020029 "simple_command_line_parser.h",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000030 ]
Henrik Kjellander67bcb602015-10-07 08:42:52 +020031 deps = [
kjellander988d31e2016-02-05 00:23:50 -080032 "../base:gtest_prod",
Henrik Kjellander67bcb602015-10-07 08:42:52 +020033 ]
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000034}
35
ehmaldonado38a21322016-09-02 04:10:34 -070036rtc_source_set("video_quality_analysis") {
Henrik Kjellander67bcb602015-10-07 08:42:52 +020037 sources = [
38 "frame_analyzer/video_quality_analysis.cc",
39 "frame_analyzer/video_quality_analysis.h",
40 ]
kjellanderbac04122016-06-02 02:18:48 -070041
Henrik Kjellander67bcb602015-10-07 08:42:52 +020042 deps = [
43 "../common_video",
44 ]
45 public_deps = [
46 "../common_video",
47 ]
48}
49
ehmaldonado38a21322016-09-02 04:10:34 -070050rtc_executable("frame_analyzer") {
Henrik Kjellander67bcb602015-10-07 08:42:52 +020051 sources = [
52 "frame_analyzer/frame_analyzer.cc",
53 ]
kjellanderbac04122016-06-02 02:18:48 -070054
kjellanderbac04122016-06-02 02:18:48 -070055 deps = [
56 ":command_line_parser",
57 ":video_quality_analysis",
58 "//build/win:default_exe_manifest",
59 ]
60}
61
ehmaldonado38a21322016-09-02 04:10:34 -070062rtc_executable("psnr_ssim_analyzer") {
kjellanderbac04122016-06-02 02:18:48 -070063 sources = [
64 "psnr_ssim_analyzer/psnr_ssim_analyzer.cc",
65 ]
66
Henrik Kjellander67bcb602015-10-07 08:42:52 +020067 deps = [
68 ":command_line_parser",
69 ":video_quality_analysis",
brucedawson84583e02016-04-28 00:21:08 -070070 "//build/win:default_exe_manifest",
Henrik Kjellander67bcb602015-10-07 08:42:52 +020071 ]
72}
73
ehmaldonado38a21322016-09-02 04:10:34 -070074rtc_executable("rgba_to_i420_converter") {
Henrik Kjellander67bcb602015-10-07 08:42:52 +020075 sources = [
76 "converter/converter.cc",
77 "converter/converter.h",
78 "converter/rgba_to_i420_converter.cc",
79 ]
kjellanderbac04122016-06-02 02:18:48 -070080
Henrik Kjellander67bcb602015-10-07 08:42:52 +020081 deps = [
82 ":command_line_parser",
83 "../common_video",
brucedawson84583e02016-04-28 00:21:08 -070084 "//build/win:default_exe_manifest",
Henrik Kjellander67bcb602015-10-07 08:42:52 +020085 ]
86}
87
ehmaldonado38a21322016-09-02 04:10:34 -070088rtc_source_set("frame_editing_lib") {
kjellanderbac04122016-06-02 02:18:48 -070089 sources = [
90 "frame_editing/frame_editing_lib.cc",
91 "frame_editing/frame_editing_lib.h",
92 ]
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000093
kjellanderbac04122016-06-02 02:18:48 -070094 # TODO(jschuh): Bug 1348: fix this warning.
95 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000096
kjellanderbac04122016-06-02 02:18:48 -070097 if (is_clang) {
98 # Suppress warnings from the Chromium Clang plugin.
99 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700100 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderbac04122016-06-02 02:18:48 -0700101 }
kjellander@webrtc.org3037bc32014-09-30 19:07:58 +0000102
kjellanderbac04122016-06-02 02:18:48 -0700103 deps = [
104 "../common_video",
105 ]
106}
107
ehmaldonado38a21322016-09-02 04:10:34 -0700108rtc_executable("frame_editor") {
kjellanderbac04122016-06-02 02:18:48 -0700109 sources = [
110 "frame_editing/frame_editing.cc",
111 ]
112
kjellanderbac04122016-06-02 02:18:48 -0700113 deps = [
114 ":command_line_parser",
115 ":frame_editing_lib",
116 "//build/win:default_exe_manifest",
117 ]
118}
119
ehmaldonado38a21322016-09-02 04:10:34 -0700120rtc_executable("force_mic_volume_max") {
kjellanderbac04122016-06-02 02:18:48 -0700121 sources = [
122 "force_mic_volume_max/force_mic_volume_max.cc",
123 ]
124
kjellanderbac04122016-06-02 02:18:48 -0700125 if (is_clang) {
126 # Suppress warnings from the Chromium Clang plugin.
127 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700128 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderbac04122016-06-02 02:18:48 -0700129 }
130
131 deps = [
132 "../system_wrappers:system_wrappers_default",
133 "../voice_engine",
134 "//build/win:default_exe_manifest",
135 ]
136}
137
skvlad185ba292016-08-23 13:01:27 -0700138if (rtc_enable_protobuf) {
skvladf581eb72016-09-07 11:15:37 -0700139 proto_library("chart_proto") {
tereliusb246a292016-08-23 18:15:25 -0700140 sources = [
skvladf581eb72016-09-07 11:15:37 -0700141 "event_log_visualizer/chart.proto",
tereliusb246a292016-08-23 18:15:25 -0700142 ]
143 proto_out_dir = "webrtc/tools/event_log_visualizer"
144 }
145
ehmaldonado38a21322016-09-02 04:10:34 -0700146 rtc_source_set("event_log_visualizer_utils") {
skvlad185ba292016-08-23 13:01:27 -0700147 sources = [
148 "event_log_visualizer/analyzer.cc",
149 "event_log_visualizer/analyzer.h",
150 "event_log_visualizer/plot_base.cc",
151 "event_log_visualizer/plot_base.h",
tereliusb246a292016-08-23 18:15:25 -0700152 "event_log_visualizer/plot_protobuf.cc",
153 "event_log_visualizer/plot_protobuf.h",
skvlad185ba292016-08-23 13:01:27 -0700154 "event_log_visualizer/plot_python.cc",
155 "event_log_visualizer/plot_python.h",
156 ]
skvlad185ba292016-08-23 13:01:27 -0700157 if (is_clang && !is_nacl) {
158 # Suppress warnings from the Chromium Clang plugin.
159 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700160 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
skvlad185ba292016-08-23 13:01:27 -0700161 }
162 defines = [ "ENABLE_RTC_EVENT_LOG" ]
163 deps = [
164 "../:rtc_event_log",
165 "../:rtc_event_log_parser",
166 "../modules/congestion_controller:congestion_controller",
167 "../modules/rtp_rtcp:rtp_rtcp",
168 "../system_wrappers:system_wrappers_default",
169 "//build/config/sanitizers:deps",
170 ]
171 public_deps = [
skvladf581eb72016-09-07 11:15:37 -0700172 ":chart_proto",
skvlad185ba292016-08-23 13:01:27 -0700173 "../:rtc_event_log_parser",
174 ]
175 }
176}
177
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200178# Exclude tools depending on gflags since that's not available in Chromium.
kjellander@webrtc.orgaff499c2016-06-06 23:04:31 +0200179if (rtc_include_tests) {
terelius54ce6802016-07-13 06:44:41 -0700180 if (rtc_enable_protobuf) {
ehmaldonado38a21322016-09-02 04:10:34 -0700181 rtc_executable("event_log_visualizer") {
Stefan Holmer13181032016-07-29 14:48:54 +0200182 testonly = true
terelius54ce6802016-07-13 06:44:41 -0700183 sources = [
tereliusd49a37b2016-08-10 07:12:38 -0700184 "event_log_visualizer/main.cc",
terelius54ce6802016-07-13 06:44:41 -0700185 ]
186
terelius54ce6802016-07-13 06:44:41 -0700187 if (is_clang && !is_nacl) {
188 # Suppress warnings from the Chromium Clang plugin.
189 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700190 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
terelius54ce6802016-07-13 06:44:41 -0700191 }
192
193 defines = [ "ENABLE_RTC_EVENT_LOG" ]
194 deps = [
skvlad185ba292016-08-23 13:01:27 -0700195 ":event_log_visualizer_utils",
terelius54ce6802016-07-13 06:44:41 -0700196 "//third_party/gflags",
197 ]
198 }
199 }
200
ehmaldonado38a21322016-09-02 04:10:34 -0700201 rtc_executable("activity_metric") {
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200202 testonly = true
203 sources = [
204 "agc/activity_metric.cc",
205 ]
kjellanderbac04122016-06-02 02:18:48 -0700206
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200207 if (is_clang) {
208 # Suppress warnings from the Chromium Clang plugin.
209 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700210 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200211 }
kjellanderbac04122016-06-02 02:18:48 -0700212
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200213 deps = [
214 "../modules/audio_processing",
215 "../system_wrappers:metrics_default",
216 "//build/win:default_exe_manifest",
217 "//testing/gtest",
218 "//third_party/gflags",
219 ]
kjellanderbac04122016-06-02 02:18:48 -0700220 }
221
kjellander32c4a202016-08-30 02:53:49 -0700222 if (is_android || is_ios) {
Henrik Kjellander7a122d62016-08-30 13:10:23 +0200223 tools_unittests_resources = [ "//resources/foreman_cif.yuv" ]
kjellander32c4a202016-08-30 02:53:49 -0700224 }
225
226 if (is_ios) {
227 bundle_data("tools_unittests_bundle_data") {
228 testonly = true
229 sources = tools_unittests_resources
230 outputs = [
231 "{{bundle_resources_dir}}/{{source_file_part}}",
232 ]
233 }
234 }
235
ehmaldonado38a21322016-09-02 04:10:34 -0700236 rtc_test("tools_unittests") {
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200237 testonly = true
kjellanderbac04122016-06-02 02:18:48 -0700238
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200239 sources = [
240 "frame_analyzer/video_quality_analysis_unittest.cc",
241 "frame_editing/frame_editing_unittest.cc",
242 "simple_command_line_parser_unittest.cc",
243 ]
kjellanderbac04122016-06-02 02:18:48 -0700244
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200245 # TODO(jschuh): Bug 1348: fix this warning.
246 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
kjellanderbac04122016-06-02 02:18:48 -0700247
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200248 if (is_clang) {
249 # Suppress warnings from the Chromium Clang plugin.
250 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700251 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200252 }
kjellanderbac04122016-06-02 02:18:48 -0700253
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200254 deps = [
255 ":command_line_parser",
256 ":frame_editing_lib",
257 ":video_quality_analysis",
258 "../test:test_support_main",
259 "//testing/gtest",
260 ]
kjellanderbac04122016-06-02 02:18:48 -0700261
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200262 if (is_android) {
263 deps += [ "//testing/android/native_test:native_test_support" ]
kjellander32c4a202016-08-30 02:53:49 -0700264 data = tools_unittests_resources
kjellander28a0ffd2016-08-24 07:48:42 -0700265 shard_timeout = 900
266 }
kjellander32c4a202016-08-30 02:53:49 -0700267 if (is_ios) {
268 deps += [ ":tools_unittests_bundle_data" ]
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200269 }
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000270 }
aleloi7ebbf902016-06-20 07:39:15 -0700271
272 if (rtc_enable_protobuf) {
273 copy("rtp_analyzer") {
274 sources = [
275 "py_event_log_analyzer/misc.py",
276 "py_event_log_analyzer/pb_parse.py",
277 "py_event_log_analyzer/rtp_analyzer.py",
278 "py_event_log_analyzer/rtp_analyzer.sh",
279 ]
280 outputs = [
281 "$root_build_dir/{{source_file_part}}",
282 ]
283 deps = [
284 "..:rtc_event_log_proto",
285 ]
286 }
287 }
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000288}