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"
|
2015-11-18 23:07:57 +01:00
|
|
|
#include "webrtc/modules/audio_coding/codecs/g711/audio_decoder_pcm.h"
|
2013-01-29 12:09:21 +00:00
|
|
|
#ifdef WEBRTC_CODEC_G722
|
2015-11-18 23:07:57 +01:00
|
|
|
#include "webrtc/modules/audio_coding/codecs/g722/audio_decoder_g722.h"
|
2013-01-29 12:09:21 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef WEBRTC_CODEC_ILBC
|
2015-11-18 23:07:57 +01:00
|
|
|
#include "webrtc/modules/audio_coding/codecs/ilbc/audio_decoder_ilbc.h"
|
2013-01-29 12:09:21 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef WEBRTC_CODEC_ISACFX
|
2015-10-29 11:31:02 +01:00
|
|
|
#include "webrtc/modules/audio_coding/codecs/isac/fix/include/audio_decoder_isacfix.h"
|
|
|
|
|
#include "webrtc/modules/audio_coding/codecs/isac/fix/include/audio_encoder_isacfix.h"
|
2013-01-29 12:09:21 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef WEBRTC_CODEC_ISAC
|
2015-10-29 11:31:02 +01:00
|
|
|
#include "webrtc/modules/audio_coding/codecs/isac/main/include/audio_decoder_isac.h"
|
|
|
|
|
#include "webrtc/modules/audio_coding/codecs/isac/main/include/audio_encoder_isac.h"
|
2013-01-29 12:09:21 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef WEBRTC_CODEC_OPUS
|
2015-11-18 23:07:57 +01:00
|
|
|
#include "webrtc/modules/audio_coding/codecs/opus/audio_decoder_opus.h"
|
2013-01-29 12:09:21 +00:00
|
|
|
#endif
|
2015-11-18 23:07:57 +01:00
|
|
|
#include "webrtc/modules/audio_coding/codecs/pcm16b/audio_decoder_pcm16b.h"
|
2013-01-29 12:09:21 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
2014-12-09 10:12:53 +00:00
|
|
|
bool CodecSupported(NetEqDecoder codec_type) {
|
|
|
|
|
switch (codec_type) {
|
2015-10-29 06:20:28 -07:00
|
|
|
case NetEqDecoder::kDecoderPCMu:
|
|
|
|
|
case NetEqDecoder::kDecoderPCMa:
|
|
|
|
|
case NetEqDecoder::kDecoderPCMu_2ch:
|
|
|
|
|
case NetEqDecoder::kDecoderPCMa_2ch:
|
2014-12-09 10:12:53 +00:00
|
|
|
#ifdef WEBRTC_CODEC_ILBC
|
2015-10-29 06:20:28 -07:00
|
|
|
case NetEqDecoder::kDecoderILBC:
|
2014-12-09 10:12:53 +00:00
|
|
|
#endif
|
|
|
|
|
#if defined(WEBRTC_CODEC_ISACFX) || defined(WEBRTC_CODEC_ISAC)
|
2015-10-29 06:20:28 -07:00
|
|
|
case NetEqDecoder::kDecoderISAC:
|
2014-12-09 10:12:53 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef WEBRTC_CODEC_ISAC
|
2015-10-29 06:20:28 -07:00
|
|
|
case NetEqDecoder::kDecoderISACswb:
|
|
|
|
|
#endif
|
|
|
|
|
case NetEqDecoder::kDecoderPCM16B:
|
|
|
|
|
case NetEqDecoder::kDecoderPCM16Bwb:
|
|
|
|
|
case NetEqDecoder::kDecoderPCM16Bswb32kHz:
|
|
|
|
|
case NetEqDecoder::kDecoderPCM16Bswb48kHz:
|
|
|
|
|
case NetEqDecoder::kDecoderPCM16B_2ch:
|
|
|
|
|
case NetEqDecoder::kDecoderPCM16Bwb_2ch:
|
|
|
|
|
case NetEqDecoder::kDecoderPCM16Bswb32kHz_2ch:
|
|
|
|
|
case NetEqDecoder::kDecoderPCM16Bswb48kHz_2ch:
|
|
|
|
|
case NetEqDecoder::kDecoderPCM16B_5ch:
|
2014-12-09 10:12:53 +00:00
|
|
|
#ifdef WEBRTC_CODEC_G722
|
2015-10-29 06:20:28 -07:00
|
|
|
case NetEqDecoder::kDecoderG722:
|
|
|
|
|
case NetEqDecoder::kDecoderG722_2ch:
|
2014-12-09 10:12:53 +00:00
|
|
|
#endif
|
|
|
|
|
#ifdef WEBRTC_CODEC_OPUS
|
2015-10-29 06:20:28 -07:00
|
|
|
case NetEqDecoder::kDecoderOpus:
|
|
|
|
|
case NetEqDecoder::kDecoderOpus_2ch:
|
|
|
|
|
#endif
|
|
|
|
|
case NetEqDecoder::kDecoderRED:
|
|
|
|
|
case NetEqDecoder::kDecoderAVT:
|
|
|
|
|
case NetEqDecoder::kDecoderCNGnb:
|
|
|
|
|
case NetEqDecoder::kDecoderCNGwb:
|
|
|
|
|
case NetEqDecoder::kDecoderCNGswb32kHz:
|
|
|
|
|
case NetEqDecoder::kDecoderCNGswb48kHz:
|
|
|
|
|
case NetEqDecoder::kDecoderArbitrary: {
|
2014-12-09 10:12:53 +00:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
default: {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-29 12:09:21 +00:00
|
|
|
} // namespace webrtc
|