Skip to content

Commit

Permalink
Add command-line flag to enable the bugfix to postpone decoding after…
Browse files Browse the repository at this point in the history
… expand.

This CL also excludes several codec mappings depending on compile-time flags.

Bug: webrtc:9289
Change-Id: I1a9183f88378307925b747576a5513e54be3782e
Reviewed-on: https://webrtc-review.googlesource.com/93462
Reviewed-by: Minyue Li <[email protected]>
Commit-Queue: Ivo Creusen <[email protected]>
Cr-Commit-Position: refs/heads/master@{#24259}
  • Loading branch information
Ivo Creusen authored and Commit Bot committed Aug 10, 2018
1 parent d8be107 commit 80006b9
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 26 deletions.
1 change: 1 addition & 0 deletions modules/audio_coding/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1508,6 +1508,7 @@ if (rtc_include_tests) {
defines = []
deps = [
"../../rtc_base:checks",
"../../test:field_trial",
"../../test:fileutils",
]
sources = [
Expand Down
69 changes: 43 additions & 26 deletions modules/audio_coding/neteq/tools/neteq_rtpplay.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "modules/audio_coding/neteq/tools/rtp_file_source.h"
#include "rtc_base/checks.h"
#include "rtc_base/flags.h"
#include "test/field_trial.h"
#include "test/testsupport/fileutils.h"

namespace webrtc {
Expand Down Expand Up @@ -132,6 +133,12 @@ DEFINE_bool(pythonplot,
"Generates a python script for plotting the delay profile");
DEFINE_bool(help, false, "Prints this message");
DEFINE_bool(concealment_events, false, "Prints concealment events");
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.");

// Maps a codec type to a printable name string.
std::string CodecName(NetEqDecoder codec) {
Expand Down Expand Up @@ -292,6 +299,10 @@ int RunTest(int argc, char* argv[]) {
std::cout << usage;
return 0;
}

ValidateFieldTrialsStringOrDie(FLAG_force_fieldtrials);
ScopedFieldTrials field_trials(FLAG_force_fieldtrials);

RTC_CHECK(ValidatePayloadType(FLAG_pcmu));
RTC_CHECK(ValidatePayloadType(FLAG_pcma));
RTC_CHECK(ValidatePayloadType(FLAG_ilbc));
Expand Down Expand Up @@ -397,32 +408,38 @@ int RunTest(int argc, char* argv[]) {
std::cout << "Output file: " << output_file_name << std::endl;

NetEqTest::DecoderMap codecs = {
{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")},
{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")},
{FLAG_pcm16b_swb32,
std::make_pair(NetEqDecoder::kDecoderPCM16Bswb32kHz, "pcm16-swb32")},
{FLAG_pcm16b_swb48,
std::make_pair(NetEqDecoder::kDecoderPCM16Bswb48kHz, "pcm16-swb48")},
{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")},
{FLAG_avt_48, std::make_pair(NetEqDecoder::kDecoderAVT48kHz, "avt-48")},
{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")},
{FLAG_cn_swb48,
std::make_pair(NetEqDecoder::kDecoderCNGswb48kHz, "cng-swb48")}};
{FLAG_pcmu, std::make_pair(NetEqDecoder::kDecoderPCMu, "pcmu")},
{FLAG_pcma, std::make_pair(NetEqDecoder::kDecoderPCMa, "pcma")},
#ifdef WEBRTC_CODEC_ILBC
{FLAG_ilbc, std::make_pair(NetEqDecoder::kDecoderILBC, "ilbc")},
#endif
{FLAG_isac, std::make_pair(NetEqDecoder::kDecoderISAC, "isac")},
#if !defined(WEBRTC_ANDROID)
{FLAG_isac_swb, std::make_pair(NetEqDecoder::kDecoderISACswb, "isac-swb")},
#endif
#ifdef WEBRTC_CODEC_OPUS
{FLAG_opus, std::make_pair(NetEqDecoder::kDecoderOpus, "opus")},
#endif
{FLAG_pcm16b, std::make_pair(NetEqDecoder::kDecoderPCM16B, "pcm16-nb")},
{FLAG_pcm16b_wb,
std::make_pair(NetEqDecoder::kDecoderPCM16Bwb, "pcm16-wb")},
{FLAG_pcm16b_swb32,
std::make_pair(NetEqDecoder::kDecoderPCM16Bswb32kHz, "pcm16-swb32")},
{FLAG_pcm16b_swb48,
std::make_pair(NetEqDecoder::kDecoderPCM16Bswb48kHz, "pcm16-swb48")},
{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")},
{FLAG_avt_48, std::make_pair(NetEqDecoder::kDecoderAVT48kHz, "avt-48")},
{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")},
{FLAG_cn_swb48,
std::make_pair(NetEqDecoder::kDecoderCNGswb48kHz, "cng-swb48")}
};

// Check if a replacement audio file was provided.
std::unique_ptr<AudioDecoder> replacement_decoder;
Expand Down

0 comments on commit 80006b9

Please sign in to comment.