You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

454 lines
13 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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. import("../webrtc.gni")
  9. if (rtc_enable_protobuf) {
  10. import("//third_party/protobuf/proto_library.gni")
  11. }
  12. group("rtc_tools") {
  13. # This target shall build all targets in tools/.
  14. testonly = true
  15. deps = [
  16. ":frame_analyzer",
  17. ":video_file_reader",
  18. ":video_quality_analysis",
  19. ]
  20. if (!build_with_chromium) {
  21. deps += [
  22. ":psnr_ssim_analyzer",
  23. ":rgba_to_i420_converter",
  24. ]
  25. if (rtc_enable_protobuf) {
  26. deps += [ ":chart_proto" ]
  27. }
  28. }
  29. if (rtc_include_tests) {
  30. deps += [ ":tools_unittests" ]
  31. if (rtc_enable_protobuf) {
  32. if (!build_with_chromium) {
  33. deps += [ ":event_log_visualizer" ]
  34. }
  35. deps += [
  36. ":rtp_analyzer",
  37. ":unpack_aecdump",
  38. "network_tester",
  39. ]
  40. }
  41. }
  42. }
  43. rtc_library("video_file_reader") {
  44. sources = [
  45. "video_file_reader.cc",
  46. "video_file_reader.h",
  47. ]
  48. deps = [
  49. "../api:scoped_refptr",
  50. "../api/video:video_frame",
  51. "../api/video:video_frame_i420",
  52. "../api/video:video_rtp_headers",
  53. "../rtc_base:checks",
  54. "../rtc_base:rtc_base_approved",
  55. "//third_party/abseil-cpp/absl/strings",
  56. "//third_party/abseil-cpp/absl/types:optional",
  57. ]
  58. }
  59. rtc_library("video_file_writer") {
  60. sources = [
  61. "video_file_writer.cc",
  62. "video_file_writer.h",
  63. ]
  64. deps = [
  65. ":video_file_reader",
  66. "../api:scoped_refptr",
  67. "../api/video:video_frame",
  68. "../api/video:video_frame_i420",
  69. "../api/video:video_rtp_headers",
  70. "../rtc_base:rtc_base_approved",
  71. "//third_party/abseil-cpp/absl/strings",
  72. "//third_party/abseil-cpp/absl/types:optional",
  73. ]
  74. }
  75. rtc_library("video_quality_analysis") {
  76. sources = [
  77. "frame_analyzer/linear_least_squares.cc",
  78. "frame_analyzer/linear_least_squares.h",
  79. "frame_analyzer/video_color_aligner.cc",
  80. "frame_analyzer/video_color_aligner.h",
  81. "frame_analyzer/video_geometry_aligner.cc",
  82. "frame_analyzer/video_geometry_aligner.h",
  83. "frame_analyzer/video_quality_analysis.cc",
  84. "frame_analyzer/video_quality_analysis.h",
  85. "frame_analyzer/video_temporal_aligner.cc",
  86. "frame_analyzer/video_temporal_aligner.h",
  87. ]
  88. deps = [
  89. ":video_file_reader",
  90. "../api:array_view",
  91. "../api:scoped_refptr",
  92. "../api/video:video_frame",
  93. "../api/video:video_frame_i420",
  94. "../api/video:video_rtp_headers",
  95. "../common_video",
  96. "../rtc_base:checks",
  97. "../rtc_base:rtc_base_approved",
  98. "../test:perf_test",
  99. "//third_party/abseil-cpp/absl/types:optional",
  100. "//third_party/libyuv",
  101. ]
  102. }
  103. rtc_executable("frame_analyzer") {
  104. visibility = [ "*" ]
  105. testonly = true
  106. sources = [
  107. "frame_analyzer/frame_analyzer.cc",
  108. ]
  109. deps = [
  110. ":video_file_reader",
  111. ":video_file_writer",
  112. ":video_quality_analysis",
  113. "../api:scoped_refptr",
  114. "../rtc_base:stringutils",
  115. "../test:perf_test",
  116. "//third_party/abseil-cpp/absl/flags:flag",
  117. "//third_party/abseil-cpp/absl/flags:parse",
  118. "//third_party/abseil-cpp/absl/strings",
  119. ]
  120. }
  121. if (!build_with_chromium && !build_with_mozilla) {
  122. action("frame_analyzer_host") {
  123. script = "//tools_webrtc/executable_host_build.py"
  124. outputs = [
  125. "${root_out_dir}/frame_analyzer_host",
  126. ]
  127. args = [
  128. "--executable_name",
  129. "frame_analyzer",
  130. ]
  131. }
  132. }
  133. # Only expose the targets needed by Chromium (e.g. frame_analyzer) to avoid
  134. # building a lot of redundant code as part of Chromium builds.
  135. if (!build_with_chromium) {
  136. rtc_executable("rtp_generator") {
  137. visibility = [ "*" ]
  138. testonly = true
  139. sources = [
  140. "rtp_generator/main.cc",
  141. "rtp_generator/rtp_generator.cc",
  142. "rtp_generator/rtp_generator.h",
  143. ]
  144. deps = [
  145. "../api:rtp_parameters",
  146. "../api:transport_api",
  147. "../api/rtc_event_log",
  148. "../api/task_queue:default_task_queue_factory",
  149. "../api/task_queue:task_queue",
  150. "../api/video:builtin_video_bitrate_allocator_factory",
  151. "../api/video_codecs:builtin_video_decoder_factory",
  152. "../api/video_codecs:builtin_video_encoder_factory",
  153. "../api/video_codecs:video_codecs_api",
  154. "../call",
  155. "../call:call_interfaces",
  156. "../call:fake_network",
  157. "../call:rtp_interfaces",
  158. "../call:rtp_sender",
  159. "../call:simulated_network",
  160. "../call:simulated_packet_receiver",
  161. "../call:video_stream_api",
  162. "../media:rtc_audio_video",
  163. "../media:rtc_media_base",
  164. "../rtc_base",
  165. "../rtc_base:rtc_base_approved",
  166. "../rtc_base:rtc_json",
  167. "../rtc_base/system:file_wrapper",
  168. "../test:fileutils",
  169. "../test:rtp_test_utils",
  170. "../test:video_test_common",
  171. "//third_party/abseil-cpp/absl/flags:flag",
  172. "//third_party/abseil-cpp/absl/flags:parse",
  173. "//third_party/abseil-cpp/absl/flags:usage",
  174. "//third_party/abseil-cpp/absl/strings",
  175. ]
  176. }
  177. rtc_executable("psnr_ssim_analyzer") {
  178. testonly = true
  179. sources = [
  180. "psnr_ssim_analyzer/psnr_ssim_analyzer.cc",
  181. ]
  182. deps = [
  183. ":video_file_reader",
  184. ":video_quality_analysis",
  185. "../api:scoped_refptr",
  186. "../api/video:video_frame",
  187. "../api/video:video_rtp_headers",
  188. "//third_party/abseil-cpp/absl/flags:flag",
  189. "//third_party/abseil-cpp/absl/flags:parse",
  190. "//third_party/abseil-cpp/absl/flags:usage",
  191. ]
  192. }
  193. rtc_library("reference_less_video_analysis_lib") {
  194. sources = [
  195. "frame_analyzer/reference_less_video_analysis_lib.cc",
  196. "frame_analyzer/reference_less_video_analysis_lib.h",
  197. ]
  198. deps = [
  199. ":video_file_reader",
  200. ":video_quality_analysis",
  201. "../api:scoped_refptr",
  202. "../api/video:video_frame",
  203. "../api/video:video_rtp_headers",
  204. ]
  205. }
  206. rtc_executable("reference_less_video_analysis") {
  207. testonly = true
  208. sources = [
  209. "frame_analyzer/reference_less_video_analysis.cc",
  210. ]
  211. deps = [
  212. ":reference_less_video_analysis_lib",
  213. "//third_party/abseil-cpp/absl/flags:flag",
  214. "//third_party/abseil-cpp/absl/flags:parse",
  215. "//third_party/abseil-cpp/absl/flags:usage",
  216. ]
  217. }
  218. rtc_executable("rgba_to_i420_converter") {
  219. visibility = [ "*" ]
  220. testonly = true
  221. sources = [
  222. "converter/converter.cc",
  223. "converter/converter.h",
  224. "converter/rgba_to_i420_converter.cc",
  225. ]
  226. deps = [
  227. "../common_video",
  228. "//third_party/abseil-cpp/absl/flags:flag",
  229. "//third_party/abseil-cpp/absl/flags:parse",
  230. "//third_party/abseil-cpp/absl/flags:usage",
  231. "//third_party/libyuv",
  232. ]
  233. }
  234. if (rtc_enable_protobuf) {
  235. proto_library("chart_proto") {
  236. visibility = [ "*" ]
  237. sources = [
  238. "rtc_event_log_visualizer/proto/chart.proto",
  239. "rtc_event_log_visualizer/proto/chart_enums.proto",
  240. ]
  241. proto_out_dir = "rtc_tools/rtc_event_log_visualizer/proto"
  242. }
  243. rtc_library("event_log_visualizer_utils") {
  244. visibility = [ "*" ]
  245. sources = [
  246. "rtc_event_log_visualizer/analyzer.cc",
  247. "rtc_event_log_visualizer/analyzer.h",
  248. "rtc_event_log_visualizer/log_simulation.cc",
  249. "rtc_event_log_visualizer/log_simulation.h",
  250. "rtc_event_log_visualizer/plot_base.cc",
  251. "rtc_event_log_visualizer/plot_base.h",
  252. "rtc_event_log_visualizer/plot_protobuf.cc",
  253. "rtc_event_log_visualizer/plot_protobuf.h",
  254. "rtc_event_log_visualizer/plot_python.cc",
  255. "rtc_event_log_visualizer/plot_python.h",
  256. "rtc_event_log_visualizer/triage_notifications.h",
  257. ]
  258. defines = [ "ENABLE_RTC_EVENT_LOG" ]
  259. deps = [
  260. ":chart_proto",
  261. "../api:function_view",
  262. "../rtc_base:ignore_wundef",
  263. # TODO(kwiberg): Remove this dependency.
  264. "../api/audio_codecs:audio_codecs_api",
  265. "../api/transport:field_trial_based_config",
  266. "../api/transport:goog_cc",
  267. "../api/transport:network_control",
  268. "../call:call_interfaces",
  269. "../call:video_stream_api",
  270. "../logging:rtc_event_log_parser",
  271. "../logging:rtc_stream_config",
  272. "../modules/audio_coding:ana_debug_dump_proto",
  273. "../modules/audio_coding:audio_network_adaptor",
  274. "../modules/audio_coding:neteq_tools",
  275. "../modules/congestion_controller",
  276. "../modules/congestion_controller/goog_cc:delay_based_bwe",
  277. "../modules/congestion_controller/goog_cc:estimators",
  278. "../modules/congestion_controller/rtp:transport_feedback",
  279. "../modules/pacing",
  280. "../modules/remote_bitrate_estimator",
  281. "../modules/rtp_rtcp",
  282. "../modules/rtp_rtcp:rtp_rtcp_format",
  283. "../rtc_base:checks",
  284. "../rtc_base:rtc_base_approved",
  285. "../rtc_base:rtc_numerics",
  286. "../rtc_base:stringutils",
  287. "//third_party/abseil-cpp/absl/algorithm:container",
  288. "//third_party/abseil-cpp/absl/strings",
  289. ]
  290. }
  291. }
  292. }
  293. if (rtc_include_tests) {
  294. if (rtc_enable_protobuf && !build_with_chromium) {
  295. rtc_executable("event_log_visualizer") {
  296. testonly = true
  297. sources = [
  298. "rtc_event_log_visualizer/main.cc",
  299. ]
  300. defines = [ "ENABLE_RTC_EVENT_LOG" ]
  301. deps = [
  302. ":event_log_visualizer_utils",
  303. "../api/rtc_event_log",
  304. "../logging:rtc_event_log_parser",
  305. "../modules/audio_coding:neteq",
  306. "../modules/rtp_rtcp:rtp_rtcp_format",
  307. "../rtc_base:checks",
  308. "../rtc_base:protobuf_utils",
  309. "../rtc_base:rtc_base_approved",
  310. "../system_wrappers:field_trial",
  311. "../test:field_trial",
  312. "../test:fileutils",
  313. "../test:test_support",
  314. "//third_party/abseil-cpp/absl/algorithm:container",
  315. "//third_party/abseil-cpp/absl/flags:config",
  316. "//third_party/abseil-cpp/absl/flags:flag",
  317. "//third_party/abseil-cpp/absl/flags:parse",
  318. "//third_party/abseil-cpp/absl/flags:usage",
  319. "//third_party/abseil-cpp/absl/strings",
  320. ]
  321. }
  322. }
  323. tools_unittests_resources = [
  324. "../resources/foreman_128x96.yuv",
  325. "../resources/foreman_cif.yuv",
  326. "../resources/reference_less_video_test_file.y4m",
  327. ]
  328. if (is_ios) {
  329. bundle_data("tools_unittests_bundle_data") {
  330. testonly = true
  331. sources = tools_unittests_resources
  332. outputs = [
  333. "{{bundle_resources_dir}}/{{source_file_part}}",
  334. ]
  335. }
  336. }
  337. rtc_test("tools_unittests") {
  338. testonly = true
  339. sources = [
  340. "frame_analyzer/linear_least_squares_unittest.cc",
  341. "frame_analyzer/reference_less_video_analysis_unittest.cc",
  342. "frame_analyzer/video_color_aligner_unittest.cc",
  343. "frame_analyzer/video_geometry_aligner_unittest.cc",
  344. "frame_analyzer/video_quality_analysis_unittest.cc",
  345. "frame_analyzer/video_temporal_aligner_unittest.cc",
  346. "sanitizers_unittest.cc",
  347. "video_file_reader_unittest.cc",
  348. "video_file_writer_unittest.cc",
  349. ]
  350. deps = [
  351. ":video_file_reader",
  352. ":video_file_writer",
  353. ":video_quality_analysis",
  354. "../api:scoped_refptr",
  355. "../api/video:video_frame",
  356. "../api/video:video_frame_i420",
  357. "../api/video:video_rtp_headers",
  358. "../common_video",
  359. "../rtc_base",
  360. "../rtc_base:checks",
  361. "../test:fileutils",
  362. "../test:test_main",
  363. "../test:test_support",
  364. "//testing/gtest",
  365. "//third_party/libyuv",
  366. ]
  367. if (!build_with_chromium) {
  368. deps += [ ":reference_less_video_analysis_lib" ]
  369. }
  370. if (rtc_enable_protobuf) {
  371. deps += [ "network_tester:network_tester_unittests" ]
  372. }
  373. data = tools_unittests_resources
  374. if (is_android) {
  375. deps += [ "//testing/android/native_test:native_test_support" ]
  376. shard_timeout = 900
  377. }
  378. if (is_ios) {
  379. deps += [ ":tools_unittests_bundle_data" ]
  380. }
  381. }
  382. if (rtc_enable_protobuf) {
  383. copy("rtp_analyzer") {
  384. sources = [
  385. "py_event_log_analyzer/misc.py",
  386. "py_event_log_analyzer/pb_parse.py",
  387. "py_event_log_analyzer/rtp_analyzer.py",
  388. "py_event_log_analyzer/rtp_analyzer.sh",
  389. ]
  390. outputs = [
  391. "$root_build_dir/{{source_file_part}}",
  392. ]
  393. deps = [
  394. "../logging:rtc_event_log_proto",
  395. ]
  396. } # rtp_analyzer
  397. rtc_executable("unpack_aecdump") {
  398. visibility = [ "*" ]
  399. testonly = true
  400. sources = [
  401. "unpack_aecdump/unpack.cc",
  402. ]
  403. deps = [
  404. "../api:function_view",
  405. "../common_audio",
  406. "../modules/audio_processing",
  407. "../modules/audio_processing:audioproc_debug_proto",
  408. "../modules/audio_processing:audioproc_debug_proto",
  409. "../modules/audio_processing:audioproc_protobuf_utils",
  410. "../modules/audio_processing:audioproc_test_utils",
  411. "../rtc_base:ignore_wundef",
  412. "../rtc_base:protobuf_utils",
  413. "../rtc_base:rtc_base_approved",
  414. "//third_party/abseil-cpp/absl/flags:flag",
  415. "//third_party/abseil-cpp/absl/flags:parse",
  416. ]
  417. } # unpack_aecdump
  418. }
  419. }