From 67bcb609a33a551687e382d29c673bcb27fe42a4 Mon Sep 17 00:00:00 2001 From: Henrik Kjellander Date: Wed, 7 Oct 2015 08:42:52 +0200 Subject: [PATCH] GN: Port frame_analyzer and rgba_to_i420_converter targets Original patch by tfarina@chromium.org at https://webrtc-codereview.appspot.com/42999004/ BUG=chromium:461019, webrtc:4504 TESTED=Tested on Linux with the following command lines: $ gn gen/out/Debug --args='is_debug=true build_with_chromium=false' $ ninja -C out/Debug frame_analyzer rgba_to_i420_converter Also successfully compiled from a Chromium checkout using the steps in webrtc:4504. R=tfarina@chromium.org Review URL: https://codereview.webrtc.org/1387243002 . Cr-Commit-Position: refs/heads/master@{#10193} --- webrtc/tools/BUILD.gn | 39 ++++++++++++++++++- .../frame_analyzer/video_quality_analysis.cc | 3 ++ .../frame_analyzer/video_quality_analysis.h | 3 ++ webrtc/tools/internal_tools.gyp | 5 ++- 4 files changed, 48 insertions(+), 2 deletions(-) diff --git a/webrtc/tools/BUILD.gn b/webrtc/tools/BUILD.gn index 1378e18913..0daba4d6c8 100644 --- a/webrtc/tools/BUILD.gn +++ b/webrtc/tools/BUILD.gn @@ -19,11 +19,48 @@ source_set("command_line_parser") { "simple_command_line_parser.cc", "simple_command_line_parser.h", ] - + deps = [ + "..:gtest_prod", + ] configs += [ "..:common_config" ] public_configs = [ "..:common_inherited_config" ] } +source_set("video_quality_analysis") { + sources = [ + "frame_analyzer/video_quality_analysis.cc", + "frame_analyzer/video_quality_analysis.h", + ] + deps = [ + "../common_video", + ] + public_deps = [ + "../common_video", + ] +} + +executable("frame_analyzer") { + sources = [ + "frame_analyzer/frame_analyzer.cc", + ] + deps = [ + ":command_line_parser", + ":video_quality_analysis", + ] +} + +executable("rgba_to_i420_converter") { + sources = [ + "converter/converter.cc", + "converter/converter.h", + "converter/rgba_to_i420_converter.cc", + ] + deps = [ + ":command_line_parser", + "../common_video", + ] +} + # TODO(kjellander): Convert all of tools.gyp into GN here. if (!build_with_chromium) { diff --git a/webrtc/tools/frame_analyzer/video_quality_analysis.cc b/webrtc/tools/frame_analyzer/video_quality_analysis.cc index f5608c8343..5c707bb6e3 100644 --- a/webrtc/tools/frame_analyzer/video_quality_analysis.cc +++ b/webrtc/tools/frame_analyzer/video_quality_analysis.cc @@ -26,6 +26,9 @@ namespace test { using std::string; +ResultsContainer::ResultsContainer() {} +ResultsContainer::~ResultsContainer() {} + int GetI420FrameSize(int width, int height) { int half_width = (width + 1) >> 1; int half_height = (height + 1) >> 1; diff --git a/webrtc/tools/frame_analyzer/video_quality_analysis.h b/webrtc/tools/frame_analyzer/video_quality_analysis.h index 4704a8cde9..49b6f1210e 100644 --- a/webrtc/tools/frame_analyzer/video_quality_analysis.h +++ b/webrtc/tools/frame_analyzer/video_quality_analysis.h @@ -32,6 +32,9 @@ struct AnalysisResult { }; struct ResultsContainer { + ResultsContainer(); + ~ResultsContainer(); + std::vector frames; }; diff --git a/webrtc/tools/internal_tools.gyp b/webrtc/tools/internal_tools.gyp index 9d5fe25dac..40dc371a06 100644 --- a/webrtc/tools/internal_tools.gyp +++ b/webrtc/tools/internal_tools.gyp @@ -20,6 +20,9 @@ 'simple_command_line_parser.h', 'simple_command_line_parser.cc', ], + 'deps': [ + '<(webrtc_root)/common.gyp:gtest_prod', + ], }, # command_line_parser ], -} \ No newline at end of file +}