Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc

Issue 3005483002: Replace remaining gflags usages with rtc_base/flags (Closed)
Patch Set: Rebase Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc
diff --git a/webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc b/webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc
index c11394b22f07323489dba4aa6a6b4002378d8a2f..d6647e42bc0586e4e9ef480bd009d70c53c893b8 100644
--- a/webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc
+++ b/webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc
@@ -13,6 +13,7 @@
#include <limits.h> // For ULONG_MAX returned by strtoul.
#include <stdio.h>
#include <stdlib.h> // For strtoul.
+#include <string.h>
#include <algorithm>
#include <ios>
@@ -21,7 +22,6 @@
#include <numeric>
#include <string>
-#include "gflags/gflags.h"
#include "webrtc/modules/audio_coding/neteq/include/neteq.h"
#include "webrtc/modules/audio_coding/neteq/tools/fake_decode_from_file.h"
#include "webrtc/modules/audio_coding/neteq/tools/input_audio_file.h"
@@ -34,6 +34,7 @@
#include "webrtc/modules/audio_coding/neteq/tools/rtp_file_source.h"
#include "webrtc/modules/include/module_common_types.h"
#include "webrtc/rtc_base/checks.h"
+#include "webrtc/rtc_base/flags.h"
#include "webrtc/test/testsupport/fileutils.h"
#include "webrtc/typedefs.h"
@@ -65,86 +66,51 @@ bool ParseSsrc(const std::string& str, uint32_t* ssrc) {
}
// Flag validators.
-bool ValidatePayloadType(const char* flagname, int32_t value) {
+bool ValidatePayloadType(int value) {
if (value >= 0 && value <= 127) // Value is ok.
return true;
- printf("Invalid value for --%s: %d\n", flagname, static_cast<int>(value));
+ printf("Payload type must be between 0 and 127, not %d\n",
+ static_cast<int>(value));
return false;
}
-bool ValidateSsrcValue(const char* flagname, const std::string& str) {
+bool ValidateSsrcValue(const std::string& str) {
uint32_t dummy_ssrc;
- return ParseSsrc(str, &dummy_ssrc);
+ if (ParseSsrc(str, &dummy_ssrc)) // Value is ok.
+ return true;
+ printf("Invalid SSRC: %s\n", str.c_str());
+ return false;
}
-static bool ValidateExtensionId(const char* flagname, int32_t value) {
+static bool ValidateExtensionId(int value) {
if (value > 0 && value <= 255) // Value is ok.
return true;
- printf("Invalid value for --%s: %d\n", flagname, static_cast<int>(value));
+ printf("Extension ID must be between 1 and 255, not %d\n",
+ static_cast<int>(value));
return false;
}
// Define command line flags.
-DEFINE_int32(pcmu, 0, "RTP payload type for PCM-u");
-const bool pcmu_dummy =
- google::RegisterFlagValidator(&FLAGS_pcmu, &ValidatePayloadType);
-DEFINE_int32(pcma, 8, "RTP payload type for PCM-a");
-const bool pcma_dummy =
- google::RegisterFlagValidator(&FLAGS_pcma, &ValidatePayloadType);
-DEFINE_int32(ilbc, 102, "RTP payload type for iLBC");
-const bool ilbc_dummy =
- google::RegisterFlagValidator(&FLAGS_ilbc, &ValidatePayloadType);
-DEFINE_int32(isac, 103, "RTP payload type for iSAC");
-const bool isac_dummy =
- google::RegisterFlagValidator(&FLAGS_isac, &ValidatePayloadType);
-DEFINE_int32(isac_swb, 104, "RTP payload type for iSAC-swb (32 kHz)");
-const bool isac_swb_dummy =
- google::RegisterFlagValidator(&FLAGS_isac_swb, &ValidatePayloadType);
-DEFINE_int32(opus, 111, "RTP payload type for Opus");
-const bool opus_dummy =
- google::RegisterFlagValidator(&FLAGS_opus, &ValidatePayloadType);
-DEFINE_int32(pcm16b, 93, "RTP payload type for PCM16b-nb (8 kHz)");
-const bool pcm16b_dummy =
- google::RegisterFlagValidator(&FLAGS_pcm16b, &ValidatePayloadType);
-DEFINE_int32(pcm16b_wb, 94, "RTP payload type for PCM16b-wb (16 kHz)");
-const bool pcm16b_wb_dummy =
- google::RegisterFlagValidator(&FLAGS_pcm16b_wb, &ValidatePayloadType);
-DEFINE_int32(pcm16b_swb32, 95, "RTP payload type for PCM16b-swb32 (32 kHz)");
-const bool pcm16b_swb32_dummy =
- google::RegisterFlagValidator(&FLAGS_pcm16b_swb32, &ValidatePayloadType);
-DEFINE_int32(pcm16b_swb48, 96, "RTP payload type for PCM16b-swb48 (48 kHz)");
-const bool pcm16b_swb48_dummy =
- google::RegisterFlagValidator(&FLAGS_pcm16b_swb48, &ValidatePayloadType);
-DEFINE_int32(g722, 9, "RTP payload type for G.722");
-const bool g722_dummy =
- google::RegisterFlagValidator(&FLAGS_g722, &ValidatePayloadType);
-DEFINE_int32(avt, 106, "RTP payload type for AVT/DTMF (8 kHz)");
-const bool avt_dummy =
- google::RegisterFlagValidator(&FLAGS_avt, &ValidatePayloadType);
-DEFINE_int32(avt_16, 114, "RTP payload type for AVT/DTMF (16 kHz)");
-const bool avt_16_dummy =
- google::RegisterFlagValidator(&FLAGS_avt_16, &ValidatePayloadType);
-DEFINE_int32(avt_32, 115, "RTP payload type for AVT/DTMF (32 kHz)");
-const bool avt_32_dummy =
- google::RegisterFlagValidator(&FLAGS_avt_32, &ValidatePayloadType);
-DEFINE_int32(avt_48, 116, "RTP payload type for AVT/DTMF (48 kHz)");
-const bool avt_48_dummy =
- google::RegisterFlagValidator(&FLAGS_avt_48, &ValidatePayloadType);
-DEFINE_int32(red, 117, "RTP payload type for redundant audio (RED)");
-const bool red_dummy =
- google::RegisterFlagValidator(&FLAGS_red, &ValidatePayloadType);
-DEFINE_int32(cn_nb, 13, "RTP payload type for comfort noise (8 kHz)");
-const bool cn_nb_dummy =
- google::RegisterFlagValidator(&FLAGS_cn_nb, &ValidatePayloadType);
-DEFINE_int32(cn_wb, 98, "RTP payload type for comfort noise (16 kHz)");
-const bool cn_wb_dummy =
- google::RegisterFlagValidator(&FLAGS_cn_wb, &ValidatePayloadType);
-DEFINE_int32(cn_swb32, 99, "RTP payload type for comfort noise (32 kHz)");
-const bool cn_swb32_dummy =
- google::RegisterFlagValidator(&FLAGS_cn_swb32, &ValidatePayloadType);
-DEFINE_int32(cn_swb48, 100, "RTP payload type for comfort noise (48 kHz)");
-const bool cn_swb48_dummy =
- google::RegisterFlagValidator(&FLAGS_cn_swb48, &ValidatePayloadType);
+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_bool(codec_map, false, "Prints the mapping between RTP payload type and "
"codec");
DEFINE_string(replacement_audio_file, "",
@@ -153,21 +119,13 @@ DEFINE_string(ssrc,
"",
"Only use packets with this SSRC (decimal or hex, the latter "
"starting with 0x)");
-const bool hex_ssrc_dummy =
- google::RegisterFlagValidator(&FLAGS_ssrc, &ValidateSsrcValue);
-DEFINE_int32(audio_level, 1, "Extension ID for audio level (RFC 6464)");
-const bool audio_level_dummy =
- google::RegisterFlagValidator(&FLAGS_audio_level, &ValidateExtensionId);
-DEFINE_int32(abs_send_time, 3, "Extension ID for absolute sender time");
-const bool abs_send_time_dummy =
- google::RegisterFlagValidator(&FLAGS_abs_send_time, &ValidateExtensionId);
-DEFINE_int32(transport_seq_no, 5, "Extension ID for transport sequence number");
-const bool transport_seq_no_dummy =
- google::RegisterFlagValidator(&FLAGS_transport_seq_no,
- &ValidateExtensionId);
+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_bool(matlabplot,
false,
"Generates a matlab script for plotting the delay profile");
+DEFINE_bool(help, false, "Prints this message");
// Maps a codec type to a printable name string.
std::string CodecName(NetEqDecoder codec) {
@@ -218,51 +176,51 @@ std::string CodecName(NetEqDecoder codec) {
}
}
-void PrintCodecMappingEntry(NetEqDecoder codec, google::int32 flag) {
+void PrintCodecMappingEntry(NetEqDecoder codec, int flag) {
std::cout << CodecName(codec) << ": " << flag << std::endl;
}
void PrintCodecMapping() {
- PrintCodecMappingEntry(NetEqDecoder::kDecoderPCMu, FLAGS_pcmu);
- PrintCodecMappingEntry(NetEqDecoder::kDecoderPCMa, FLAGS_pcma);
- PrintCodecMappingEntry(NetEqDecoder::kDecoderILBC, FLAGS_ilbc);
- PrintCodecMappingEntry(NetEqDecoder::kDecoderISAC, FLAGS_isac);
- PrintCodecMappingEntry(NetEqDecoder::kDecoderISACswb, FLAGS_isac_swb);
- PrintCodecMappingEntry(NetEqDecoder::kDecoderOpus, FLAGS_opus);
- PrintCodecMappingEntry(NetEqDecoder::kDecoderPCM16B, FLAGS_pcm16b);
- PrintCodecMappingEntry(NetEqDecoder::kDecoderPCM16Bwb, FLAGS_pcm16b_wb);
+ PrintCodecMappingEntry(NetEqDecoder::kDecoderPCMu, FLAG_pcmu);
+ PrintCodecMappingEntry(NetEqDecoder::kDecoderPCMa, FLAG_pcma);
+ PrintCodecMappingEntry(NetEqDecoder::kDecoderILBC, FLAG_ilbc);
+ PrintCodecMappingEntry(NetEqDecoder::kDecoderISAC, FLAG_isac);
+ PrintCodecMappingEntry(NetEqDecoder::kDecoderISACswb, FLAG_isac_swb);
+ PrintCodecMappingEntry(NetEqDecoder::kDecoderOpus, FLAG_opus);
+ PrintCodecMappingEntry(NetEqDecoder::kDecoderPCM16B, FLAG_pcm16b);
+ PrintCodecMappingEntry(NetEqDecoder::kDecoderPCM16Bwb, FLAG_pcm16b_wb);
PrintCodecMappingEntry(NetEqDecoder::kDecoderPCM16Bswb32kHz,
- FLAGS_pcm16b_swb32);
+ FLAG_pcm16b_swb32);
PrintCodecMappingEntry(NetEqDecoder::kDecoderPCM16Bswb48kHz,
- FLAGS_pcm16b_swb48);
- PrintCodecMappingEntry(NetEqDecoder::kDecoderG722, FLAGS_g722);
- PrintCodecMappingEntry(NetEqDecoder::kDecoderAVT, FLAGS_avt);
- PrintCodecMappingEntry(NetEqDecoder::kDecoderAVT16kHz, FLAGS_avt_16);
- PrintCodecMappingEntry(NetEqDecoder::kDecoderAVT32kHz, FLAGS_avt_32);
- PrintCodecMappingEntry(NetEqDecoder::kDecoderAVT48kHz, FLAGS_avt_48);
- PrintCodecMappingEntry(NetEqDecoder::kDecoderRED, FLAGS_red);
- PrintCodecMappingEntry(NetEqDecoder::kDecoderCNGnb, FLAGS_cn_nb);
- PrintCodecMappingEntry(NetEqDecoder::kDecoderCNGwb, FLAGS_cn_wb);
- PrintCodecMappingEntry(NetEqDecoder::kDecoderCNGswb32kHz, FLAGS_cn_swb32);
- PrintCodecMappingEntry(NetEqDecoder::kDecoderCNGswb48kHz, FLAGS_cn_swb48);
+ FLAG_pcm16b_swb48);
+ PrintCodecMappingEntry(NetEqDecoder::kDecoderG722, FLAG_g722);
+ PrintCodecMappingEntry(NetEqDecoder::kDecoderAVT, FLAG_avt);
+ PrintCodecMappingEntry(NetEqDecoder::kDecoderAVT16kHz, FLAG_avt_16);
+ PrintCodecMappingEntry(NetEqDecoder::kDecoderAVT32kHz, FLAG_avt_32);
+ PrintCodecMappingEntry(NetEqDecoder::kDecoderAVT48kHz, FLAG_avt_48);
+ PrintCodecMappingEntry(NetEqDecoder::kDecoderRED, FLAG_red);
+ PrintCodecMappingEntry(NetEqDecoder::kDecoderCNGnb, FLAG_cn_nb);
+ PrintCodecMappingEntry(NetEqDecoder::kDecoderCNGwb, FLAG_cn_wb);
+ PrintCodecMappingEntry(NetEqDecoder::kDecoderCNGswb32kHz, FLAG_cn_swb32);
+ PrintCodecMappingEntry(NetEqDecoder::kDecoderCNGswb48kHz, FLAG_cn_swb48);
}
rtc::Optional<int> CodecSampleRate(uint8_t payload_type) {
- if (payload_type == FLAGS_pcmu || payload_type == FLAGS_pcma ||
- payload_type == FLAGS_ilbc || payload_type == FLAGS_pcm16b ||
- payload_type == FLAGS_cn_nb || payload_type == FLAGS_avt)
+ if (payload_type == FLAG_pcmu || payload_type == FLAG_pcma ||
+ payload_type == FLAG_ilbc || payload_type == FLAG_pcm16b ||
+ payload_type == FLAG_cn_nb || payload_type == FLAG_avt)
return rtc::Optional<int>(8000);
- if (payload_type == FLAGS_isac || payload_type == FLAGS_pcm16b_wb ||
- payload_type == FLAGS_g722 || payload_type == FLAGS_cn_wb ||
- payload_type == FLAGS_avt_16)
+ if (payload_type == FLAG_isac || payload_type == FLAG_pcm16b_wb ||
+ payload_type == FLAG_g722 || payload_type == FLAG_cn_wb ||
+ payload_type == FLAG_avt_16)
return rtc::Optional<int>(16000);
- if (payload_type == FLAGS_isac_swb || payload_type == FLAGS_pcm16b_swb32 ||
- payload_type == FLAGS_cn_swb32 || payload_type == FLAGS_avt_32)
+ if (payload_type == FLAG_isac_swb || payload_type == FLAG_pcm16b_swb32 ||
+ payload_type == FLAG_cn_swb32 || payload_type == FLAG_avt_32)
return rtc::Optional<int>(32000);
- if (payload_type == FLAGS_opus || payload_type == FLAGS_pcm16b_swb48 ||
- payload_type == FLAGS_cn_swb48 || payload_type == FLAGS_avt_48)
+ if (payload_type == FLAG_opus || payload_type == FLAG_pcm16b_swb48 ||
+ payload_type == FLAG_cn_swb48 || payload_type == FLAG_avt_48)
return rtc::Optional<int>(48000);
- if (payload_type == FLAGS_red)
+ if (payload_type == FLAG_red)
return rtc::Optional<int>(0);
return rtc::Optional<int>();
}
@@ -460,31 +418,61 @@ class StatsGetter : public NetEqGetAudioCallback {
int RunTest(int argc, char* argv[]) {
std::string program_name = argv[0];
std::string usage = "Tool for decoding an RTP dump file using NetEq.\n"
- "Run " + program_name + " --helpshort for usage.\n"
+ "Run " + program_name + " --help for usage.\n"
"Example usage:\n" + program_name +
" input.rtp output.{pcm, wav}\n";
- google::SetUsageMessage(usage);
- google::ParseCommandLineFlags(&argc, &argv, true);
+ if (rtc::FlagList::SetFlagsFromCommandLine(&argc, argv, true)) {
+ return 1;
+ }
+ if (FLAG_help) {
+ std::cout << usage;
+ rtc::FlagList::Print(nullptr, false);
+ return 0;
+ }
- if (FLAGS_codec_map) {
+ if (FLAG_codec_map) {
PrintCodecMapping();
}
if (argc != 3) {
- if (FLAGS_codec_map) {
+ if (FLAG_codec_map) {
// We have already printed the codec map. Just end the program.
return 0;
}
// Print usage information.
- std::cout << google::ProgramUsage();
+ std::cout << usage;
return 0;
}
+ RTC_CHECK(ValidatePayloadType(FLAG_pcmu));
+ RTC_CHECK(ValidatePayloadType(FLAG_pcma));
+ RTC_CHECK(ValidatePayloadType(FLAG_ilbc));
+ RTC_CHECK(ValidatePayloadType(FLAG_isac));
+ RTC_CHECK(ValidatePayloadType(FLAG_isac_swb));
+ RTC_CHECK(ValidatePayloadType(FLAG_opus));
+ RTC_CHECK(ValidatePayloadType(FLAG_pcm16b));
+ RTC_CHECK(ValidatePayloadType(FLAG_pcm16b_wb));
+ RTC_CHECK(ValidatePayloadType(FLAG_pcm16b_swb32));
+ RTC_CHECK(ValidatePayloadType(FLAG_pcm16b_swb48));
+ RTC_CHECK(ValidatePayloadType(FLAG_g722));
+ RTC_CHECK(ValidatePayloadType(FLAG_avt));
+ RTC_CHECK(ValidatePayloadType(FLAG_avt_16));
+ RTC_CHECK(ValidatePayloadType(FLAG_avt_32));
+ RTC_CHECK(ValidatePayloadType(FLAG_avt_48));
+ RTC_CHECK(ValidatePayloadType(FLAG_red));
+ RTC_CHECK(ValidatePayloadType(FLAG_cn_nb));
+ RTC_CHECK(ValidatePayloadType(FLAG_cn_wb));
+ RTC_CHECK(ValidatePayloadType(FLAG_cn_swb32));
+ RTC_CHECK(ValidatePayloadType(FLAG_cn_swb48));
+ RTC_CHECK(ValidateSsrcValue(FLAG_ssrc));
+ RTC_CHECK(ValidateExtensionId(FLAG_audio_level));
+ RTC_CHECK(ValidateExtensionId(FLAG_abs_send_time));
+ RTC_CHECK(ValidateExtensionId(FLAG_transport_seq_no));
// Gather RTP header extensions in a map.
NetEqPacketSourceInput::RtpHeaderExtensionMap rtp_ext_map = {
- {FLAGS_audio_level, kRtpExtensionAudioLevel},
- {FLAGS_abs_send_time, kRtpExtensionAbsoluteSendTime},
- {FLAGS_transport_seq_no, kRtpExtensionTransportSequenceNumber}};
+ {FLAG_audio_level, kRtpExtensionAudioLevel},
+ {FLAG_abs_send_time, kRtpExtensionAbsoluteSendTime},
+ {FLAG_transport_seq_no, kRtpExtensionTransportSequenceNumber}};
const std::string input_file_name = argv[1];
std::unique_ptr<NetEqInput> input;
@@ -500,9 +488,9 @@ int RunTest(int argc, char* argv[]) {
RTC_CHECK(!input->ended()) << "Input file is empty";
// Check if an SSRC value was provided.
- if (!FLAGS_ssrc.empty()) {
+ if (strlen(FLAG_ssrc) > 0) {
uint32_t ssrc;
- RTC_CHECK(ParseSsrc(FLAGS_ssrc, &ssrc)) << "Flag verification has failed.";
+ RTC_CHECK(ParseSsrc(FLAG_ssrc, &ssrc)) << "Flag verification has failed.";
input.reset(new FilterSsrcInput(std::move(input), ssrc));
}
@@ -557,39 +545,39 @@ int RunTest(int argc, char* argv[]) {
std::cout << "Output file: " << output_file_name << std::endl;
NetEqTest::DecoderMap codecs = {
- {FLAGS_pcmu, std::make_pair(NetEqDecoder::kDecoderPCMu, "pcmu")},
- {FLAGS_pcma, std::make_pair(NetEqDecoder::kDecoderPCMa, "pcma")},
- {FLAGS_ilbc, std::make_pair(NetEqDecoder::kDecoderILBC, "ilbc")},
- {FLAGS_isac, std::make_pair(NetEqDecoder::kDecoderISAC, "isac")},
- {FLAGS_isac_swb,
+ {FLAG_pcmu, std::make_pair(NetEqDecoder::kDecoderPCMu, "pcmu")},
+ {FLAG_pcma, std::make_pair(NetEqDecoder::kDecoderPCMa, "pcma")},
+ {FLAG_ilbc, std::make_pair(NetEqDecoder::kDecoderILBC, "ilbc")},
+ {FLAG_isac, std::make_pair(NetEqDecoder::kDecoderISAC, "isac")},
+ {FLAG_isac_swb,
std::make_pair(NetEqDecoder::kDecoderISACswb, "isac-swb")},
- {FLAGS_opus, std::make_pair(NetEqDecoder::kDecoderOpus, "opus")},
- {FLAGS_pcm16b, std::make_pair(NetEqDecoder::kDecoderPCM16B, "pcm16-nb")},
- {FLAGS_pcm16b_wb,
+ {FLAG_opus, std::make_pair(NetEqDecoder::kDecoderOpus, "opus")},
+ {FLAG_pcm16b, std::make_pair(NetEqDecoder::kDecoderPCM16B, "pcm16-nb")},
+ {FLAG_pcm16b_wb,
std::make_pair(NetEqDecoder::kDecoderPCM16Bwb, "pcm16-wb")},
- {FLAGS_pcm16b_swb32,
+ {FLAG_pcm16b_swb32,
std::make_pair(NetEqDecoder::kDecoderPCM16Bswb32kHz, "pcm16-swb32")},
- {FLAGS_pcm16b_swb48,
+ {FLAG_pcm16b_swb48,
std::make_pair(NetEqDecoder::kDecoderPCM16Bswb48kHz, "pcm16-swb48")},
- {FLAGS_g722, std::make_pair(NetEqDecoder::kDecoderG722, "g722")},
- {FLAGS_avt, std::make_pair(NetEqDecoder::kDecoderAVT, "avt")},
- {FLAGS_avt_16, std::make_pair(NetEqDecoder::kDecoderAVT16kHz, "avt-16")},
- {FLAGS_avt_32,
+ {FLAG_g722, std::make_pair(NetEqDecoder::kDecoderG722, "g722")},
+ {FLAG_avt, std::make_pair(NetEqDecoder::kDecoderAVT, "avt")},
+ {FLAG_avt_16, std::make_pair(NetEqDecoder::kDecoderAVT16kHz, "avt-16")},
+ {FLAG_avt_32,
std::make_pair(NetEqDecoder::kDecoderAVT32kHz, "avt-32")},
- {FLAGS_avt_48,
+ {FLAG_avt_48,
std::make_pair(NetEqDecoder::kDecoderAVT48kHz, "avt-48")},
- {FLAGS_red, std::make_pair(NetEqDecoder::kDecoderRED, "red")},
- {FLAGS_cn_nb, std::make_pair(NetEqDecoder::kDecoderCNGnb, "cng-nb")},
- {FLAGS_cn_wb, std::make_pair(NetEqDecoder::kDecoderCNGwb, "cng-wb")},
- {FLAGS_cn_swb32,
+ {FLAG_red, std::make_pair(NetEqDecoder::kDecoderRED, "red")},
+ {FLAG_cn_nb, std::make_pair(NetEqDecoder::kDecoderCNGnb, "cng-nb")},
+ {FLAG_cn_wb, std::make_pair(NetEqDecoder::kDecoderCNGwb, "cng-wb")},
+ {FLAG_cn_swb32,
std::make_pair(NetEqDecoder::kDecoderCNGswb32kHz, "cng-swb32")},
- {FLAGS_cn_swb48,
+ {FLAG_cn_swb48,
std::make_pair(NetEqDecoder::kDecoderCNGswb48kHz, "cng-swb48")}};
// Check if a replacement audio file was provided.
std::unique_ptr<AudioDecoder> replacement_decoder;
NetEqTest::ExtDecoderMap ext_codecs;
- if (!FLAGS_replacement_audio_file.empty()) {
+ if (strlen(FLAG_replacement_audio_file) > 0) {
// Find largest unused payload type.
int replacement_pt = 127;
while (!(codecs.find(replacement_pt) == codecs.end() &&
@@ -607,16 +595,16 @@ int RunTest(int argc, char* argv[]) {
};
std::set<uint8_t> cn_types = std_set_int32_to_uint8(
- {FLAGS_cn_nb, FLAGS_cn_wb, FLAGS_cn_swb32, FLAGS_cn_swb48});
+ {FLAG_cn_nb, FLAG_cn_wb, FLAG_cn_swb32, FLAG_cn_swb48});
std::set<uint8_t> forbidden_types =
- std_set_int32_to_uint8({FLAGS_g722, FLAGS_red, FLAGS_avt,
- FLAGS_avt_16, FLAGS_avt_32, FLAGS_avt_48});
+ std_set_int32_to_uint8({FLAG_g722, FLAG_red, FLAG_avt,
+ FLAG_avt_16, FLAG_avt_32, FLAG_avt_48});
input.reset(new NetEqReplacementInput(std::move(input), replacement_pt,
cn_types, forbidden_types));
replacement_decoder.reset(new FakeDecodeFromFile(
std::unique_ptr<InputAudioFile>(
- new InputAudioFile(FLAGS_replacement_audio_file)),
+ new InputAudioFile(FLAG_replacement_audio_file)),
48000, false));
NetEqTest::ExternalDecoderInfo ext_dec_info = {
replacement_decoder.get(), NetEqDecoder::kDecoderArbitrary,
@@ -626,7 +614,7 @@ int RunTest(int argc, char* argv[]) {
NetEqTest::Callbacks callbacks;
std::unique_ptr<NetEqDelayAnalyzer> delay_analyzer;
- if (FLAGS_matlabplot) {
+ if (FLAG_matlabplot) {
delay_analyzer.reset(new NetEqDelayAnalyzer);
}
@@ -641,7 +629,7 @@ int RunTest(int argc, char* argv[]) {
int64_t test_duration_ms = test.Run();
- if (FLAGS_matlabplot) {
+ if (FLAG_matlabplot) {
auto matlab_script_name = output_file_name;
std::replace(matlab_script_name.begin(), matlab_script_name.end(), '.',
'_');
« no previous file with comments | « webrtc/modules/audio_coding/neteq/test/neteq_speed_test.cc ('k') | webrtc/modules/audio_coding/neteq/tools/rtp_analyze.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698