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 = [
|
deps = [
|
||||||
":command_line_parser",
|
|
||||||
"../api:libjingle_peerconnection_api",
|
"../api:libjingle_peerconnection_api",
|
||||||
"../api:transport_api",
|
"../api:transport_api",
|
||||||
"../api/video:builtin_video_bitrate_allocator_factory",
|
"../api/video:builtin_video_bitrate_allocator_factory",
|
||||||
@ -195,6 +194,8 @@ if (!build_with_chromium) {
|
|||||||
"../test:fileutils",
|
"../test:fileutils",
|
||||||
"../test:rtp_test_utils",
|
"../test:rtp_test_utils",
|
||||||
"../test:video_test_common",
|
"../test:video_test_common",
|
||||||
|
"//third_party/abseil-cpp/absl/flags:flag",
|
||||||
|
"//third_party/abseil-cpp/absl/flags:parse",
|
||||||
"//third_party/abseil-cpp/absl/strings",
|
"//third_party/abseil-cpp/absl/strings",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -11,29 +11,28 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include "absl/flags/flag.h"
|
||||||
|
#include "absl/flags/parse.h"
|
||||||
#include "rtc_tools/rtp_generator/rtp_generator.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[]) {
|
int main(int argc, char* argv[]) {
|
||||||
const std::string usage =
|
absl::ParseCommandLine(argc, argv);
|
||||||
"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";
|
|
||||||
|
|
||||||
webrtc::test::CommandLineParser cmd_parser;
|
// TODO(bugs.webrtc.org/10616): Add program usage message when Abseil
|
||||||
cmd_parser.Init(argc, argv);
|
// flags supports it.
|
||||||
cmd_parser.SetUsageMessage(usage);
|
// const std::string usage =
|
||||||
cmd_parser.SetFlag("input_config", "");
|
// "Generates custom configured rtpdumps for the purpose of testing.\n"
|
||||||
cmd_parser.SetFlag("output_rtpdump", "");
|
// "Example Usage:\n"
|
||||||
cmd_parser.ProcessFlags();
|
// "./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 config_path = absl::GetFlag(FLAGS_input_config);
|
||||||
const std::string rtp_dump_path = cmd_parser.GetFlag("output_rtpdump");
|
const std::string rtp_dump_path = absl::GetFlag(FLAGS_output_rtpdump);
|
||||||
|
|
||||||
if (cmd_parser.GetFlag("help") == "true" || rtp_dump_path.empty() ||
|
if (rtp_dump_path.empty() || config_path.empty()) {
|
||||||
config_path.empty()) {
|
|
||||||
cmd_parser.PrintUsageMessage();
|
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user