diff --git a/modules/audio_coding/BUILD.gn b/modules/audio_coding/BUILD.gn index 698107400a..1f034ebc2d 100644 --- a/modules/audio_coding/BUILD.gn +++ b/modules/audio_coding/BUILD.gn @@ -42,7 +42,6 @@ rtc_static_library("audio_coding") { deps = [ ":audio_coding_module_typedefs", ":neteq", - ":neteq_decoder_enum", "..:module_api", "..:module_api_public", "../..:webrtc_common", @@ -907,18 +906,6 @@ rtc_static_library("audio_network_adaptor") { } } -rtc_source_set("neteq_decoder_enum") { - sources = [ - "neteq/neteq_decoder_enum.cc", - "neteq/neteq_decoder_enum.h", - ] - deps = [ - "../../api/audio_codecs:audio_codecs_api", - "../../rtc_base:rtc_base_approved", - "//third_party/abseil-cpp/absl/types:optional", - ] -} - rtc_static_library("neteq") { visibility += webrtc_default_visibility sources = [ @@ -991,7 +978,6 @@ rtc_static_library("neteq") { deps = [ ":audio_coding_module_typedefs", - ":neteq_decoder_enum", ":webrtc_cng", "..:module_api", "..:module_api_public", @@ -2028,7 +2014,6 @@ if (rtc_include_tests) { ":legacy_encoded_audio_frame", ":mocks", ":neteq", - ":neteq_decoder_enum", ":neteq_test_support", ":neteq_test_tools", ":pcm16b", diff --git a/modules/audio_coding/acm2/acm_receiver.cc b/modules/audio_coding/acm2/acm_receiver.cc index ea84036fb5..2810294e1d 100644 --- a/modules/audio_coding/acm2/acm_receiver.cc +++ b/modules/audio_coding/acm2/acm_receiver.cc @@ -21,7 +21,6 @@ #include "modules/audio_coding/acm2/acm_resampler.h" #include "modules/audio_coding/acm2/call_statistics.h" #include "modules/audio_coding/neteq/include/neteq.h" -#include "modules/audio_coding/neteq/neteq_decoder_enum.h" #include "modules/include/module_common_types.h" #include "rtc_base/checks.h" #include "rtc_base/logging.h" diff --git a/modules/audio_coding/codecs/legacy_encoded_audio_frame_unittest.cc b/modules/audio_coding/codecs/legacy_encoded_audio_frame_unittest.cc index 14993f8920..54a362d59e 100644 --- a/modules/audio_coding/codecs/legacy_encoded_audio_frame_unittest.cc +++ b/modules/audio_coding/codecs/legacy_encoded_audio_frame_unittest.cc @@ -10,12 +10,28 @@ #include "modules/audio_coding/codecs/legacy_encoded_audio_frame.h" -#include "modules/audio_coding/neteq/neteq_decoder_enum.h" #include "rtc_base/numerics/safe_conversions.h" #include "test/gtest.h" namespace webrtc { +enum class NetEqDecoder { + kDecoderPCMu, + kDecoderPCMa, + kDecoderPCMu_2ch, + kDecoderPCMa_2ch, + kDecoderPCM16B, + kDecoderPCM16Bwb, + kDecoderPCM16Bswb32kHz, + kDecoderPCM16Bswb48kHz, + kDecoderPCM16B_2ch, + kDecoderPCM16Bwb_2ch, + kDecoderPCM16Bswb32kHz_2ch, + kDecoderPCM16Bswb48kHz_2ch, + kDecoderPCM16B_5ch, + kDecoderG722, +}; + class SplitBySamplesTest : public ::testing::TestWithParam { protected: virtual void SetUp() { diff --git a/modules/audio_coding/neteq/decoder_database.cc b/modules/audio_coding/neteq/decoder_database.cc index 348724ca97..2049569c50 100644 --- a/modules/audio_coding/neteq/decoder_database.cc +++ b/modules/audio_coding/neteq/decoder_database.cc @@ -52,12 +52,6 @@ DecoderDatabase::DecoderInfo::DecoderInfo( AudioDecoderFactory* factory) : DecoderInfo(audio_format, codec_pair_id, factory, audio_format.name) {} -DecoderDatabase::DecoderInfo::DecoderInfo( - NetEqDecoder ct, - absl::optional codec_pair_id, - AudioDecoderFactory* factory) - : DecoderInfo(*NetEqDecoderToSdpAudioFormat(ct), codec_pair_id, factory) {} - DecoderDatabase::DecoderInfo::DecoderInfo(DecoderInfo&&) = default; DecoderDatabase::DecoderInfo::~DecoderInfo() = default; diff --git a/modules/audio_coding/neteq/decoder_database.h b/modules/audio_coding/neteq/decoder_database.h index 3198d15e55..f0163377c5 100644 --- a/modules/audio_coding/neteq/decoder_database.h +++ b/modules/audio_coding/neteq/decoder_database.h @@ -18,7 +18,6 @@ #include "api/audio_codecs/audio_decoder_factory.h" #include "api/audio_codecs/audio_format.h" #include "modules/audio_coding/codecs/cng/webrtc_cng.h" -#include "modules/audio_coding/neteq/neteq_decoder_enum.h" #include "modules/audio_coding/neteq/packet.h" #include "rtc_base/constructormagic.h" #include "rtc_base/scoped_ref_ptr.h" @@ -47,9 +46,6 @@ class DecoderDatabase { explicit DecoderInfo(const SdpAudioFormat& audio_format, absl::optional codec_pair_id, AudioDecoderFactory* factory = nullptr); - explicit DecoderInfo(NetEqDecoder ct, - absl::optional codec_pair_id, - AudioDecoderFactory* factory = nullptr); DecoderInfo(DecoderInfo&&); ~DecoderInfo(); diff --git a/modules/audio_coding/neteq/include/neteq.h b/modules/audio_coding/neteq/include/neteq.h index 0d9d4777e7..dec49c1b4c 100644 --- a/modules/audio_coding/neteq/include/neteq.h +++ b/modules/audio_coding/neteq/include/neteq.h @@ -13,15 +13,16 @@ #include // Provide access to size_t. +#include #include #include #include "absl/types/optional.h" #include "api/audio_codecs/audio_codec_pair_id.h" #include "api/audio_codecs/audio_decoder.h" +#include "api/audio_codecs/audio_format.h" #include "api/rtp_headers.h" #include "modules/audio_coding/neteq/defines.h" -#include "modules/audio_coding/neteq/neteq_decoder_enum.h" #include "rtc_base/constructormagic.h" #include "rtc_base/scoped_ref_ptr.h" diff --git a/modules/audio_coding/neteq/neteq_decoder_enum.cc b/modules/audio_coding/neteq/neteq_decoder_enum.cc deleted file mode 100644 index e3b633e85d..0000000000 --- a/modules/audio_coding/neteq/neteq_decoder_enum.cc +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include "modules/audio_coding/neteq/neteq_decoder_enum.h" - -namespace webrtc { - -absl::optional NetEqDecoderToSdpAudioFormat(NetEqDecoder nd) { - switch (nd) { - case NetEqDecoder::kDecoderPCMu: - return SdpAudioFormat("pcmu", 8000, 1); - case NetEqDecoder::kDecoderPCMa: - return SdpAudioFormat("pcma", 8000, 1); - case NetEqDecoder::kDecoderPCMu_2ch: - return SdpAudioFormat("pcmu", 8000, 2); - case NetEqDecoder::kDecoderPCMa_2ch: - return SdpAudioFormat("pcma", 8000, 2); - case NetEqDecoder::kDecoderILBC: - return SdpAudioFormat("ilbc", 8000, 1); - case NetEqDecoder::kDecoderISAC: - return SdpAudioFormat("isac", 16000, 1); - case NetEqDecoder::kDecoderISACswb: - return SdpAudioFormat("isac", 32000, 1); - case NetEqDecoder::kDecoderPCM16B: - return SdpAudioFormat("l16", 8000, 1); - case NetEqDecoder::kDecoderPCM16Bwb: - return SdpAudioFormat("l16", 16000, 1); - case NetEqDecoder::kDecoderPCM16Bswb32kHz: - return SdpAudioFormat("l16", 32000, 1); - case NetEqDecoder::kDecoderPCM16Bswb48kHz: - return SdpAudioFormat("l16", 48000, 1); - case NetEqDecoder::kDecoderPCM16B_2ch: - return SdpAudioFormat("l16", 8000, 2); - case NetEqDecoder::kDecoderPCM16Bwb_2ch: - return SdpAudioFormat("l16", 16000, 2); - case NetEqDecoder::kDecoderPCM16Bswb32kHz_2ch: - return SdpAudioFormat("l16", 32000, 2); - case NetEqDecoder::kDecoderPCM16Bswb48kHz_2ch: - return SdpAudioFormat("l16", 48000, 2); - case NetEqDecoder::kDecoderPCM16B_5ch: - return SdpAudioFormat("l16", 8000, 5); - case NetEqDecoder::kDecoderG722: - return SdpAudioFormat("g722", 8000, 1); - case NetEqDecoder::kDecoderG722_2ch: - return SdpAudioFormat("g722", 8000, 2); - case NetEqDecoder::kDecoderOpus: - return SdpAudioFormat("opus", 48000, 2); - case NetEqDecoder::kDecoderOpus_2ch: - return SdpAudioFormat( - "opus", 48000, 2, - std::map{{"stereo", "1"}}); - case NetEqDecoder::kDecoderRED: - return SdpAudioFormat("red", 8000, 1); - case NetEqDecoder::kDecoderAVT: - return SdpAudioFormat("telephone-event", 8000, 1); - case NetEqDecoder::kDecoderAVT16kHz: - return SdpAudioFormat("telephone-event", 16000, 1); - case NetEqDecoder::kDecoderAVT32kHz: - return SdpAudioFormat("telephone-event", 32000, 1); - case NetEqDecoder::kDecoderAVT48kHz: - return SdpAudioFormat("telephone-event", 48000, 1); - case NetEqDecoder::kDecoderCNGnb: - return SdpAudioFormat("cn", 8000, 1); - case NetEqDecoder::kDecoderCNGwb: - return SdpAudioFormat("cn", 16000, 1); - case NetEqDecoder::kDecoderCNGswb32kHz: - return SdpAudioFormat("cn", 32000, 1); - case NetEqDecoder::kDecoderCNGswb48kHz: - return SdpAudioFormat("cn", 48000, 1); - default: - return absl::nullopt; - } -} - -} // namespace webrtc diff --git a/modules/audio_coding/neteq/neteq_decoder_enum.h b/modules/audio_coding/neteq/neteq_decoder_enum.h deleted file mode 100644 index f40e247a55..0000000000 --- a/modules/audio_coding/neteq/neteq_decoder_enum.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef MODULES_AUDIO_CODING_NETEQ_NETEQ_DECODER_ENUM_H_ -#define MODULES_AUDIO_CODING_NETEQ_NETEQ_DECODER_ENUM_H_ - -#include "absl/types/optional.h" -#include "api/audio_codecs/audio_format.h" - -namespace webrtc { - -// TODO(bugs.webrtc.org/10080): Delete, together with RegisterExternalDecoder. -enum class NetEqDecoder { - kDecoderPCMu, - kDecoderPCMa, - kDecoderPCMu_2ch, - kDecoderPCMa_2ch, - kDecoderILBC, - kDecoderISAC, - kDecoderISACswb, - kDecoderPCM16B, - kDecoderPCM16Bwb, - kDecoderPCM16Bswb32kHz, - kDecoderPCM16Bswb48kHz, - kDecoderPCM16B_2ch, - kDecoderPCM16Bwb_2ch, - kDecoderPCM16Bswb32kHz_2ch, - kDecoderPCM16Bswb48kHz_2ch, - kDecoderPCM16B_5ch, - kDecoderG722, - kDecoderG722_2ch, - kDecoderRED, - kDecoderAVT, - kDecoderAVT16kHz, - kDecoderAVT32kHz, - kDecoderAVT48kHz, - kDecoderCNGnb, - kDecoderCNGwb, - kDecoderCNGswb32kHz, - kDecoderCNGswb48kHz, - kDecoderArbitrary, - kDecoderOpus, - kDecoderOpus_2ch, -}; - -absl::optional NetEqDecoderToSdpAudioFormat(NetEqDecoder nd); - -} // namespace webrtc - -#endif // MODULES_AUDIO_CODING_NETEQ_NETEQ_DECODER_ENUM_H_ diff --git a/modules/audio_coding/neteq/neteq_impl_unittest.cc b/modules/audio_coding/neteq/neteq_impl_unittest.cc index dd1fa8c105..68acd8de27 100644 --- a/modules/audio_coding/neteq/neteq_impl_unittest.cc +++ b/modules/audio_coding/neteq/neteq_impl_unittest.cc @@ -331,8 +331,8 @@ TEST_F(NetEqImplTest, InsertPacket) { *dec = std::move(mock_decoder); })); - DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu, absl::nullopt, - mock_decoder_factory); + DecoderDatabase::DecoderInfo info(SdpAudioFormat("pcmu", 8000, 1), + absl::nullopt, mock_decoder_factory); // Expectations for decoder database. EXPECT_CALL(*mock_decoder_database_, GetDecoderInfo(kPayloadType)) diff --git a/modules/audio_coding/neteq/neteq_unittest.cc b/modules/audio_coding/neteq/neteq_unittest.cc index 6169c52e7f..6e0041382a 100644 --- a/modules/audio_coding/neteq/neteq_unittest.cc +++ b/modules/audio_coding/neteq/neteq_unittest.cc @@ -258,7 +258,6 @@ class NetEqDecodingTest : public ::testing::Test { NetEqDecodingTest(); virtual void SetUp(); virtual void TearDown(); - void SelectDecoders(NetEqDecoder* used_codec); void OpenInputFile(const std::string& rtp_file); void Process(); diff --git a/modules/audio_coding/neteq/packet_buffer_unittest.cc b/modules/audio_coding/neteq/packet_buffer_unittest.cc index cb40d7da32..7a381eec1e 100644 --- a/modules/audio_coding/neteq/packet_buffer_unittest.cc +++ b/modules/audio_coding/neteq/packet_buffer_unittest.cc @@ -175,7 +175,7 @@ TEST(PacketBuffer, InsertPacketList) { MockDecoderDatabase decoder_database; auto factory = CreateBuiltinAudioDecoderFactory(); - const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu, + const DecoderDatabase::DecoderInfo info(SdpAudioFormat("pcmu", 8000, 1), absl::nullopt, factory); EXPECT_CALL(decoder_database, GetDecoderInfo(0)) .WillRepeatedly(Return(&info)); @@ -220,11 +220,11 @@ TEST(PacketBuffer, InsertPacketListChangePayloadType) { MockDecoderDatabase decoder_database; auto factory = CreateBuiltinAudioDecoderFactory(); - const DecoderDatabase::DecoderInfo info0(NetEqDecoder::kDecoderPCMu, + const DecoderDatabase::DecoderInfo info0(SdpAudioFormat("pcmu", 8000, 1), absl::nullopt, factory); EXPECT_CALL(decoder_database, GetDecoderInfo(0)) .WillRepeatedly(Return(&info0)); - const DecoderDatabase::DecoderInfo info1(NetEqDecoder::kDecoderPCMa, + const DecoderDatabase::DecoderInfo info1(SdpAudioFormat("pcma", 8000, 1), absl::nullopt, factory); EXPECT_CALL(decoder_database, GetDecoderInfo(1)) .WillRepeatedly(Return(&info1)); @@ -407,7 +407,7 @@ TEST(PacketBuffer, Reordering) { MockDecoderDatabase decoder_database; auto factory = CreateBuiltinAudioDecoderFactory(); - const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu, + const DecoderDatabase::DecoderInfo info(SdpAudioFormat("pcmu", 8000, 1), absl::nullopt, factory); EXPECT_CALL(decoder_database, GetDecoderInfo(0)) .WillRepeatedly(Return(&info)); @@ -447,12 +447,12 @@ TEST(PacketBuffer, CngFirstThenSpeechWithNewSampleRate) { MockDecoderDatabase decoder_database; auto factory = CreateBuiltinAudioDecoderFactory(); - const DecoderDatabase::DecoderInfo info_cng(NetEqDecoder::kDecoderCNGnb, + const DecoderDatabase::DecoderInfo info_cng(SdpAudioFormat("cn", 8000, 1), absl::nullopt, factory); EXPECT_CALL(decoder_database, GetDecoderInfo(kCngPt)) .WillRepeatedly(Return(&info_cng)); - const DecoderDatabase::DecoderInfo info_speech(NetEqDecoder::kDecoderPCM16Bwb, - absl::nullopt, factory); + const DecoderDatabase::DecoderInfo info_speech( + SdpAudioFormat("l16", 16000, 1), absl::nullopt, factory); EXPECT_CALL(decoder_database, GetDecoderInfo(kSpeechPt)) .WillRepeatedly(Return(&info_speech)); @@ -549,7 +549,7 @@ TEST(PacketBuffer, Failures) { list.push_back(gen.NextPacket(payload_len)); // Valid packet. MockDecoderDatabase decoder_database; auto factory = CreateBuiltinAudioDecoderFactory(); - const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu, + const DecoderDatabase::DecoderInfo info(SdpAudioFormat("pcmu", 8000, 1), absl::nullopt, factory); EXPECT_CALL(decoder_database, GetDecoderInfo(0)) .WillRepeatedly(Return(&info)); diff --git a/modules/audio_coding/neteq/timestamp_scaler_unittest.cc b/modules/audio_coding/neteq/timestamp_scaler_unittest.cc index 1f1445af05..5b14189d62 100644 --- a/modules/audio_coding/neteq/timestamp_scaler_unittest.cc +++ b/modules/audio_coding/neteq/timestamp_scaler_unittest.cc @@ -25,7 +25,7 @@ TEST(TimestampScaler, TestNoScaling) { MockDecoderDatabase db; auto factory = CreateBuiltinAudioDecoderFactory(); // Use PCMu, because it doesn't use scaled timestamps. - const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu, + const DecoderDatabase::DecoderInfo info(SdpAudioFormat("pcmu", 8000, 1), absl::nullopt, factory); static const uint8_t kRtpPayloadType = 0; EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType)) @@ -47,7 +47,7 @@ TEST(TimestampScaler, TestNoScalingLargeStep) { MockDecoderDatabase db; auto factory = CreateBuiltinAudioDecoderFactory(); // Use PCMu, because it doesn't use scaled timestamps. - const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu, + const DecoderDatabase::DecoderInfo info(SdpAudioFormat("pcmu", 8000, 1), absl::nullopt, factory); static const uint8_t kRtpPayloadType = 0; EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType)) @@ -74,7 +74,7 @@ TEST(TimestampScaler, TestG722) { MockDecoderDatabase db; auto factory = CreateBuiltinAudioDecoderFactory(); // Use G722, which has a factor 2 scaling. - const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, + const DecoderDatabase::DecoderInfo info(SdpAudioFormat("g722", 8000, 1), absl::nullopt, factory); static const uint8_t kRtpPayloadType = 17; EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType)) @@ -100,7 +100,7 @@ TEST(TimestampScaler, TestG722LargeStep) { MockDecoderDatabase db; auto factory = CreateBuiltinAudioDecoderFactory(); // Use G722, which has a factor 2 scaling. - const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, + const DecoderDatabase::DecoderInfo info(SdpAudioFormat("g722", 8000, 1), absl::nullopt, factory); static const uint8_t kRtpPayloadType = 17; EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType)) @@ -130,9 +130,9 @@ TEST(TimestampScaler, TestG722WithCng) { MockDecoderDatabase db; auto factory = CreateBuiltinAudioDecoderFactory(); // Use G722, which has a factor 2 scaling. - const DecoderDatabase::DecoderInfo info_g722(NetEqDecoder::kDecoderG722, + const DecoderDatabase::DecoderInfo info_g722(SdpAudioFormat("g722", 8000, 1), absl::nullopt, factory); - const DecoderDatabase::DecoderInfo info_cng(NetEqDecoder::kDecoderCNGwb, + const DecoderDatabase::DecoderInfo info_cng(SdpAudioFormat("cn", 16000, 1), absl::nullopt, factory); static const uint8_t kRtpPayloadTypeG722 = 17; static const uint8_t kRtpPayloadTypeCng = 13; @@ -174,7 +174,7 @@ TEST(TimestampScaler, TestG722Packet) { MockDecoderDatabase db; auto factory = CreateBuiltinAudioDecoderFactory(); // Use G722, which has a factor 2 scaling. - const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, + const DecoderDatabase::DecoderInfo info(SdpAudioFormat("g722", 8000, 1), absl::nullopt, factory); static const uint8_t kRtpPayloadType = 17; EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType)) @@ -204,7 +204,7 @@ TEST(TimestampScaler, TestG722PacketList) { MockDecoderDatabase db; auto factory = CreateBuiltinAudioDecoderFactory(); // Use G722, which has a factor 2 scaling. - const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, + const DecoderDatabase::DecoderInfo info(SdpAudioFormat("g722", 8000, 1), absl::nullopt, factory); static const uint8_t kRtpPayloadType = 17; EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType)) @@ -238,7 +238,7 @@ TEST(TimestampScaler, TestG722Reset) { MockDecoderDatabase db; auto factory = CreateBuiltinAudioDecoderFactory(); // Use G722, which has a factor 2 scaling. - const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, + const DecoderDatabase::DecoderInfo info(SdpAudioFormat("g722", 8000, 1), absl::nullopt, factory); static const uint8_t kRtpPayloadType = 17; EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType)) @@ -279,7 +279,7 @@ TEST(TimestampScaler, TestG722Reset) { TEST(TimestampScaler, TestOpusLargeStep) { MockDecoderDatabase db; auto factory = CreateBuiltinAudioDecoderFactory(); - const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderOpus, + const DecoderDatabase::DecoderInfo info(SdpAudioFormat("opus", 48000, 2), absl::nullopt, factory); static const uint8_t kRtpPayloadType = 17; EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType)) diff --git a/modules/audio_coding/neteq/tools/neteq_test_factory.cc b/modules/audio_coding/neteq/tools/neteq_test_factory.cc index 589f47b3df..76ff56c333 100644 --- a/modules/audio_coding/neteq/tools/neteq_test_factory.cc +++ b/modules/audio_coding/neteq/tools/neteq_test_factory.cc @@ -154,82 +154,31 @@ WEBRTC_DEFINE_bool(enable_fast_accelerate, false, "Enables jitter buffer fast accelerate"); -// Maps a codec type to a printable name string. -std::string CodecName(NetEqDecoder codec) { - switch (codec) { - case NetEqDecoder::kDecoderPCMu: - return "PCM-u"; - case NetEqDecoder::kDecoderPCMa: - return "PCM-a"; - case NetEqDecoder::kDecoderILBC: - return "iLBC"; - case NetEqDecoder::kDecoderISAC: - return "iSAC"; - case NetEqDecoder::kDecoderISACswb: - return "iSAC-swb (32 kHz)"; - case NetEqDecoder::kDecoderOpus: - return "Opus"; - case NetEqDecoder::kDecoderPCM16B: - return "PCM16b-nb (8 kHz)"; - case NetEqDecoder::kDecoderPCM16Bwb: - return "PCM16b-wb (16 kHz)"; - case NetEqDecoder::kDecoderPCM16Bswb32kHz: - return "PCM16b-swb32 (32 kHz)"; - case NetEqDecoder::kDecoderPCM16Bswb48kHz: - return "PCM16b-swb48 (48 kHz)"; - case NetEqDecoder::kDecoderG722: - return "G.722"; - case NetEqDecoder::kDecoderRED: - return "redundant audio (RED)"; - case NetEqDecoder::kDecoderAVT: - return "AVT/DTMF (8 kHz)"; - case NetEqDecoder::kDecoderAVT16kHz: - return "AVT/DTMF (16 kHz)"; - case NetEqDecoder::kDecoderAVT32kHz: - return "AVT/DTMF (32 kHz)"; - case NetEqDecoder::kDecoderAVT48kHz: - return "AVT/DTMF (48 kHz)"; - case NetEqDecoder::kDecoderCNGnb: - return "comfort noise (8 kHz)"; - case NetEqDecoder::kDecoderCNGwb: - return "comfort noise (16 kHz)"; - case NetEqDecoder::kDecoderCNGswb32kHz: - return "comfort noise (32 kHz)"; - case NetEqDecoder::kDecoderCNGswb48kHz: - return "comfort noise (48 kHz)"; - default: - FATAL(); - return "undefined"; - } -} - -void PrintCodecMappingEntry(NetEqDecoder codec, int flag) { - std::cout << CodecName(codec) << ": " << flag << std::endl; +void PrintCodecMappingEntry(const char* codec, int flag) { + std::cout << codec << ": " << flag << std::endl; } void PrintCodecMapping() { - 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, - FLAG_pcm16b_swb32); - PrintCodecMappingEntry(NetEqDecoder::kDecoderPCM16Bswb48kHz, - 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); + PrintCodecMappingEntry("PCM-u", FLAG_pcmu); + PrintCodecMappingEntry("PCM-a", FLAG_pcma); + PrintCodecMappingEntry("iLBC", FLAG_ilbc); + PrintCodecMappingEntry("iSAC", FLAG_isac); + PrintCodecMappingEntry("iSAC-swb (32 kHz)", FLAG_isac_swb); + PrintCodecMappingEntry("Opus", FLAG_opus); + PrintCodecMappingEntry("PCM16b-nb (8 kHz)", FLAG_pcm16b); + PrintCodecMappingEntry("PCM16b-wb (16 kHz)", FLAG_pcm16b_wb); + PrintCodecMappingEntry("PCM16b-swb32 (32 kHz)", FLAG_pcm16b_swb32); + PrintCodecMappingEntry("PCM16b-swb48 (48 kHz)", FLAG_pcm16b_swb48); + PrintCodecMappingEntry("G.722", FLAG_g722); + PrintCodecMappingEntry("AVT/DTMF (8 kHz)", FLAG_avt); + PrintCodecMappingEntry("AVT/DTMF (16 kHz)", FLAG_avt_16); + PrintCodecMappingEntry("AVT/DTMF (32 kHz)", FLAG_avt_32); + PrintCodecMappingEntry("AVT/DTMF (48 kHz)", FLAG_avt_48); + PrintCodecMappingEntry("redundant audio (RED)", FLAG_red); + PrintCodecMappingEntry("comfort noise (8 kHz)", FLAG_cn_nb); + PrintCodecMappingEntry("comfort noise (16 kHz)", FLAG_cn_wb); + PrintCodecMappingEntry("comfort noise (32 kHz)", FLAG_cn_swb32); + PrintCodecMappingEntry("comfort noise (48 kHz)", FLAG_cn_swb48); } absl::optional CodecSampleRate(uint8_t payload_type) {