Add usage message to rgba_to_i420_converter.
Bug: webrtc:10616
Change-Id: Id8268bada4ec42130d9b7b105da73218dfa43519
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146209
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28614}
diff --git a/rtc_tools/BUILD.gn b/rtc_tools/BUILD.gn
index a982265..18f498f 100644
--- a/rtc_tools/BUILD.gn
+++ b/rtc_tools/BUILD.gn
@@ -248,6 +248,7 @@
"../common_video",
"//third_party/abseil-cpp/absl/flags:flag",
"//third_party/abseil-cpp/absl/flags:parse",
+ "//third_party/abseil-cpp/absl/flags:usage",
"//third_party/libyuv",
]
}
diff --git a/rtc_tools/converter/rgba_to_i420_converter.cc b/rtc_tools/converter/rgba_to_i420_converter.cc
index 2b6670e..6e186ae 100644
--- a/rtc_tools/converter/rgba_to_i420_converter.cc
+++ b/rtc_tools/converter/rgba_to_i420_converter.cc
@@ -15,6 +15,7 @@
#include "absl/flags/flag.h"
#include "absl/flags/parse.h"
+#include "absl/flags/usage.h"
#include "rtc_tools/converter/converter.h"
ABSL_FLAG(int, width, -1, "Width in pixels of the frames in the input file");
@@ -41,24 +42,17 @@
* --height=<height_of_input_frames>
*/
int main(int argc, char* argv[]) {
+ absl::SetProgramUsageMessage(
+ "Converts RGBA raw image files to I420 frames "
+ "for YUV.\n"
+ "Example usage:\n"
+ "./rgba_to_i420_converter --frames_dir=. "
+ "--output_file=output.yuv --width=320 "
+ "--height=240\n"
+ "IMPORTANT: If you pass the --delete_frames "
+ "command line parameter, the tool will delete "
+ "the input frames after conversion.\n");
absl::ParseCommandLine(argc, argv);
- // TODO(bugs.webrtc.org/10616): Add program usage message when Abseil
- // flags supports it.
- // std::string usage =
- // "Converts RGBA raw image files to I420 frames for YUV.\n"
- // "Example usage:\n" +
- // program_name +
- // " --frames_dir=. --output_file=output.yuv --width=320 --height=240\n"
- // "IMPORTANT: If you pass the --delete_frames command line parameter, the
- // " "tool will delete the input frames after conversion.\n" "Command line
- // flags:\n" " - width(int): Width in pixels of the frames in the input
- // file." " Default: -1\n" " - height(int): Height in pixels of the
- // frames in the input file." " Default: -1\n" " - frames_dir(string):
- // The path to the directory where the frames " "reside." " Default: .\n"
- // " - output_file(string): The output file to which frames are written."
- // " Default: output.yuv\n"
- // " - delete_frames(bool): Whether or not to delete the input frames
- // after" " the conversion. Default: false.\n";
int width = absl::GetFlag(FLAGS_width);
int height = absl::GetFlag(FLAGS_height);