Delete enum NetEqDecoder.
A trimmed down version is moved to legacy_encoded_audio_frame_unittest.cc where it's used for test parameterization. Bug: webrtc:10185 Change-Id: I9abda22f9806b831b6ca4b27d6bcc888285f50f2 Reviewed-on: https://webrtc-review.googlesource.com/c/116961 Reviewed-by: Ivo Creusen <ivoc@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#26218}
This commit is contained in:
@ -42,7 +42,6 @@ rtc_static_library("audio_coding") {
|
|||||||
deps = [
|
deps = [
|
||||||
":audio_coding_module_typedefs",
|
":audio_coding_module_typedefs",
|
||||||
":neteq",
|
":neteq",
|
||||||
":neteq_decoder_enum",
|
|
||||||
"..:module_api",
|
"..:module_api",
|
||||||
"..:module_api_public",
|
"..:module_api_public",
|
||||||
"../..:webrtc_common",
|
"../..: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") {
|
rtc_static_library("neteq") {
|
||||||
visibility += webrtc_default_visibility
|
visibility += webrtc_default_visibility
|
||||||
sources = [
|
sources = [
|
||||||
@ -991,7 +978,6 @@ rtc_static_library("neteq") {
|
|||||||
|
|
||||||
deps = [
|
deps = [
|
||||||
":audio_coding_module_typedefs",
|
":audio_coding_module_typedefs",
|
||||||
":neteq_decoder_enum",
|
|
||||||
":webrtc_cng",
|
":webrtc_cng",
|
||||||
"..:module_api",
|
"..:module_api",
|
||||||
"..:module_api_public",
|
"..:module_api_public",
|
||||||
@ -2028,7 +2014,6 @@ if (rtc_include_tests) {
|
|||||||
":legacy_encoded_audio_frame",
|
":legacy_encoded_audio_frame",
|
||||||
":mocks",
|
":mocks",
|
||||||
":neteq",
|
":neteq",
|
||||||
":neteq_decoder_enum",
|
|
||||||
":neteq_test_support",
|
":neteq_test_support",
|
||||||
":neteq_test_tools",
|
":neteq_test_tools",
|
||||||
":pcm16b",
|
":pcm16b",
|
||||||
|
|||||||
@ -21,7 +21,6 @@
|
|||||||
#include "modules/audio_coding/acm2/acm_resampler.h"
|
#include "modules/audio_coding/acm2/acm_resampler.h"
|
||||||
#include "modules/audio_coding/acm2/call_statistics.h"
|
#include "modules/audio_coding/acm2/call_statistics.h"
|
||||||
#include "modules/audio_coding/neteq/include/neteq.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 "modules/include/module_common_types.h"
|
||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
#include "rtc_base/logging.h"
|
#include "rtc_base/logging.h"
|
||||||
|
|||||||
@ -10,12 +10,28 @@
|
|||||||
|
|
||||||
#include "modules/audio_coding/codecs/legacy_encoded_audio_frame.h"
|
#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 "rtc_base/numerics/safe_conversions.h"
|
||||||
#include "test/gtest.h"
|
#include "test/gtest.h"
|
||||||
|
|
||||||
namespace webrtc {
|
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<NetEqDecoder> {
|
class SplitBySamplesTest : public ::testing::TestWithParam<NetEqDecoder> {
|
||||||
protected:
|
protected:
|
||||||
virtual void SetUp() {
|
virtual void SetUp() {
|
||||||
|
|||||||
@ -52,12 +52,6 @@ DecoderDatabase::DecoderInfo::DecoderInfo(
|
|||||||
AudioDecoderFactory* factory)
|
AudioDecoderFactory* factory)
|
||||||
: DecoderInfo(audio_format, codec_pair_id, factory, audio_format.name) {}
|
: DecoderInfo(audio_format, codec_pair_id, factory, audio_format.name) {}
|
||||||
|
|
||||||
DecoderDatabase::DecoderInfo::DecoderInfo(
|
|
||||||
NetEqDecoder ct,
|
|
||||||
absl::optional<AudioCodecPairId> codec_pair_id,
|
|
||||||
AudioDecoderFactory* factory)
|
|
||||||
: DecoderInfo(*NetEqDecoderToSdpAudioFormat(ct), codec_pair_id, factory) {}
|
|
||||||
|
|
||||||
DecoderDatabase::DecoderInfo::DecoderInfo(DecoderInfo&&) = default;
|
DecoderDatabase::DecoderInfo::DecoderInfo(DecoderInfo&&) = default;
|
||||||
DecoderDatabase::DecoderInfo::~DecoderInfo() = default;
|
DecoderDatabase::DecoderInfo::~DecoderInfo() = default;
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,6 @@
|
|||||||
#include "api/audio_codecs/audio_decoder_factory.h"
|
#include "api/audio_codecs/audio_decoder_factory.h"
|
||||||
#include "api/audio_codecs/audio_format.h"
|
#include "api/audio_codecs/audio_format.h"
|
||||||
#include "modules/audio_coding/codecs/cng/webrtc_cng.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 "modules/audio_coding/neteq/packet.h"
|
||||||
#include "rtc_base/constructormagic.h"
|
#include "rtc_base/constructormagic.h"
|
||||||
#include "rtc_base/scoped_ref_ptr.h"
|
#include "rtc_base/scoped_ref_ptr.h"
|
||||||
@ -47,9 +46,6 @@ class DecoderDatabase {
|
|||||||
explicit DecoderInfo(const SdpAudioFormat& audio_format,
|
explicit DecoderInfo(const SdpAudioFormat& audio_format,
|
||||||
absl::optional<AudioCodecPairId> codec_pair_id,
|
absl::optional<AudioCodecPairId> codec_pair_id,
|
||||||
AudioDecoderFactory* factory = nullptr);
|
AudioDecoderFactory* factory = nullptr);
|
||||||
explicit DecoderInfo(NetEqDecoder ct,
|
|
||||||
absl::optional<AudioCodecPairId> codec_pair_id,
|
|
||||||
AudioDecoderFactory* factory = nullptr);
|
|
||||||
DecoderInfo(DecoderInfo&&);
|
DecoderInfo(DecoderInfo&&);
|
||||||
~DecoderInfo();
|
~DecoderInfo();
|
||||||
|
|
||||||
|
|||||||
@ -13,15 +13,16 @@
|
|||||||
|
|
||||||
#include <string.h> // Provide access to size_t.
|
#include <string.h> // Provide access to size_t.
|
||||||
|
|
||||||
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "absl/types/optional.h"
|
#include "absl/types/optional.h"
|
||||||
#include "api/audio_codecs/audio_codec_pair_id.h"
|
#include "api/audio_codecs/audio_codec_pair_id.h"
|
||||||
#include "api/audio_codecs/audio_decoder.h"
|
#include "api/audio_codecs/audio_decoder.h"
|
||||||
|
#include "api/audio_codecs/audio_format.h"
|
||||||
#include "api/rtp_headers.h"
|
#include "api/rtp_headers.h"
|
||||||
#include "modules/audio_coding/neteq/defines.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/constructormagic.h"
|
||||||
#include "rtc_base/scoped_ref_ptr.h"
|
#include "rtc_base/scoped_ref_ptr.h"
|
||||||
|
|
||||||
|
|||||||
@ -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 <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "modules/audio_coding/neteq/neteq_decoder_enum.h"
|
|
||||||
|
|
||||||
namespace webrtc {
|
|
||||||
|
|
||||||
absl::optional<SdpAudioFormat> 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<std::string, std::string>{{"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
|
|
||||||
@ -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<SdpAudioFormat> NetEqDecoderToSdpAudioFormat(NetEqDecoder nd);
|
|
||||||
|
|
||||||
} // namespace webrtc
|
|
||||||
|
|
||||||
#endif // MODULES_AUDIO_CODING_NETEQ_NETEQ_DECODER_ENUM_H_
|
|
||||||
@ -331,8 +331,8 @@ TEST_F(NetEqImplTest, InsertPacket) {
|
|||||||
|
|
||||||
*dec = std::move(mock_decoder);
|
*dec = std::move(mock_decoder);
|
||||||
}));
|
}));
|
||||||
DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu, absl::nullopt,
|
DecoderDatabase::DecoderInfo info(SdpAudioFormat("pcmu", 8000, 1),
|
||||||
mock_decoder_factory);
|
absl::nullopt, mock_decoder_factory);
|
||||||
|
|
||||||
// Expectations for decoder database.
|
// Expectations for decoder database.
|
||||||
EXPECT_CALL(*mock_decoder_database_, GetDecoderInfo(kPayloadType))
|
EXPECT_CALL(*mock_decoder_database_, GetDecoderInfo(kPayloadType))
|
||||||
|
|||||||
@ -258,7 +258,6 @@ class NetEqDecodingTest : public ::testing::Test {
|
|||||||
NetEqDecodingTest();
|
NetEqDecodingTest();
|
||||||
virtual void SetUp();
|
virtual void SetUp();
|
||||||
virtual void TearDown();
|
virtual void TearDown();
|
||||||
void SelectDecoders(NetEqDecoder* used_codec);
|
|
||||||
void OpenInputFile(const std::string& rtp_file);
|
void OpenInputFile(const std::string& rtp_file);
|
||||||
void Process();
|
void Process();
|
||||||
|
|
||||||
|
|||||||
@ -175,7 +175,7 @@ TEST(PacketBuffer, InsertPacketList) {
|
|||||||
|
|
||||||
MockDecoderDatabase decoder_database;
|
MockDecoderDatabase decoder_database;
|
||||||
auto factory = CreateBuiltinAudioDecoderFactory();
|
auto factory = CreateBuiltinAudioDecoderFactory();
|
||||||
const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu,
|
const DecoderDatabase::DecoderInfo info(SdpAudioFormat("pcmu", 8000, 1),
|
||||||
absl::nullopt, factory);
|
absl::nullopt, factory);
|
||||||
EXPECT_CALL(decoder_database, GetDecoderInfo(0))
|
EXPECT_CALL(decoder_database, GetDecoderInfo(0))
|
||||||
.WillRepeatedly(Return(&info));
|
.WillRepeatedly(Return(&info));
|
||||||
@ -220,11 +220,11 @@ TEST(PacketBuffer, InsertPacketListChangePayloadType) {
|
|||||||
|
|
||||||
MockDecoderDatabase decoder_database;
|
MockDecoderDatabase decoder_database;
|
||||||
auto factory = CreateBuiltinAudioDecoderFactory();
|
auto factory = CreateBuiltinAudioDecoderFactory();
|
||||||
const DecoderDatabase::DecoderInfo info0(NetEqDecoder::kDecoderPCMu,
|
const DecoderDatabase::DecoderInfo info0(SdpAudioFormat("pcmu", 8000, 1),
|
||||||
absl::nullopt, factory);
|
absl::nullopt, factory);
|
||||||
EXPECT_CALL(decoder_database, GetDecoderInfo(0))
|
EXPECT_CALL(decoder_database, GetDecoderInfo(0))
|
||||||
.WillRepeatedly(Return(&info0));
|
.WillRepeatedly(Return(&info0));
|
||||||
const DecoderDatabase::DecoderInfo info1(NetEqDecoder::kDecoderPCMa,
|
const DecoderDatabase::DecoderInfo info1(SdpAudioFormat("pcma", 8000, 1),
|
||||||
absl::nullopt, factory);
|
absl::nullopt, factory);
|
||||||
EXPECT_CALL(decoder_database, GetDecoderInfo(1))
|
EXPECT_CALL(decoder_database, GetDecoderInfo(1))
|
||||||
.WillRepeatedly(Return(&info1));
|
.WillRepeatedly(Return(&info1));
|
||||||
@ -407,7 +407,7 @@ TEST(PacketBuffer, Reordering) {
|
|||||||
|
|
||||||
MockDecoderDatabase decoder_database;
|
MockDecoderDatabase decoder_database;
|
||||||
auto factory = CreateBuiltinAudioDecoderFactory();
|
auto factory = CreateBuiltinAudioDecoderFactory();
|
||||||
const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu,
|
const DecoderDatabase::DecoderInfo info(SdpAudioFormat("pcmu", 8000, 1),
|
||||||
absl::nullopt, factory);
|
absl::nullopt, factory);
|
||||||
EXPECT_CALL(decoder_database, GetDecoderInfo(0))
|
EXPECT_CALL(decoder_database, GetDecoderInfo(0))
|
||||||
.WillRepeatedly(Return(&info));
|
.WillRepeatedly(Return(&info));
|
||||||
@ -447,12 +447,12 @@ TEST(PacketBuffer, CngFirstThenSpeechWithNewSampleRate) {
|
|||||||
|
|
||||||
MockDecoderDatabase decoder_database;
|
MockDecoderDatabase decoder_database;
|
||||||
auto factory = CreateBuiltinAudioDecoderFactory();
|
auto factory = CreateBuiltinAudioDecoderFactory();
|
||||||
const DecoderDatabase::DecoderInfo info_cng(NetEqDecoder::kDecoderCNGnb,
|
const DecoderDatabase::DecoderInfo info_cng(SdpAudioFormat("cn", 8000, 1),
|
||||||
absl::nullopt, factory);
|
absl::nullopt, factory);
|
||||||
EXPECT_CALL(decoder_database, GetDecoderInfo(kCngPt))
|
EXPECT_CALL(decoder_database, GetDecoderInfo(kCngPt))
|
||||||
.WillRepeatedly(Return(&info_cng));
|
.WillRepeatedly(Return(&info_cng));
|
||||||
const DecoderDatabase::DecoderInfo info_speech(NetEqDecoder::kDecoderPCM16Bwb,
|
const DecoderDatabase::DecoderInfo info_speech(
|
||||||
absl::nullopt, factory);
|
SdpAudioFormat("l16", 16000, 1), absl::nullopt, factory);
|
||||||
EXPECT_CALL(decoder_database, GetDecoderInfo(kSpeechPt))
|
EXPECT_CALL(decoder_database, GetDecoderInfo(kSpeechPt))
|
||||||
.WillRepeatedly(Return(&info_speech));
|
.WillRepeatedly(Return(&info_speech));
|
||||||
|
|
||||||
@ -549,7 +549,7 @@ TEST(PacketBuffer, Failures) {
|
|||||||
list.push_back(gen.NextPacket(payload_len)); // Valid packet.
|
list.push_back(gen.NextPacket(payload_len)); // Valid packet.
|
||||||
MockDecoderDatabase decoder_database;
|
MockDecoderDatabase decoder_database;
|
||||||
auto factory = CreateBuiltinAudioDecoderFactory();
|
auto factory = CreateBuiltinAudioDecoderFactory();
|
||||||
const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu,
|
const DecoderDatabase::DecoderInfo info(SdpAudioFormat("pcmu", 8000, 1),
|
||||||
absl::nullopt, factory);
|
absl::nullopt, factory);
|
||||||
EXPECT_CALL(decoder_database, GetDecoderInfo(0))
|
EXPECT_CALL(decoder_database, GetDecoderInfo(0))
|
||||||
.WillRepeatedly(Return(&info));
|
.WillRepeatedly(Return(&info));
|
||||||
|
|||||||
@ -25,7 +25,7 @@ TEST(TimestampScaler, TestNoScaling) {
|
|||||||
MockDecoderDatabase db;
|
MockDecoderDatabase db;
|
||||||
auto factory = CreateBuiltinAudioDecoderFactory();
|
auto factory = CreateBuiltinAudioDecoderFactory();
|
||||||
// Use PCMu, because it doesn't use scaled timestamps.
|
// 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);
|
absl::nullopt, factory);
|
||||||
static const uint8_t kRtpPayloadType = 0;
|
static const uint8_t kRtpPayloadType = 0;
|
||||||
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
|
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
|
||||||
@ -47,7 +47,7 @@ TEST(TimestampScaler, TestNoScalingLargeStep) {
|
|||||||
MockDecoderDatabase db;
|
MockDecoderDatabase db;
|
||||||
auto factory = CreateBuiltinAudioDecoderFactory();
|
auto factory = CreateBuiltinAudioDecoderFactory();
|
||||||
// Use PCMu, because it doesn't use scaled timestamps.
|
// 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);
|
absl::nullopt, factory);
|
||||||
static const uint8_t kRtpPayloadType = 0;
|
static const uint8_t kRtpPayloadType = 0;
|
||||||
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
|
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
|
||||||
@ -74,7 +74,7 @@ TEST(TimestampScaler, TestG722) {
|
|||||||
MockDecoderDatabase db;
|
MockDecoderDatabase db;
|
||||||
auto factory = CreateBuiltinAudioDecoderFactory();
|
auto factory = CreateBuiltinAudioDecoderFactory();
|
||||||
// Use G722, which has a factor 2 scaling.
|
// 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);
|
absl::nullopt, factory);
|
||||||
static const uint8_t kRtpPayloadType = 17;
|
static const uint8_t kRtpPayloadType = 17;
|
||||||
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
|
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
|
||||||
@ -100,7 +100,7 @@ TEST(TimestampScaler, TestG722LargeStep) {
|
|||||||
MockDecoderDatabase db;
|
MockDecoderDatabase db;
|
||||||
auto factory = CreateBuiltinAudioDecoderFactory();
|
auto factory = CreateBuiltinAudioDecoderFactory();
|
||||||
// Use G722, which has a factor 2 scaling.
|
// 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);
|
absl::nullopt, factory);
|
||||||
static const uint8_t kRtpPayloadType = 17;
|
static const uint8_t kRtpPayloadType = 17;
|
||||||
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
|
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
|
||||||
@ -130,9 +130,9 @@ TEST(TimestampScaler, TestG722WithCng) {
|
|||||||
MockDecoderDatabase db;
|
MockDecoderDatabase db;
|
||||||
auto factory = CreateBuiltinAudioDecoderFactory();
|
auto factory = CreateBuiltinAudioDecoderFactory();
|
||||||
// Use G722, which has a factor 2 scaling.
|
// 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);
|
absl::nullopt, factory);
|
||||||
const DecoderDatabase::DecoderInfo info_cng(NetEqDecoder::kDecoderCNGwb,
|
const DecoderDatabase::DecoderInfo info_cng(SdpAudioFormat("cn", 16000, 1),
|
||||||
absl::nullopt, factory);
|
absl::nullopt, factory);
|
||||||
static const uint8_t kRtpPayloadTypeG722 = 17;
|
static const uint8_t kRtpPayloadTypeG722 = 17;
|
||||||
static const uint8_t kRtpPayloadTypeCng = 13;
|
static const uint8_t kRtpPayloadTypeCng = 13;
|
||||||
@ -174,7 +174,7 @@ TEST(TimestampScaler, TestG722Packet) {
|
|||||||
MockDecoderDatabase db;
|
MockDecoderDatabase db;
|
||||||
auto factory = CreateBuiltinAudioDecoderFactory();
|
auto factory = CreateBuiltinAudioDecoderFactory();
|
||||||
// Use G722, which has a factor 2 scaling.
|
// 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);
|
absl::nullopt, factory);
|
||||||
static const uint8_t kRtpPayloadType = 17;
|
static const uint8_t kRtpPayloadType = 17;
|
||||||
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
|
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
|
||||||
@ -204,7 +204,7 @@ TEST(TimestampScaler, TestG722PacketList) {
|
|||||||
MockDecoderDatabase db;
|
MockDecoderDatabase db;
|
||||||
auto factory = CreateBuiltinAudioDecoderFactory();
|
auto factory = CreateBuiltinAudioDecoderFactory();
|
||||||
// Use G722, which has a factor 2 scaling.
|
// 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);
|
absl::nullopt, factory);
|
||||||
static const uint8_t kRtpPayloadType = 17;
|
static const uint8_t kRtpPayloadType = 17;
|
||||||
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
|
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
|
||||||
@ -238,7 +238,7 @@ TEST(TimestampScaler, TestG722Reset) {
|
|||||||
MockDecoderDatabase db;
|
MockDecoderDatabase db;
|
||||||
auto factory = CreateBuiltinAudioDecoderFactory();
|
auto factory = CreateBuiltinAudioDecoderFactory();
|
||||||
// Use G722, which has a factor 2 scaling.
|
// 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);
|
absl::nullopt, factory);
|
||||||
static const uint8_t kRtpPayloadType = 17;
|
static const uint8_t kRtpPayloadType = 17;
|
||||||
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
|
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
|
||||||
@ -279,7 +279,7 @@ TEST(TimestampScaler, TestG722Reset) {
|
|||||||
TEST(TimestampScaler, TestOpusLargeStep) {
|
TEST(TimestampScaler, TestOpusLargeStep) {
|
||||||
MockDecoderDatabase db;
|
MockDecoderDatabase db;
|
||||||
auto factory = CreateBuiltinAudioDecoderFactory();
|
auto factory = CreateBuiltinAudioDecoderFactory();
|
||||||
const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderOpus,
|
const DecoderDatabase::DecoderInfo info(SdpAudioFormat("opus", 48000, 2),
|
||||||
absl::nullopt, factory);
|
absl::nullopt, factory);
|
||||||
static const uint8_t kRtpPayloadType = 17;
|
static const uint8_t kRtpPayloadType = 17;
|
||||||
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
|
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
|
||||||
|
|||||||
@ -154,82 +154,31 @@ WEBRTC_DEFINE_bool(enable_fast_accelerate,
|
|||||||
false,
|
false,
|
||||||
"Enables jitter buffer fast accelerate");
|
"Enables jitter buffer fast accelerate");
|
||||||
|
|
||||||
// Maps a codec type to a printable name string.
|
void PrintCodecMappingEntry(const char* codec, int flag) {
|
||||||
std::string CodecName(NetEqDecoder codec) {
|
std::cout << codec << ": " << flag << std::endl;
|
||||||
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 PrintCodecMapping() {
|
void PrintCodecMapping() {
|
||||||
PrintCodecMappingEntry(NetEqDecoder::kDecoderPCMu, FLAG_pcmu);
|
PrintCodecMappingEntry("PCM-u", FLAG_pcmu);
|
||||||
PrintCodecMappingEntry(NetEqDecoder::kDecoderPCMa, FLAG_pcma);
|
PrintCodecMappingEntry("PCM-a", FLAG_pcma);
|
||||||
PrintCodecMappingEntry(NetEqDecoder::kDecoderILBC, FLAG_ilbc);
|
PrintCodecMappingEntry("iLBC", FLAG_ilbc);
|
||||||
PrintCodecMappingEntry(NetEqDecoder::kDecoderISAC, FLAG_isac);
|
PrintCodecMappingEntry("iSAC", FLAG_isac);
|
||||||
PrintCodecMappingEntry(NetEqDecoder::kDecoderISACswb, FLAG_isac_swb);
|
PrintCodecMappingEntry("iSAC-swb (32 kHz)", FLAG_isac_swb);
|
||||||
PrintCodecMappingEntry(NetEqDecoder::kDecoderOpus, FLAG_opus);
|
PrintCodecMappingEntry("Opus", FLAG_opus);
|
||||||
PrintCodecMappingEntry(NetEqDecoder::kDecoderPCM16B, FLAG_pcm16b);
|
PrintCodecMappingEntry("PCM16b-nb (8 kHz)", FLAG_pcm16b);
|
||||||
PrintCodecMappingEntry(NetEqDecoder::kDecoderPCM16Bwb, FLAG_pcm16b_wb);
|
PrintCodecMappingEntry("PCM16b-wb (16 kHz)", FLAG_pcm16b_wb);
|
||||||
PrintCodecMappingEntry(NetEqDecoder::kDecoderPCM16Bswb32kHz,
|
PrintCodecMappingEntry("PCM16b-swb32 (32 kHz)", FLAG_pcm16b_swb32);
|
||||||
FLAG_pcm16b_swb32);
|
PrintCodecMappingEntry("PCM16b-swb48 (48 kHz)", FLAG_pcm16b_swb48);
|
||||||
PrintCodecMappingEntry(NetEqDecoder::kDecoderPCM16Bswb48kHz,
|
PrintCodecMappingEntry("G.722", FLAG_g722);
|
||||||
FLAG_pcm16b_swb48);
|
PrintCodecMappingEntry("AVT/DTMF (8 kHz)", FLAG_avt);
|
||||||
PrintCodecMappingEntry(NetEqDecoder::kDecoderG722, FLAG_g722);
|
PrintCodecMappingEntry("AVT/DTMF (16 kHz)", FLAG_avt_16);
|
||||||
PrintCodecMappingEntry(NetEqDecoder::kDecoderAVT, FLAG_avt);
|
PrintCodecMappingEntry("AVT/DTMF (32 kHz)", FLAG_avt_32);
|
||||||
PrintCodecMappingEntry(NetEqDecoder::kDecoderAVT16kHz, FLAG_avt_16);
|
PrintCodecMappingEntry("AVT/DTMF (48 kHz)", FLAG_avt_48);
|
||||||
PrintCodecMappingEntry(NetEqDecoder::kDecoderAVT32kHz, FLAG_avt_32);
|
PrintCodecMappingEntry("redundant audio (RED)", FLAG_red);
|
||||||
PrintCodecMappingEntry(NetEqDecoder::kDecoderAVT48kHz, FLAG_avt_48);
|
PrintCodecMappingEntry("comfort noise (8 kHz)", FLAG_cn_nb);
|
||||||
PrintCodecMappingEntry(NetEqDecoder::kDecoderRED, FLAG_red);
|
PrintCodecMappingEntry("comfort noise (16 kHz)", FLAG_cn_wb);
|
||||||
PrintCodecMappingEntry(NetEqDecoder::kDecoderCNGnb, FLAG_cn_nb);
|
PrintCodecMappingEntry("comfort noise (32 kHz)", FLAG_cn_swb32);
|
||||||
PrintCodecMappingEntry(NetEqDecoder::kDecoderCNGwb, FLAG_cn_wb);
|
PrintCodecMappingEntry("comfort noise (48 kHz)", FLAG_cn_swb48);
|
||||||
PrintCodecMappingEntry(NetEqDecoder::kDecoderCNGswb32kHz, FLAG_cn_swb32);
|
|
||||||
PrintCodecMappingEntry(NetEqDecoder::kDecoderCNGswb48kHz, FLAG_cn_swb48);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
absl::optional<int> CodecSampleRate(uint8_t payload_type) {
|
absl::optional<int> CodecSampleRate(uint8_t payload_type) {
|
||||||
|
|||||||
Reference in New Issue
Block a user