- exclude AMR / GSM EFR / EVS / Opus codecs from the default build - to make the new basic builds easier to port to new platforms / projects

This commit is contained in:
2021-01-20 21:06:17 +02:00
parent 4d8a167899
commit 24270bac97
5 changed files with 42 additions and 19 deletions

View File

@@ -226,7 +226,7 @@ int G729Codec::plc(int lostFrames, void* output, int outputCapacity)
return 0;
}
#if defined(USE_OPUS_CODEC)
// -------------- Opus -------------------
#define OPUS_CODEC_NAME "OPUS"
#define OPUS_CODEC_RATE 16000
@@ -526,6 +526,8 @@ int OpusCodec::plc(int lostFrames, void* output, int outputCapacity)
}
return lostFrames * pcmLength();
}
#endif
// -------------- ILBC -------------------

View File

@@ -24,7 +24,9 @@ extern "C"
#include "libg729/g729_typedef.h"
#include "libg729/g729_ld8a.h"
#include "opus.h"
#if defined(USE_OPUS_CODEC)
# include "opus.h"
#endif
namespace MT
{
@@ -64,6 +66,7 @@ public:
int plc(int lostFrames, void* output, int outputCapacity) override;
};
#if defined(USE_OPUS_CODEC)
class OpusCodec: public Codec
{
protected:
@@ -120,6 +123,7 @@ public:
int decode(const void* input, int inputBytes, void* output, int outputCapacity);
int plc(int lostFrames, void* output, int outputCapacity);
};
#endif
class IlbcCodec: public Codec
{

View File

@@ -1,4 +1,4 @@
/* Copyright(C) 2007-2020 VoIPobjects (voipobjects.com)
/* Copyright(C) 2007-2021 VoIPobjects (voipobjects.com)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -9,8 +9,13 @@
#include "MT_AudioCodec.h"
#if !defined(TARGET_ANDROID) && !defined(TARGET_OPENWRT) && !defined(TARGET_RPI)
# include "MT_AmrCodec.h"
# include "MT_EvsCodec.h"
# if defined(USE_AMR_CODEC)
# include "MT_AmrCodec.h"
# endif
# if defined(USE_EVS_CODEC)
# include "MT_EvsCodec.h"
# endif
#endif
#include "helper/HL_String.h"
@@ -91,7 +96,7 @@ CodecList::CodecList(const Settings& settings)
:mSettings(settings)
{
//mFactoryList.push_back(new OpusCodec::OpusFactory(16000, 1));
#if !defined(TARGET_ANDROID)
#if !defined(TARGET_ANDROID) && defined(USE_OPUS_CODEC)
if (settings.mOpusSpec.empty())
{
mFactoryList.push_back(new OpusCodec::OpusFactory(48000, 2, MT_OPUS_CODEC_PT));
@@ -106,6 +111,7 @@ CodecList::CodecList(const Settings& settings)
#endif
#if !defined(TARGET_ANDROID) && !defined(TARGET_OPENWRT) && !defined(TARGET_RPI)
#if defined(USE_AMR_CODEC)
for (int pt: mSettings.mAmrWbPayloadType)
mFactoryList.push_back(new AmrWbCodec::CodecFactory({mSettings.mWrapIuUP, false, pt}));
for (int pt: mSettings.mAmrWbOctetPayloadType)
@@ -117,6 +123,7 @@ CodecList::CodecList(const Settings& settings)
mFactoryList.push_back(new AmrNbCodec::CodecFactory({mSettings.mWrapIuUP, true, pt}));
mFactoryList.push_back(new GsmEfrCodec::GsmEfrFactory(mSettings.mWrapIuUP, mSettings.mGsmEfrPayloadType));
#endif
#endif
//mFactoryList.push_back(new IsacCodec::IsacFactory16K(mSettings.mIsac16KPayloadType));
@@ -131,7 +138,7 @@ CodecList::CodecList(const Settings& settings)
mFactoryList.push_back(new GsmHrCodec::GsmHrFactory(mSettings.mGsmHrPayloadType));
#endif
#if !defined(TARGET_ANDROID)
#if !defined(TARGET_ANDROID) && defined(USE_EVS_CODEC)
for (auto& spec: settings.mEvsSpec)
{
EVSCodec::StreamParameters evs_params;

View File

@@ -17,7 +17,6 @@
namespace MT {
class EVSCodec : public Codec
{
public: