diff --git a/rtc_tools/BUILD.gn b/rtc_tools/BUILD.gn index c39aaa5806..d0ae7518b2 100644 --- a/rtc_tools/BUILD.gn +++ b/rtc_tools/BUILD.gn @@ -169,7 +169,6 @@ if (!build_with_chromium) { ] deps = [ - ":command_line_parser", "../api:libjingle_peerconnection_api", "../api:transport_api", "../api/video:builtin_video_bitrate_allocator_factory", @@ -195,6 +194,8 @@ if (!build_with_chromium) { "../test:fileutils", "../test:rtp_test_utils", "../test:video_test_common", + "//third_party/abseil-cpp/absl/flags:flag", + "//third_party/abseil-cpp/absl/flags:parse", "//third_party/abseil-cpp/absl/strings", ] } diff --git a/rtc_tools/rtp_generator/main.cc b/rtc_tools/rtp_generator/main.cc index 63958bcb4e..afe6e0a26c 100644 --- a/rtc_tools/rtp_generator/main.cc +++ b/rtc_tools/rtp_generator/main.cc @@ -11,29 +11,28 @@ #include #include +#include "absl/flags/flag.h" +#include "absl/flags/parse.h" #include "rtc_tools/rtp_generator/rtp_generator.h" -#include "rtc_tools/simple_command_line_parser.h" + +ABSL_FLAG(std::string, input_config, "", "JSON file with config"); +ABSL_FLAG(std::string, output_rtpdump, "", "Where to store the rtpdump"); int main(int argc, char* argv[]) { - const std::string usage = - "Generates custom configured rtpdumps for the purpose of testing.\n" - "Example Usage:\n" - "./rtp_generator --input_config=sender_config.json\n" - " --output_rtpdump=my.rtpdump\n"; + absl::ParseCommandLine(argc, argv); - webrtc::test::CommandLineParser cmd_parser; - cmd_parser.Init(argc, argv); - cmd_parser.SetUsageMessage(usage); - cmd_parser.SetFlag("input_config", ""); - cmd_parser.SetFlag("output_rtpdump", ""); - cmd_parser.ProcessFlags(); + // TODO(bugs.webrtc.org/10616): Add program usage message when Abseil + // flags supports it. + // const std::string usage = + // "Generates custom configured rtpdumps for the purpose of testing.\n" + // "Example Usage:\n" + // "./rtp_generator --input_config=sender_config.json\n" + // " --output_rtpdump=my.rtpdump\n"; - const std::string config_path = cmd_parser.GetFlag("input_config"); - const std::string rtp_dump_path = cmd_parser.GetFlag("output_rtpdump"); + const std::string config_path = absl::GetFlag(FLAGS_input_config); + const std::string rtp_dump_path = absl::GetFlag(FLAGS_output_rtpdump); - if (cmd_parser.GetFlag("help") == "true" || rtp_dump_path.empty() || - config_path.empty()) { - cmd_parser.PrintUsageMessage(); + if (rtp_dump_path.empty() || config_path.empty()) { return EXIT_FAILURE; }