| Index: webrtc/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc
|
| diff --git a/webrtc/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc b/webrtc/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc
|
| index 8506e326cb48cd15410cd5c950cf5348f1523afd..5a73a6adb1a6978488e72011869846343a0df40d 100644
|
| --- a/webrtc/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc
|
| +++ b/webrtc/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc
|
| @@ -10,9 +10,8 @@
|
|
|
| #include "webrtc/modules/audio_coding/codecs/isac/fix/include/isacfix.h"
|
| #include "webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.h"
|
| +#include "webrtc/rtc_base/flags.h"
|
|
|
| -using google::RegisterFlagValidator;
|
| -using google::ParseCommandLineFlags;
|
| using testing::InitGoogleTest;
|
|
|
| namespace webrtc {
|
| @@ -22,18 +21,7 @@ static const int kIsacBlockDurationMs = 30;
|
| static const int kIsacInputSamplingKhz = 16;
|
| static const int kIsacOutputSamplingKhz = 16;
|
|
|
| -// Define switch for bit rate.
|
| -static bool ValidateBitRate(const char* flagname, int32_t value) {
|
| - if (value >= 10 && value <= 32)
|
| - return true;
|
| - printf("Invalid bit rate, should be between 10 and 32 kbps.");
|
| - return false;
|
| -}
|
| -
|
| -DEFINE_int32(bit_rate_kbps, 32, "Target bit rate (kbps).");
|
| -
|
| -static const bool bit_rate_dummy =
|
| - RegisterFlagValidator(&FLAGS_bit_rate_kbps, &ValidateBitRate);
|
| +DEFINE_int(bit_rate_kbps, 32, "Target bit rate (kbps).");
|
|
|
| } // namespace
|
|
|
| @@ -55,7 +43,11 @@ NetEqIsacQualityTest::NetEqIsacQualityTest()
|
| kIsacOutputSamplingKhz,
|
| NetEqDecoder::kDecoderISAC),
|
| isac_encoder_(NULL),
|
| - bit_rate_kbps_(FLAGS_bit_rate_kbps) {}
|
| + bit_rate_kbps_(FLAG_bit_rate_kbps) {
|
| + // Flag validation
|
| + RTC_CHECK(FLAG_bit_rate_kbps >= 10 && FLAG_bit_rate_kbps <= 32)
|
| + << "Invalid bit rate, should be between 10 and 32 kbps.";
|
| + }
|
|
|
| void NetEqIsacQualityTest::SetUp() {
|
| ASSERT_EQ(1u, channels_) << "iSAC supports only mono audio.";
|
|
|