Switch rtp_generator to ABSL_FLAG.
Bug: webrtc:10616 Change-Id: I1913292f29191636019d734abf4097d96f372c74 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/136811 Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28366}
This commit is contained in:

committed by
Commit Bot

parent
beff53527b
commit
a95949e3f5
@ -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",
|
||||
]
|
||||
}
|
||||
|
@ -11,29 +11,28 @@
|
||||
#include <stdlib.h>
|
||||
#include <string>
|
||||
|
||||
#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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user