2013-01-29 12:09:21 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2012 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.
|
|
|
|
|
*/
|
|
|
|
|
|
2014-06-09 08:10:28 +00:00
|
|
|
#include "webrtc/modules/audio_coding/neteq/audio_decoder_impl.h"
|
2013-01-29 12:09:21 +00:00
|
|
|
|
|
|
|
|
#include <assert.h>
|
2013-02-01 11:49:28 +00:00
|
|
|
|
2014-11-04 11:51:46 +00:00
|
|
|
#include "webrtc/base/checks.h"
|
2013-01-29 12:09:21 +00:00
|
|
|
#include "webrtc/modules/audio_coding/codecs/cng/include/webrtc_cng.h"
|
|
|
|
|
#include "webrtc/modules/audio_coding/codecs/g711/include/g711_interface.h"
|
|
|
|
|
#ifdef WEBRTC_CODEC_G722
|
2015-09-17 03:12:35 -07:00
|
|
|
#include "webrtc/modules/audio_coding/codecs/g722/include/audio_decoder_g722.h"
|
2013-01-29 12:09:21 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef WEBRTC_CODEC_ILBC
|
2015-09-16 21:26:32 -07:00
|
|
|
#include "webrtc/modules/audio_coding/codecs/ilbc/interface/audio_decoder_ilbc.h"
|
2013-01-29 12:09:21 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef WEBRTC_CODEC_ISACFX
|
2014-12-16 12:49:37 +00:00
|
|
|
#include "webrtc/modules/audio_coding/codecs/isac/fix/interface/audio_encoder_isacfix.h"
|
2013-01-29 12:09:21 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef WEBRTC_CODEC_ISAC
|
2014-12-11 10:08:19 +00:00
|
|
|
#include "webrtc/modules/audio_coding/codecs/isac/main/interface/audio_encoder_isac.h"
|
2013-01-29 12:09:21 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef WEBRTC_CODEC_OPUS
|
2015-09-15 17:28:18 +02:00
|
|
|
#include "webrtc/modules/audio_coding/codecs/opus/interface/audio_decoder_opus.h"
|
2013-01-29 12:09:21 +00:00
|
|
|
#endif
|
2015-09-17 07:47:34 +02:00
|
|
|
#include "webrtc/modules/audio_coding/codecs/pcm16b/include/audio_decoder_pcm16b.h"
|
2013-01-29 12:09:21 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
|
|
|
|
// PCMu
|
2015-04-07 16:12:57 +02:00
|
|
|
|
2015-08-27 15:22:11 +02:00
|
|
|
void AudioDecoderPcmU::Reset() {
|
2015-04-07 16:12:57 +02:00
|
|
|
}
|
|
|
|
|
size_t AudioDecoderPcmU::Channels() const {
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2015-03-16 12:30:37 +00:00
|
|
|
int AudioDecoderPcmU::DecodeInternal(const uint8_t* encoded,
|
|
|
|
|
size_t encoded_len,
|
|
|
|
|
int sample_rate_hz,
|
|
|
|
|
int16_t* decoded,
|
|
|
|
|
SpeechType* speech_type) {
|
2015-09-17 00:24:34 -07:00
|
|
|
RTC_DCHECK_EQ(sample_rate_hz, 8000);
|
2013-01-30 09:41:56 +00:00
|
|
|
int16_t temp_type = 1; // Default is speech.
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
size_t ret = WebRtcG711_DecodeU(encoded, encoded_len, decoded, &temp_type);
|
2013-01-29 12:09:21 +00:00
|
|
|
*speech_type = ConvertSpeechType(temp_type);
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
return static_cast<int>(ret);
|
2013-01-29 12:09:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int AudioDecoderPcmU::PacketDuration(const uint8_t* encoded,
|
2015-02-13 14:01:54 +00:00
|
|
|
size_t encoded_len) const {
|
2013-09-20 16:25:28 +00:00
|
|
|
// One encoded byte per sample per channel.
|
2015-03-18 09:47:08 +00:00
|
|
|
return static_cast<int>(encoded_len / Channels());
|
2013-01-29 12:09:21 +00:00
|
|
|
}
|
|
|
|
|
|
2015-04-07 16:12:57 +02:00
|
|
|
size_t AudioDecoderPcmUMultiCh::Channels() const {
|
|
|
|
|
return channels_;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-29 12:09:21 +00:00
|
|
|
// PCMa
|
2015-04-07 16:12:57 +02:00
|
|
|
|
2015-08-27 15:22:11 +02:00
|
|
|
void AudioDecoderPcmA::Reset() {
|
2015-04-07 16:12:57 +02:00
|
|
|
}
|
|
|
|
|
size_t AudioDecoderPcmA::Channels() const {
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2015-03-16 12:30:37 +00:00
|
|
|
int AudioDecoderPcmA::DecodeInternal(const uint8_t* encoded,
|
|
|
|
|
size_t encoded_len,
|
|
|
|
|
int sample_rate_hz,
|
|
|
|
|
int16_t* decoded,
|
|
|
|
|
SpeechType* speech_type) {
|
2015-09-17 00:24:34 -07:00
|
|
|
RTC_DCHECK_EQ(sample_rate_hz, 8000);
|
2013-01-30 09:41:56 +00:00
|
|
|
int16_t temp_type = 1; // Default is speech.
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
size_t ret = WebRtcG711_DecodeA(encoded, encoded_len, decoded, &temp_type);
|
2013-01-29 12:09:21 +00:00
|
|
|
*speech_type = ConvertSpeechType(temp_type);
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
return static_cast<int>(ret);
|
2013-01-29 12:09:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int AudioDecoderPcmA::PacketDuration(const uint8_t* encoded,
|
2015-02-13 14:01:54 +00:00
|
|
|
size_t encoded_len) const {
|
2013-09-20 16:25:28 +00:00
|
|
|
// One encoded byte per sample per channel.
|
2015-03-18 09:47:08 +00:00
|
|
|
return static_cast<int>(encoded_len / Channels());
|
2013-01-29 12:09:21 +00:00
|
|
|
}
|
|
|
|
|
|
2015-04-07 16:12:57 +02:00
|
|
|
size_t AudioDecoderPcmAMultiCh::Channels() const {
|
|
|
|
|
return channels_;
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-04 11:51:46 +00:00
|
|
|
AudioDecoderCng::AudioDecoderCng() {
|
2015-09-17 00:24:34 -07:00
|
|
|
RTC_CHECK_EQ(0, WebRtcCng_CreateDec(&dec_state_));
|
2015-08-27 15:22:11 +02:00
|
|
|
WebRtcCng_InitDec(dec_state_);
|
2013-01-29 12:09:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AudioDecoderCng::~AudioDecoderCng() {
|
2014-11-06 07:54:31 +00:00
|
|
|
WebRtcCng_FreeDec(dec_state_);
|
2013-01-29 12:09:21 +00:00
|
|
|
}
|
|
|
|
|
|
2015-08-27 15:22:11 +02:00
|
|
|
void AudioDecoderCng::Reset() {
|
|
|
|
|
WebRtcCng_InitDec(dec_state_);
|
2013-01-29 12:09:21 +00:00
|
|
|
}
|
|
|
|
|
|
2015-04-07 16:12:57 +02:00
|
|
|
int AudioDecoderCng::IncomingPacket(const uint8_t* payload,
|
|
|
|
|
size_t payload_len,
|
|
|
|
|
uint16_t rtp_sequence_number,
|
|
|
|
|
uint32_t rtp_timestamp,
|
|
|
|
|
uint32_t arrival_timestamp) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CNG_dec_inst* AudioDecoderCng::CngDecoderInstance() {
|
|
|
|
|
return dec_state_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
size_t AudioDecoderCng::Channels() const {
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int AudioDecoderCng::DecodeInternal(const uint8_t* encoded,
|
|
|
|
|
size_t encoded_len,
|
|
|
|
|
int sample_rate_hz,
|
|
|
|
|
int16_t* decoded,
|
|
|
|
|
SpeechType* speech_type) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
2014-12-09 10:12:53 +00:00
|
|
|
bool CodecSupported(NetEqDecoder codec_type) {
|
|
|
|
|
switch (codec_type) {
|
|
|
|
|
case kDecoderPCMu:
|
|
|
|
|
case kDecoderPCMa:
|
|
|
|
|
case kDecoderPCMu_2ch:
|
|
|
|
|
case kDecoderPCMa_2ch:
|
|
|
|
|
#ifdef WEBRTC_CODEC_ILBC
|
|
|
|
|
case kDecoderILBC:
|
|
|
|
|
#endif
|
|
|
|
|
#if defined(WEBRTC_CODEC_ISACFX) || defined(WEBRTC_CODEC_ISAC)
|
|
|
|
|
case kDecoderISAC:
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef WEBRTC_CODEC_ISAC
|
|
|
|
|
case kDecoderISACswb:
|
|
|
|
|
case kDecoderISACfb:
|
|
|
|
|
#endif
|
|
|
|
|
case kDecoderPCM16B:
|
|
|
|
|
case kDecoderPCM16Bwb:
|
|
|
|
|
case kDecoderPCM16Bswb32kHz:
|
|
|
|
|
case kDecoderPCM16Bswb48kHz:
|
|
|
|
|
case kDecoderPCM16B_2ch:
|
|
|
|
|
case kDecoderPCM16Bwb_2ch:
|
|
|
|
|
case kDecoderPCM16Bswb32kHz_2ch:
|
|
|
|
|
case kDecoderPCM16Bswb48kHz_2ch:
|
|
|
|
|
case kDecoderPCM16B_5ch:
|
|
|
|
|
#ifdef WEBRTC_CODEC_G722
|
|
|
|
|
case kDecoderG722:
|
|
|
|
|
case kDecoderG722_2ch:
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef WEBRTC_CODEC_OPUS
|
|
|
|
|
case kDecoderOpus:
|
|
|
|
|
case kDecoderOpus_2ch:
|
|
|
|
|
#endif
|
|
|
|
|
case kDecoderRED:
|
|
|
|
|
case kDecoderAVT:
|
|
|
|
|
case kDecoderCNGnb:
|
|
|
|
|
case kDecoderCNGwb:
|
|
|
|
|
case kDecoderCNGswb32kHz:
|
|
|
|
|
case kDecoderCNGswb48kHz:
|
|
|
|
|
case kDecoderArbitrary: {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
default: {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int CodecSampleRateHz(NetEqDecoder codec_type) {
|
|
|
|
|
switch (codec_type) {
|
|
|
|
|
case kDecoderPCMu:
|
|
|
|
|
case kDecoderPCMa:
|
|
|
|
|
case kDecoderPCMu_2ch:
|
|
|
|
|
case kDecoderPCMa_2ch:
|
|
|
|
|
#ifdef WEBRTC_CODEC_ILBC
|
|
|
|
|
case kDecoderILBC:
|
|
|
|
|
#endif
|
|
|
|
|
case kDecoderPCM16B:
|
|
|
|
|
case kDecoderPCM16B_2ch:
|
|
|
|
|
case kDecoderPCM16B_5ch:
|
|
|
|
|
case kDecoderCNGnb: {
|
|
|
|
|
return 8000;
|
|
|
|
|
}
|
|
|
|
|
#if defined(WEBRTC_CODEC_ISACFX) || defined(WEBRTC_CODEC_ISAC)
|
|
|
|
|
case kDecoderISAC:
|
|
|
|
|
#endif
|
|
|
|
|
case kDecoderPCM16Bwb:
|
|
|
|
|
case kDecoderPCM16Bwb_2ch:
|
|
|
|
|
#ifdef WEBRTC_CODEC_G722
|
|
|
|
|
case kDecoderG722:
|
|
|
|
|
case kDecoderG722_2ch:
|
|
|
|
|
#endif
|
|
|
|
|
case kDecoderCNGwb: {
|
|
|
|
|
return 16000;
|
|
|
|
|
}
|
|
|
|
|
#ifdef WEBRTC_CODEC_ISAC
|
|
|
|
|
case kDecoderISACswb:
|
|
|
|
|
case kDecoderISACfb:
|
|
|
|
|
#endif
|
|
|
|
|
case kDecoderPCM16Bswb32kHz:
|
|
|
|
|
case kDecoderPCM16Bswb32kHz_2ch:
|
|
|
|
|
case kDecoderCNGswb32kHz: {
|
|
|
|
|
return 32000;
|
|
|
|
|
}
|
|
|
|
|
case kDecoderPCM16Bswb48kHz:
|
|
|
|
|
case kDecoderPCM16Bswb48kHz_2ch: {
|
|
|
|
|
return 48000;
|
|
|
|
|
}
|
|
|
|
|
#ifdef WEBRTC_CODEC_OPUS
|
|
|
|
|
case kDecoderOpus:
|
|
|
|
|
case kDecoderOpus_2ch: {
|
|
|
|
|
return 48000;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
case kDecoderCNGswb48kHz: {
|
|
|
|
|
// TODO(tlegrand): Remove limitation once ACM has full 48 kHz support.
|
|
|
|
|
return 32000;
|
|
|
|
|
}
|
|
|
|
|
default: {
|
|
|
|
|
return -1; // Undefined sample rate.
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AudioDecoder* CreateAudioDecoder(NetEqDecoder codec_type) {
|
|
|
|
|
if (!CodecSupported(codec_type)) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
switch (codec_type) {
|
|
|
|
|
case kDecoderPCMu:
|
|
|
|
|
return new AudioDecoderPcmU;
|
|
|
|
|
case kDecoderPCMa:
|
|
|
|
|
return new AudioDecoderPcmA;
|
|
|
|
|
case kDecoderPCMu_2ch:
|
|
|
|
|
return new AudioDecoderPcmUMultiCh(2);
|
|
|
|
|
case kDecoderPCMa_2ch:
|
|
|
|
|
return new AudioDecoderPcmAMultiCh(2);
|
|
|
|
|
#ifdef WEBRTC_CODEC_ILBC
|
|
|
|
|
case kDecoderILBC:
|
|
|
|
|
return new AudioDecoderIlbc;
|
|
|
|
|
#endif
|
|
|
|
|
#if defined(WEBRTC_CODEC_ISACFX)
|
2015-08-24 02:03:23 -07:00
|
|
|
case kDecoderISAC:
|
|
|
|
|
return new AudioDecoderIsacFix();
|
2014-12-09 10:12:53 +00:00
|
|
|
#elif defined(WEBRTC_CODEC_ISAC)
|
2015-08-24 02:03:23 -07:00
|
|
|
case kDecoderISAC:
|
2014-12-09 10:12:53 +00:00
|
|
|
case kDecoderISACswb:
|
2015-08-24 02:03:23 -07:00
|
|
|
case kDecoderISACfb:
|
|
|
|
|
return new AudioDecoderIsac();
|
2014-12-09 10:12:53 +00:00
|
|
|
#endif
|
|
|
|
|
case kDecoderPCM16B:
|
|
|
|
|
case kDecoderPCM16Bwb:
|
|
|
|
|
case kDecoderPCM16Bswb32kHz:
|
|
|
|
|
case kDecoderPCM16Bswb48kHz:
|
|
|
|
|
return new AudioDecoderPcm16B;
|
|
|
|
|
case kDecoderPCM16B_2ch:
|
|
|
|
|
case kDecoderPCM16Bwb_2ch:
|
|
|
|
|
case kDecoderPCM16Bswb32kHz_2ch:
|
|
|
|
|
case kDecoderPCM16Bswb48kHz_2ch:
|
|
|
|
|
return new AudioDecoderPcm16BMultiCh(2);
|
|
|
|
|
case kDecoderPCM16B_5ch:
|
|
|
|
|
return new AudioDecoderPcm16BMultiCh(5);
|
|
|
|
|
#ifdef WEBRTC_CODEC_G722
|
|
|
|
|
case kDecoderG722:
|
|
|
|
|
return new AudioDecoderG722;
|
|
|
|
|
case kDecoderG722_2ch:
|
|
|
|
|
return new AudioDecoderG722Stereo;
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef WEBRTC_CODEC_OPUS
|
|
|
|
|
case kDecoderOpus:
|
|
|
|
|
return new AudioDecoderOpus(1);
|
|
|
|
|
case kDecoderOpus_2ch:
|
|
|
|
|
return new AudioDecoderOpus(2);
|
|
|
|
|
#endif
|
|
|
|
|
case kDecoderCNGnb:
|
|
|
|
|
case kDecoderCNGwb:
|
|
|
|
|
case kDecoderCNGswb32kHz:
|
|
|
|
|
case kDecoderCNGswb48kHz:
|
|
|
|
|
return new AudioDecoderCng;
|
|
|
|
|
case kDecoderRED:
|
|
|
|
|
case kDecoderAVT:
|
|
|
|
|
case kDecoderArbitrary:
|
|
|
|
|
default: {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-29 12:09:21 +00:00
|
|
|
} // namespace webrtc
|