blob: eba0122338c3da1d868a3b3546911a1403dc7add [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
solenbergfc433e62016-09-09 11:04:53 -0700120# It doesn't make sense to build this tool without the ADM enabled.
121if (rtc_include_internal_audio_device) {
122 rtc_executable("force_mic_volume_max") {
123 sources = [
124 "force_mic_volume_max/force_mic_volume_max.cc",
125 ]
kjellanderbac04122016-06-02 02:18:48 -0700126
solenbergfc433e62016-09-09 11:04:53 -0700127 if (is_clang) {
128 # Suppress warnings from the Chromium Clang plugin.
129 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
130 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
131 }
132
133 deps = [
134 "../modules/audio_device:audio_device",
135 "../system_wrappers:system_wrappers_default",
136 "//build/win:default_exe_manifest",
137 ]
kjellanderbac04122016-06-02 02:18:48 -0700138 }
kjellanderbac04122016-06-02 02:18:48 -0700139}
140
skvlad185ba292016-08-23 13:01:27 -0700141if (rtc_enable_protobuf) {
skvladf581eb72016-09-07 11:15:37 -0700142 proto_library("chart_proto") {
tereliusb246a292016-08-23 18:15:25 -0700143 sources = [
skvladf581eb72016-09-07 11:15:37 -0700144 "event_log_visualizer/chart.proto",
tereliusb246a292016-08-23 18:15:25 -0700145 ]
146 proto_out_dir = "webrtc/tools/event_log_visualizer"
147 }
148
ehmaldonado38a21322016-09-02 04:10:34 -0700149 rtc_source_set("event_log_visualizer_utils") {
skvlad185ba292016-08-23 13:01:27 -0700150 sources = [
151 "event_log_visualizer/analyzer.cc",
152 "event_log_visualizer/analyzer.h",
153 "event_log_visualizer/plot_base.cc",
154 "event_log_visualizer/plot_base.h",
tereliusb246a292016-08-23 18:15:25 -0700155 "event_log_visualizer/plot_protobuf.cc",
156 "event_log_visualizer/plot_protobuf.h",
skvlad185ba292016-08-23 13:01:27 -0700157 "event_log_visualizer/plot_python.cc",
158 "event_log_visualizer/plot_python.h",
159 ]
skvlad185ba292016-08-23 13:01:27 -0700160 if (is_clang && !is_nacl) {
161 # Suppress warnings from the Chromium Clang plugin.
162 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700163 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
skvlad185ba292016-08-23 13:01:27 -0700164 }
165 defines = [ "ENABLE_RTC_EVENT_LOG" ]
166 deps = [
167 "../:rtc_event_log",
168 "../:rtc_event_log_parser",
169 "../modules/congestion_controller:congestion_controller",
170 "../modules/rtp_rtcp:rtp_rtcp",
171 "../system_wrappers:system_wrappers_default",
172 "//build/config/sanitizers:deps",
173 ]
174 public_deps = [
skvladf581eb72016-09-07 11:15:37 -0700175 ":chart_proto",
skvlad185ba292016-08-23 13:01:27 -0700176 "../:rtc_event_log_parser",
177 ]
178 }
179}
180
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200181# Exclude tools depending on gflags since that's not available in Chromium.
kjellander@webrtc.orgaff499c2016-06-06 23:04:31 +0200182if (rtc_include_tests) {
terelius54ce6802016-07-13 06:44:41 -0700183 if (rtc_enable_protobuf) {
ehmaldonado38a21322016-09-02 04:10:34 -0700184 rtc_executable("event_log_visualizer") {
Stefan Holmer13181032016-07-29 14:48:54 +0200185 testonly = true
terelius54ce6802016-07-13 06:44:41 -0700186 sources = [
tereliusd49a37b2016-08-10 07:12:38 -0700187 "event_log_visualizer/main.cc",
terelius54ce6802016-07-13 06:44:41 -0700188 ]
189
terelius54ce6802016-07-13 06:44:41 -0700190 if (is_clang && !is_nacl) {
191 # Suppress warnings from the Chromium Clang plugin.
192 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700193 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
terelius54ce6802016-07-13 06:44:41 -0700194 }
195
196 defines = [ "ENABLE_RTC_EVENT_LOG" ]
197 deps = [
skvlad185ba292016-08-23 13:01:27 -0700198 ":event_log_visualizer_utils",
terelius54ce6802016-07-13 06:44:41 -0700199 "//third_party/gflags",
200 ]
201 }
202 }
203
ehmaldonado38a21322016-09-02 04:10:34 -0700204 rtc_executable("activity_metric") {
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200205 testonly = true
206 sources = [
207 "agc/activity_metric.cc",
208 ]
kjellanderbac04122016-06-02 02:18:48 -0700209
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200210 if (is_clang) {
211 # Suppress warnings from the Chromium Clang plugin.
212 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700213 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200214 }
kjellanderbac04122016-06-02 02:18:48 -0700215
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200216 deps = [
217 "../modules/audio_processing",
218 "../system_wrappers:metrics_default",
219 "//build/win:default_exe_manifest",
220 "//testing/gtest",
221 "//third_party/gflags",
222 ]
kjellanderbac04122016-06-02 02:18:48 -0700223 }
224
kjellander32c4a202016-08-30 02:53:49 -0700225 if (is_android || is_ios) {
Henrik Kjellander7a122d62016-08-30 13:10:23 +0200226 tools_unittests_resources = [ "//resources/foreman_cif.yuv" ]
kjellander32c4a202016-08-30 02:53:49 -0700227 }
228
229 if (is_ios) {
230 bundle_data("tools_unittests_bundle_data") {
231 testonly = true
232 sources = tools_unittests_resources
233 outputs = [
234 "{{bundle_resources_dir}}/{{source_file_part}}",
235 ]
236 }
237 }
238
ehmaldonado38a21322016-09-02 04:10:34 -0700239 rtc_test("tools_unittests") {
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200240 testonly = true
kjellanderbac04122016-06-02 02:18:48 -0700241
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200242 sources = [
243 "frame_analyzer/video_quality_analysis_unittest.cc",
244 "frame_editing/frame_editing_unittest.cc",
245 "simple_command_line_parser_unittest.cc",
246 ]
kjellanderbac04122016-06-02 02:18:48 -0700247
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200248 # TODO(jschuh): Bug 1348: fix this warning.
249 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
kjellanderbac04122016-06-02 02:18:48 -0700250
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200251 if (is_clang) {
252 # Suppress warnings from the Chromium Clang plugin.
253 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
ehmaldonado38a21322016-09-02 04:10:34 -0700254 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200255 }
kjellanderbac04122016-06-02 02:18:48 -0700256
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200257 deps = [
258 ":command_line_parser",
259 ":frame_editing_lib",
260 ":video_quality_analysis",
261 "../test:test_support_main",
262 "//testing/gtest",
263 ]
kjellanderbac04122016-06-02 02:18:48 -0700264
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200265 if (is_android) {
266 deps += [ "//testing/android/native_test:native_test_support" ]
kjellander32c4a202016-08-30 02:53:49 -0700267 data = tools_unittests_resources
kjellander28a0ffd2016-08-24 07:48:42 -0700268 shard_timeout = 900
269 }
kjellander32c4a202016-08-30 02:53:49 -0700270 if (is_ios) {
271 deps += [ ":tools_unittests_bundle_data" ]
kjellander@webrtc.orgdc0dbad2016-06-02 13:29:07 +0200272 }
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000273 }
aleloi7ebbf902016-06-20 07:39:15 -0700274
275 if (rtc_enable_protobuf) {
276 copy("rtp_analyzer") {
277 sources = [
278 "py_event_log_analyzer/misc.py",
279 "py_event_log_analyzer/pb_parse.py",
280 "py_event_log_analyzer/rtp_analyzer.py",
281 "py_event_log_analyzer/rtp_analyzer.sh",
282 ]
283 outputs = [
284 "$root_build_dir/{{source_file_part}}",
285 ]
286 deps = [
287 "..:rtc_event_log_proto",
288 ]
289 }
290 }
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000291}