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}
diff --git a/modules/audio_coding/neteq/neteq_unittest.cc b/modules/audio_coding/neteq/neteq_unittest.cc
index 3c63aa7..1c9b9e7 100644
--- a/modules/audio_coding/neteq/neteq_unittest.cc
+++ b/modules/audio_coding/neteq/neteq_unittest.cc
@@ -52,7 +52,7 @@
RTC_POP_IGNORING_WUNDEF()
#endif
-DEFINE_bool(gen_ref, false, "Generate reference files.");
+WEBRTC_DEFINE_bool(gen_ref, false, "Generate reference files.");
namespace webrtc {
diff --git a/modules/audio_coding/neteq/test/neteq_ilbc_quality_test.cc b/modules/audio_coding/neteq/test/neteq_ilbc_quality_test.cc
index ad61235..6f10345 100644
--- a/modules/audio_coding/neteq/test/neteq_ilbc_quality_test.cc
+++ b/modules/audio_coding/neteq/test/neteq_ilbc_quality_test.cc
@@ -25,7 +25,7 @@
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
diff --git a/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc b/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc
index 94984b87..651b0ca 100644
--- a/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc
+++ b/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc
@@ -21,7 +21,7 @@
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
diff --git a/modules/audio_coding/neteq/test/neteq_opus_quality_test.cc b/modules/audio_coding/neteq/test/neteq_opus_quality_test.cc
index 6861e4c..f4a3636 100644
--- a/modules/audio_coding/neteq/test/neteq_opus_quality_test.cc
+++ b/modules/audio_coding/neteq/test/neteq_opus_quality_test.cc
@@ -22,24 +22,26 @@
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
diff --git a/modules/audio_coding/neteq/test/neteq_pcm16b_quality_test.cc b/modules/audio_coding/neteq/test/neteq_pcm16b_quality_test.cc
index 8872b94..9c53919 100644
--- a/modules/audio_coding/neteq/test/neteq_pcm16b_quality_test.cc
+++ b/modules/audio_coding/neteq/test/neteq_pcm16b_quality_test.cc
@@ -26,7 +26,7 @@
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
diff --git a/modules/audio_coding/neteq/test/neteq_pcmu_quality_test.cc b/modules/audio_coding/neteq/test/neteq_pcmu_quality_test.cc
index 54ff849..85f2267 100644
--- a/modules/audio_coding/neteq/test/neteq_pcmu_quality_test.cc
+++ b/modules/audio_coding/neteq/test/neteq_pcmu_quality_test.cc
@@ -25,7 +25,7 @@
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
diff --git a/modules/audio_coding/neteq/test/neteq_speed_test.cc b/modules/audio_coding/neteq/test/neteq_speed_test.cc
index c1d78c5..70777a2 100644
--- a/modules/audio_coding/neteq/test/neteq_speed_test.cc
+++ b/modules/audio_coding/neteq/test/neteq_speed_test.cc
@@ -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];
diff --git a/modules/audio_coding/neteq/tools/neteq_quality_test.cc b/modules/audio_coding/neteq/tools/neteq_quality_test.cc
index faca895..2ee6779 100644
--- a/modules/audio_coding/neteq/tools/neteq_quality_test.cc
+++ b/modules/audio_coding/neteq/tools/neteq_quality_test.cc
@@ -47,42 +47,47 @@
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
diff --git a/modules/audio_coding/neteq/tools/neteq_rtpplay.cc b/modules/audio_coding/neteq/tools/neteq_rtpplay.cc
index 25e8cd8..c2726eb 100644
--- a/modules/audio_coding/neteq/tools/neteq_rtpplay.cc
+++ b/modules/audio_coding/neteq/tools/neteq_rtpplay.cc
@@ -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;
diff --git a/modules/audio_coding/neteq/tools/neteq_test_factory.cc b/modules/audio_coding/neteq/tools/neteq_test_factory.cc
index df3a9f0..93da54c 100644
--- a/modules/audio_coding/neteq/tools/neteq_test_factory.cc
+++ b/modules/audio_coding/neteq/tools/neteq_test_factory.cc
@@ -91,50 +91,57 @@
}
// 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) {
diff --git a/modules/audio_coding/neteq/tools/rtp_analyze.cc b/modules/audio_coding/neteq/tools/rtp_analyze.cc
index f939038..9d3041e 100644
--- a/modules/audio_coding/neteq/tools/rtp_analyze.cc
+++ b/modules/audio_coding/neteq/tools/rtp_analyze.cc
@@ -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];
diff --git a/modules/audio_coding/neteq/tools/rtp_encode.cc b/modules/audio_coding/neteq/tools/rtp_encode.cc
index 5065ca1..f48b04d 100644
--- a/modules/audio_coding/neteq/tools/rtp_encode.cc
+++ b/modules/audio_coding/neteq/tools/rtp_encode.cc
@@ -40,20 +40,24 @@
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 {
diff --git a/modules/audio_coding/neteq/tools/rtp_jitter.cc b/modules/audio_coding/neteq/tools/rtp_jitter.cc
index 3c49443..92a7a8d 100644
--- a/modules/audio_coding/neteq/tools/rtp_jitter.cc
+++ b/modules/audio_coding/neteq/tools/rtp_jitter.cc
@@ -23,7 +23,7 @@
namespace test {
namespace {
-DEFINE_bool(help, false, "Print help message");
+WEBRTC_DEFINE_bool(help, false, "Print help message");
constexpr size_t kRtpDumpHeaderLength = 8;