Reland "Prefix flag macros with WEBRTC_."
This is a reland of 5ccdc1331fcc3cd78eaa14408fe0c38d37a5a51d Original change's description: > Prefix flag macros with WEBRTC_. > > Macros defined in rtc_base/flags.h are intended to be used to define > flags in WebRTC's binaries (e.g. tests). > > They are currently not prefixed and this could cause problems with > downstream clients since these names are quite common. > > This CL adds the 'WEBRTC_' prefix to them. > > Generated with: > > for x in DECLARE DEFINE; do > for y in bool int float string FLAG; do > git grep -l "\b$x\_$y\b" | \ > xargs sed -i "s/\b$x\_$y\b/WEBRTC_$x\_$y/g" > done > done > git cl format > > Bug: webrtc:9884 > Change-Id: I7b524762b6a3e5aa5b2fc2395edd3e1a0fe72591 > Reviewed-on: https://webrtc-review.googlesource.com/c/106682 > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#25270} TBR=kwiberg@webrtc.org Bug: webrtc:9884 Change-Id: I5ba5368a231a334d135ed5e6fd7a279629ced8a3 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://webrtc-review.googlesource.com/c/107161 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25277}
This commit is contained in:
committed by
Commit Bot
parent
c538fc77b0
commit
2dfa998be2
@ -52,7 +52,7 @@ RTC_PUSH_IGNORING_WUNDEF()
|
||||
RTC_POP_IGNORING_WUNDEF()
|
||||
#endif
|
||||
|
||||
DEFINE_bool(gen_ref, false, "Generate reference files.");
|
||||
WEBRTC_DEFINE_bool(gen_ref, false, "Generate reference files.");
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ namespace {
|
||||
static const int kInputSampleRateKhz = 8;
|
||||
static const int kOutputSampleRateKhz = 8;
|
||||
|
||||
DEFINE_int(frame_size_ms, 20, "Codec frame size (milliseconds).");
|
||||
WEBRTC_DEFINE_int(frame_size_ms, 20, "Codec frame size (milliseconds).");
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ static const int kIsacBlockDurationMs = 30;
|
||||
static const int kIsacInputSamplingKhz = 16;
|
||||
static const int kIsacOutputSamplingKhz = 16;
|
||||
|
||||
DEFINE_int(bit_rate_kbps, 32, "Target bit rate (kbps).");
|
||||
WEBRTC_DEFINE_int(bit_rate_kbps, 32, "Target bit rate (kbps).");
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
@ -22,24 +22,26 @@ namespace {
|
||||
static const int kOpusBlockDurationMs = 20;
|
||||
static const int kOpusSamplingKhz = 48;
|
||||
|
||||
DEFINE_int(bit_rate_kbps, 32, "Target bit rate (kbps).");
|
||||
WEBRTC_DEFINE_int(bit_rate_kbps, 32, "Target bit rate (kbps).");
|
||||
|
||||
DEFINE_int(complexity,
|
||||
10,
|
||||
"Complexity: 0 ~ 10 -- defined as in Opus"
|
||||
"specification.");
|
||||
WEBRTC_DEFINE_int(complexity,
|
||||
10,
|
||||
"Complexity: 0 ~ 10 -- defined as in Opus"
|
||||
"specification.");
|
||||
|
||||
DEFINE_int(maxplaybackrate, 48000, "Maximum playback rate (Hz).");
|
||||
WEBRTC_DEFINE_int(maxplaybackrate, 48000, "Maximum playback rate (Hz).");
|
||||
|
||||
DEFINE_int(application, 0, "Application mode: 0 -- VOIP, 1 -- Audio.");
|
||||
WEBRTC_DEFINE_int(application, 0, "Application mode: 0 -- VOIP, 1 -- Audio.");
|
||||
|
||||
DEFINE_int(reported_loss_rate, 10, "Reported percentile of packet loss.");
|
||||
WEBRTC_DEFINE_int(reported_loss_rate,
|
||||
10,
|
||||
"Reported percentile of packet loss.");
|
||||
|
||||
DEFINE_bool(fec, false, "Enable FEC for encoding (-nofec to disable).");
|
||||
WEBRTC_DEFINE_bool(fec, false, "Enable FEC for encoding (-nofec to disable).");
|
||||
|
||||
DEFINE_bool(dtx, false, "Enable DTX for encoding (-nodtx to disable).");
|
||||
WEBRTC_DEFINE_bool(dtx, false, "Enable DTX for encoding (-nodtx to disable).");
|
||||
|
||||
DEFINE_int(sub_packets, 1, "Number of sub packets to repacketize.");
|
||||
WEBRTC_DEFINE_int(sub_packets, 1, "Number of sub packets to repacketize.");
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ namespace {
|
||||
static const int kInputSampleRateKhz = 48;
|
||||
static const int kOutputSampleRateKhz = 48;
|
||||
|
||||
DEFINE_int(frame_size_ms, 20, "Codec frame size (milliseconds).");
|
||||
WEBRTC_DEFINE_int(frame_size_ms, 20, "Codec frame size (milliseconds).");
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ namespace {
|
||||
static const int kInputSampleRateKhz = 8;
|
||||
static const int kOutputSampleRateKhz = 8;
|
||||
|
||||
DEFINE_int(frame_size_ms, 20, "Codec frame size (milliseconds).");
|
||||
WEBRTC_DEFINE_int(frame_size_ms, 20, "Codec frame size (milliseconds).");
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
@ -16,10 +16,10 @@
|
||||
#include "rtc_base/flags.h"
|
||||
|
||||
// Define command line flags.
|
||||
DEFINE_int(runtime_ms, 10000, "Simulated runtime in ms.");
|
||||
DEFINE_int(lossrate, 10, "Packet lossrate; drop every N packets.");
|
||||
DEFINE_float(drift, 0.1f, "Clockdrift factor.");
|
||||
DEFINE_bool(help, false, "Print this message.");
|
||||
WEBRTC_DEFINE_int(runtime_ms, 10000, "Simulated runtime in ms.");
|
||||
WEBRTC_DEFINE_int(lossrate, 10, "Packet lossrate; drop every N packets.");
|
||||
WEBRTC_DEFINE_float(drift, 0.1f, "Clockdrift factor.");
|
||||
WEBRTC_DEFINE_bool(help, false, "Print this message.");
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
std::string program_name = argv[0];
|
||||
|
||||
@ -47,42 +47,47 @@ static bool ValidateFilename(const std::string& value, bool write) {
|
||||
return true;
|
||||
}
|
||||
|
||||
DEFINE_string(
|
||||
WEBRTC_DEFINE_string(
|
||||
in_filename,
|
||||
DefaultInFilename().c_str(),
|
||||
"Filename for input audio (specify sample rate with --input_sample_rate, "
|
||||
"and channels with --channels).");
|
||||
|
||||
DEFINE_int(input_sample_rate, 16000, "Sample rate of input file in Hz.");
|
||||
WEBRTC_DEFINE_int(input_sample_rate, 16000, "Sample rate of input file in Hz.");
|
||||
|
||||
DEFINE_int(channels, 1, "Number of channels in input audio.");
|
||||
WEBRTC_DEFINE_int(channels, 1, "Number of channels in input audio.");
|
||||
|
||||
DEFINE_string(out_filename,
|
||||
DefaultOutFilename().c_str(),
|
||||
"Name of output audio file.");
|
||||
WEBRTC_DEFINE_string(out_filename,
|
||||
DefaultOutFilename().c_str(),
|
||||
"Name of output audio file.");
|
||||
|
||||
DEFINE_int(runtime_ms, 10000, "Simulated runtime (milliseconds).");
|
||||
WEBRTC_DEFINE_int(runtime_ms, 10000, "Simulated runtime (milliseconds).");
|
||||
|
||||
DEFINE_int(packet_loss_rate, 10, "Percentile of packet loss.");
|
||||
WEBRTC_DEFINE_int(packet_loss_rate, 10, "Percentile of packet loss.");
|
||||
|
||||
DEFINE_int(random_loss_mode,
|
||||
kUniformLoss,
|
||||
"Random loss mode: 0--no loss, 1--uniform loss, 2--Gilbert Elliot "
|
||||
"loss, 3--fixed loss.");
|
||||
WEBRTC_DEFINE_int(
|
||||
random_loss_mode,
|
||||
kUniformLoss,
|
||||
"Random loss mode: 0--no loss, 1--uniform loss, 2--Gilbert Elliot "
|
||||
"loss, 3--fixed loss.");
|
||||
|
||||
DEFINE_int(burst_length,
|
||||
30,
|
||||
"Burst length in milliseconds, only valid for Gilbert Elliot loss.");
|
||||
WEBRTC_DEFINE_int(
|
||||
burst_length,
|
||||
30,
|
||||
"Burst length in milliseconds, only valid for Gilbert Elliot loss.");
|
||||
|
||||
DEFINE_float(drift_factor, 0.0, "Time drift factor.");
|
||||
WEBRTC_DEFINE_float(drift_factor, 0.0, "Time drift factor.");
|
||||
|
||||
DEFINE_int(preload_packets, 0, "Preload the buffer with this many packets.");
|
||||
WEBRTC_DEFINE_int(preload_packets,
|
||||
0,
|
||||
"Preload the buffer with this many packets.");
|
||||
|
||||
DEFINE_string(loss_events,
|
||||
"",
|
||||
"List of loss events time and duration separated by comma: "
|
||||
"<first_event_time> <first_event_duration>, <second_event_time> "
|
||||
"<second_event_duration>, ...");
|
||||
WEBRTC_DEFINE_string(
|
||||
loss_events,
|
||||
"",
|
||||
"List of loss events time and duration separated by comma: "
|
||||
"<first_event_time> <first_event_duration>, <second_event_time> "
|
||||
"<second_event_duration>, ...");
|
||||
|
||||
// ProbTrans00Solver() is to calculate the transition probability from no-loss
|
||||
// state to itself in a modified Gilbert Elliot packet loss model. The result is
|
||||
|
||||
@ -17,17 +17,17 @@
|
||||
#include "system_wrappers/include/field_trial.h"
|
||||
#include "test/field_trial.h"
|
||||
|
||||
DEFINE_bool(codec_map,
|
||||
false,
|
||||
"Prints the mapping between RTP payload type and "
|
||||
"codec");
|
||||
DEFINE_string(
|
||||
WEBRTC_DEFINE_bool(codec_map,
|
||||
false,
|
||||
"Prints the mapping between RTP payload type and "
|
||||
"codec");
|
||||
WEBRTC_DEFINE_string(
|
||||
force_fieldtrials,
|
||||
"",
|
||||
"Field trials control experimental feature code which can be forced. "
|
||||
"E.g. running with --force_fieldtrials=WebRTC-FooFeature/Enable/"
|
||||
" will assign the group Enable to field trial WebRTC-FooFeature.");
|
||||
DEFINE_bool(help, false, "Prints this message");
|
||||
WEBRTC_DEFINE_bool(help, false, "Prints this message");
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
webrtc::test::NetEqTestFactory factory;
|
||||
|
||||
@ -91,50 +91,57 @@ static bool ValidateExtensionId(int value) {
|
||||
}
|
||||
|
||||
// Define command line flags.
|
||||
DEFINE_int(pcmu, 0, "RTP payload type for PCM-u");
|
||||
DEFINE_int(pcma, 8, "RTP payload type for PCM-a");
|
||||
DEFINE_int(ilbc, 102, "RTP payload type for iLBC");
|
||||
DEFINE_int(isac, 103, "RTP payload type for iSAC");
|
||||
DEFINE_int(isac_swb, 104, "RTP payload type for iSAC-swb (32 kHz)");
|
||||
DEFINE_int(opus, 111, "RTP payload type for Opus");
|
||||
DEFINE_int(pcm16b, 93, "RTP payload type for PCM16b-nb (8 kHz)");
|
||||
DEFINE_int(pcm16b_wb, 94, "RTP payload type for PCM16b-wb (16 kHz)");
|
||||
DEFINE_int(pcm16b_swb32, 95, "RTP payload type for PCM16b-swb32 (32 kHz)");
|
||||
DEFINE_int(pcm16b_swb48, 96, "RTP payload type for PCM16b-swb48 (48 kHz)");
|
||||
DEFINE_int(g722, 9, "RTP payload type for G.722");
|
||||
DEFINE_int(avt, 106, "RTP payload type for AVT/DTMF (8 kHz)");
|
||||
DEFINE_int(avt_16, 114, "RTP payload type for AVT/DTMF (16 kHz)");
|
||||
DEFINE_int(avt_32, 115, "RTP payload type for AVT/DTMF (32 kHz)");
|
||||
DEFINE_int(avt_48, 116, "RTP payload type for AVT/DTMF (48 kHz)");
|
||||
DEFINE_int(red, 117, "RTP payload type for redundant audio (RED)");
|
||||
DEFINE_int(cn_nb, 13, "RTP payload type for comfort noise (8 kHz)");
|
||||
DEFINE_int(cn_wb, 98, "RTP payload type for comfort noise (16 kHz)");
|
||||
DEFINE_int(cn_swb32, 99, "RTP payload type for comfort noise (32 kHz)");
|
||||
DEFINE_int(cn_swb48, 100, "RTP payload type for comfort noise (48 kHz)");
|
||||
DEFINE_string(replacement_audio_file,
|
||||
"",
|
||||
"A PCM file that will be used to populate "
|
||||
"dummy"
|
||||
" RTP packets");
|
||||
DEFINE_string(ssrc,
|
||||
"",
|
||||
"Only use packets with this SSRC (decimal or hex, the latter "
|
||||
"starting with 0x)");
|
||||
DEFINE_int(audio_level, 1, "Extension ID for audio level (RFC 6464)");
|
||||
DEFINE_int(abs_send_time, 3, "Extension ID for absolute sender time");
|
||||
DEFINE_int(transport_seq_no, 5, "Extension ID for transport sequence number");
|
||||
DEFINE_int(video_content_type, 7, "Extension ID for video content type");
|
||||
DEFINE_int(video_timing, 8, "Extension ID for video timing");
|
||||
DEFINE_bool(matlabplot,
|
||||
false,
|
||||
"Generates a matlab script for plotting the delay profile");
|
||||
DEFINE_bool(pythonplot,
|
||||
false,
|
||||
"Generates a python script for plotting the delay profile");
|
||||
DEFINE_bool(concealment_events, false, "Prints concealment events");
|
||||
DEFINE_int(max_nr_packets_in_buffer,
|
||||
50,
|
||||
"Maximum allowed number of packets in the buffer");
|
||||
WEBRTC_DEFINE_int(pcmu, 0, "RTP payload type for PCM-u");
|
||||
WEBRTC_DEFINE_int(pcma, 8, "RTP payload type for PCM-a");
|
||||
WEBRTC_DEFINE_int(ilbc, 102, "RTP payload type for iLBC");
|
||||
WEBRTC_DEFINE_int(isac, 103, "RTP payload type for iSAC");
|
||||
WEBRTC_DEFINE_int(isac_swb, 104, "RTP payload type for iSAC-swb (32 kHz)");
|
||||
WEBRTC_DEFINE_int(opus, 111, "RTP payload type for Opus");
|
||||
WEBRTC_DEFINE_int(pcm16b, 93, "RTP payload type for PCM16b-nb (8 kHz)");
|
||||
WEBRTC_DEFINE_int(pcm16b_wb, 94, "RTP payload type for PCM16b-wb (16 kHz)");
|
||||
WEBRTC_DEFINE_int(pcm16b_swb32,
|
||||
95,
|
||||
"RTP payload type for PCM16b-swb32 (32 kHz)");
|
||||
WEBRTC_DEFINE_int(pcm16b_swb48,
|
||||
96,
|
||||
"RTP payload type for PCM16b-swb48 (48 kHz)");
|
||||
WEBRTC_DEFINE_int(g722, 9, "RTP payload type for G.722");
|
||||
WEBRTC_DEFINE_int(avt, 106, "RTP payload type for AVT/DTMF (8 kHz)");
|
||||
WEBRTC_DEFINE_int(avt_16, 114, "RTP payload type for AVT/DTMF (16 kHz)");
|
||||
WEBRTC_DEFINE_int(avt_32, 115, "RTP payload type for AVT/DTMF (32 kHz)");
|
||||
WEBRTC_DEFINE_int(avt_48, 116, "RTP payload type for AVT/DTMF (48 kHz)");
|
||||
WEBRTC_DEFINE_int(red, 117, "RTP payload type for redundant audio (RED)");
|
||||
WEBRTC_DEFINE_int(cn_nb, 13, "RTP payload type for comfort noise (8 kHz)");
|
||||
WEBRTC_DEFINE_int(cn_wb, 98, "RTP payload type for comfort noise (16 kHz)");
|
||||
WEBRTC_DEFINE_int(cn_swb32, 99, "RTP payload type for comfort noise (32 kHz)");
|
||||
WEBRTC_DEFINE_int(cn_swb48, 100, "RTP payload type for comfort noise (48 kHz)");
|
||||
WEBRTC_DEFINE_string(replacement_audio_file,
|
||||
"",
|
||||
"A PCM file that will be used to populate "
|
||||
"dummy"
|
||||
" RTP packets");
|
||||
WEBRTC_DEFINE_string(
|
||||
ssrc,
|
||||
"",
|
||||
"Only use packets with this SSRC (decimal or hex, the latter "
|
||||
"starting with 0x)");
|
||||
WEBRTC_DEFINE_int(audio_level, 1, "Extension ID for audio level (RFC 6464)");
|
||||
WEBRTC_DEFINE_int(abs_send_time, 3, "Extension ID for absolute sender time");
|
||||
WEBRTC_DEFINE_int(transport_seq_no,
|
||||
5,
|
||||
"Extension ID for transport sequence number");
|
||||
WEBRTC_DEFINE_int(video_content_type, 7, "Extension ID for video content type");
|
||||
WEBRTC_DEFINE_int(video_timing, 8, "Extension ID for video timing");
|
||||
WEBRTC_DEFINE_bool(matlabplot,
|
||||
false,
|
||||
"Generates a matlab script for plotting the delay profile");
|
||||
WEBRTC_DEFINE_bool(pythonplot,
|
||||
false,
|
||||
"Generates a python script for plotting the delay profile");
|
||||
WEBRTC_DEFINE_bool(concealment_events, false, "Prints concealment events");
|
||||
WEBRTC_DEFINE_int(max_nr_packets_in_buffer,
|
||||
50,
|
||||
"Maximum allowed number of packets in the buffer");
|
||||
|
||||
// Maps a codec type to a printable name string.
|
||||
std::string CodecName(NetEqDecoder codec) {
|
||||
|
||||
@ -19,16 +19,16 @@
|
||||
#include "rtc_base/flags.h"
|
||||
|
||||
// Define command line flags.
|
||||
DEFINE_int(red, 117, "RTP payload type for RED");
|
||||
DEFINE_int(audio_level,
|
||||
-1,
|
||||
"Extension ID for audio level (RFC 6464); "
|
||||
"-1 not to print audio level");
|
||||
DEFINE_int(abs_send_time,
|
||||
-1,
|
||||
"Extension ID for absolute sender time; "
|
||||
"-1 not to print absolute send time");
|
||||
DEFINE_bool(help, false, "Print this message");
|
||||
WEBRTC_DEFINE_int(red, 117, "RTP payload type for RED");
|
||||
WEBRTC_DEFINE_int(audio_level,
|
||||
-1,
|
||||
"Extension ID for audio level (RFC 6464); "
|
||||
"-1 not to print audio level");
|
||||
WEBRTC_DEFINE_int(abs_send_time,
|
||||
-1,
|
||||
"Extension ID for absolute sender time; "
|
||||
"-1 not to print absolute send time");
|
||||
WEBRTC_DEFINE_bool(help, false, "Print this message");
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
std::string program_name = argv[0];
|
||||
|
||||
@ -40,20 +40,24 @@ namespace test {
|
||||
namespace {
|
||||
|
||||
// Define command line flags.
|
||||
DEFINE_bool(list_codecs, false, "Enumerate all codecs");
|
||||
DEFINE_string(codec, "opus", "Codec to use");
|
||||
DEFINE_int(frame_len, 0, "Frame length in ms; 0 indicates codec default value");
|
||||
DEFINE_int(bitrate, 0, "Bitrate in kbps; 0 indicates codec default value");
|
||||
DEFINE_int(payload_type,
|
||||
-1,
|
||||
"RTP payload type; -1 indicates codec default value");
|
||||
DEFINE_int(cng_payload_type,
|
||||
-1,
|
||||
"RTP payload type for CNG; -1 indicates default value");
|
||||
DEFINE_int(ssrc, 0, "SSRC to write to the RTP header");
|
||||
DEFINE_bool(dtx, false, "Use DTX/CNG");
|
||||
DEFINE_int(sample_rate, 48000, "Sample rate of the input file");
|
||||
DEFINE_bool(help, false, "Print this message");
|
||||
WEBRTC_DEFINE_bool(list_codecs, false, "Enumerate all codecs");
|
||||
WEBRTC_DEFINE_string(codec, "opus", "Codec to use");
|
||||
WEBRTC_DEFINE_int(frame_len,
|
||||
0,
|
||||
"Frame length in ms; 0 indicates codec default value");
|
||||
WEBRTC_DEFINE_int(bitrate,
|
||||
0,
|
||||
"Bitrate in kbps; 0 indicates codec default value");
|
||||
WEBRTC_DEFINE_int(payload_type,
|
||||
-1,
|
||||
"RTP payload type; -1 indicates codec default value");
|
||||
WEBRTC_DEFINE_int(cng_payload_type,
|
||||
-1,
|
||||
"RTP payload type for CNG; -1 indicates default value");
|
||||
WEBRTC_DEFINE_int(ssrc, 0, "SSRC to write to the RTP header");
|
||||
WEBRTC_DEFINE_bool(dtx, false, "Use DTX/CNG");
|
||||
WEBRTC_DEFINE_int(sample_rate, 48000, "Sample rate of the input file");
|
||||
WEBRTC_DEFINE_bool(help, false, "Print this message");
|
||||
|
||||
// Add new codecs here, and to the map below.
|
||||
enum class CodecType {
|
||||
|
||||
@ -23,7 +23,7 @@ namespace webrtc {
|
||||
namespace test {
|
||||
namespace {
|
||||
|
||||
DEFINE_bool(help, false, "Print help message");
|
||||
WEBRTC_DEFINE_bool(help, false, "Print help message");
|
||||
|
||||
constexpr size_t kRtpDumpHeaderLength = 8;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user