- always link AMR & Opus codecs; it reduces number of problems during builds.
This commit is contained in:
parent
e8963264e9
commit
c27d7d2b6c
File diff suppressed because it is too large
Load Diff
|
|
@ -6,7 +6,6 @@
|
||||||
#include "MT_Codec.h"
|
#include "MT_Codec.h"
|
||||||
#include "../helper/HL_Pointer.h"
|
#include "../helper/HL_Pointer.h"
|
||||||
|
|
||||||
#if defined(USE_AMR_CODEC)
|
|
||||||
# include "opencore-amr/amrnb/interf_enc.h"
|
# include "opencore-amr/amrnb/interf_enc.h"
|
||||||
# include "opencore-amr/amrnb/interf_dec.h"
|
# include "opencore-amr/amrnb/interf_dec.h"
|
||||||
|
|
||||||
|
|
@ -156,7 +155,6 @@ namespace MT
|
||||||
|
|
||||||
} // End of MT namespace
|
} // End of MT namespace
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // MT_AMRCODEC_H
|
#endif // MT_AMRCODEC_H
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -227,7 +227,6 @@ int G729Codec::plc(int lostFrames, void* output, int outputCapacity)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef USE_OPUS_CODEC
|
|
||||||
// -------------- Opus -------------------
|
// -------------- Opus -------------------
|
||||||
#define OPUS_CODEC_NAME "OPUS"
|
#define OPUS_CODEC_NAME "OPUS"
|
||||||
#define OPUS_CODEC_RATE 16000
|
#define OPUS_CODEC_RATE 16000
|
||||||
|
|
@ -528,8 +527,6 @@ int OpusCodec::plc(int lostFrames, void* output, int outputCapacity)
|
||||||
return lostFrames * pcmLength();
|
return lostFrames * pcmLength();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// -------------- ILBC -------------------
|
// -------------- ILBC -------------------
|
||||||
#define ILBC_CODEC_NAME "ILBC"
|
#define ILBC_CODEC_NAME "ILBC"
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,7 @@ extern "C"
|
||||||
#include "libg729/g729_typedef.h"
|
#include "libg729/g729_typedef.h"
|
||||||
#include "libg729/g729_ld8a.h"
|
#include "libg729/g729_ld8a.h"
|
||||||
|
|
||||||
#ifdef USE_OPUS_CODEC
|
#include "opus.h"
|
||||||
# include "opus.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace MT
|
namespace MT
|
||||||
{
|
{
|
||||||
|
|
@ -66,8 +64,6 @@ namespace MT
|
||||||
int plc(int lostFrames, void* output, int outputCapacity) override;
|
int plc(int lostFrames, void* output, int outputCapacity) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef USE_OPUS_CODEC
|
|
||||||
|
|
||||||
class OpusCodec: public Codec
|
class OpusCodec: public Codec
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -124,7 +120,6 @@ namespace MT
|
||||||
int decode(const void* input, int inputBytes, void* output, int outputCapacity);
|
int decode(const void* input, int inputBytes, void* output, int outputCapacity);
|
||||||
int plc(int lostFrames, void* output, int outputCapacity);
|
int plc(int lostFrames, void* output, int outputCapacity);
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
class IlbcCodec: public Codec
|
class IlbcCodec: public Codec
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,7 @@
|
||||||
#include "../helper/HL_Log.h"
|
#include "../helper/HL_Log.h"
|
||||||
#include "../audio/Audio_Interface.h"
|
#include "../audio/Audio_Interface.h"
|
||||||
#include "../audio/Audio_Resampler.h"
|
#include "../audio/Audio_Resampler.h"
|
||||||
|
#include "MT_AmrCodec.h"
|
||||||
#if defined(USE_AMR_CODEC)
|
|
||||||
# include "MT_AmrCodec.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
|
@ -573,9 +570,7 @@ bool AudioReceiver::getAudio(Audio::DataWindow& output, DecodeOptions options, i
|
||||||
result = mFrameCount > 0;
|
result = mFrameCount > 0;
|
||||||
|
|
||||||
// Check for bitrate counter
|
// Check for bitrate counter
|
||||||
#if defined(USE_AMR_CODEC)
|
|
||||||
processStatisticsWithAmrCodec(mCodec.get());
|
processStatisticsWithAmrCodec(mCodec.get());
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ICELogMedia(<< "RTP packet with tail.");
|
ICELogMedia(<< "RTP packet with tail.");
|
||||||
|
|
@ -692,8 +687,6 @@ float AudioReceiver::calculatePvqaMos(int rate, std::string& report)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if defined(USE_AMR_CODEC)
|
|
||||||
void AudioReceiver::processStatisticsWithAmrCodec(Codec* c)
|
void AudioReceiver::processStatisticsWithAmrCodec(Codec* c)
|
||||||
{
|
{
|
||||||
AmrNbCodec* nb = dynamic_cast<AmrNbCodec*>(c);
|
AmrNbCodec* nb = dynamic_cast<AmrNbCodec*>(c);
|
||||||
|
|
@ -705,7 +698,6 @@ void AudioReceiver::processStatisticsWithAmrCodec(Codec* c)
|
||||||
if (wb != nullptr)
|
if (wb != nullptr)
|
||||||
mStat.mBitrateSwitchCounter = wb->getSwitchCounter();
|
mStat.mBitrateSwitchCounter = wb->getSwitchCounter();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
int AudioReceiver::getSize() const
|
int AudioReceiver::getSize() const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -182,9 +182,7 @@ namespace MT
|
||||||
std::shared_ptr<Audio::DataWindow> mPvqaBuffer;
|
std::shared_ptr<Audio::DataWindow> mPvqaBuffer;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(USE_AMR_CODEC)
|
|
||||||
void processStatisticsWithAmrCodec(Codec* c);
|
void processStatisticsWithAmrCodec(Codec* c);
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DtmfReceiver: public Receiver
|
class DtmfReceiver: public Receiver
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright(C) 2007-2017 VoIPobjects (voipobjects.com)
|
/* Copyright(C) 2007-2019 VoIPobjects (voipobjects.com)
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
* 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
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
@ -18,7 +18,6 @@ CodecList::CodecList(const Settings& settings)
|
||||||
:mSettings(settings)
|
:mSettings(settings)
|
||||||
{
|
{
|
||||||
//mFactoryList.push_back(new OpusCodec::OpusFactory(16000, 1));
|
//mFactoryList.push_back(new OpusCodec::OpusFactory(16000, 1));
|
||||||
#ifdef USE_OPUS_CODEC
|
|
||||||
if (settings.mOpusSpec.empty())
|
if (settings.mOpusSpec.empty())
|
||||||
{
|
{
|
||||||
mFactoryList.push_back(new OpusCodec::OpusFactory(48000, 2, MT_OPUS_CODEC_PT));
|
mFactoryList.push_back(new OpusCodec::OpusFactory(48000, 2, MT_OPUS_CODEC_PT));
|
||||||
|
|
@ -30,8 +29,7 @@ CodecList::CodecList(const Settings& settings)
|
||||||
mFactoryList.push_back(new OpusCodec::OpusFactory(spec.mRate, spec.mChannels, spec.mPayloadType));
|
mFactoryList.push_back(new OpusCodec::OpusFactory(spec.mRate, spec.mChannels, spec.mPayloadType));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#ifdef USE_AMR_CODEC
|
|
||||||
for (int pt: mSettings.mAmrWbPayloadType)
|
for (int pt: mSettings.mAmrWbPayloadType)
|
||||||
mFactoryList.push_back(new AmrWbCodec::CodecFactory({mSettings.mWrapIuUP, false, pt}));
|
mFactoryList.push_back(new AmrWbCodec::CodecFactory({mSettings.mWrapIuUP, false, pt}));
|
||||||
for (int pt: mSettings.mAmrWbOctetPayloadType)
|
for (int pt: mSettings.mAmrWbOctetPayloadType)
|
||||||
|
|
@ -44,7 +42,6 @@ CodecList::CodecList(const Settings& settings)
|
||||||
|
|
||||||
mFactoryList.push_back(new GsmEfrCodec::GsmEfrFactory(mSettings.mWrapIuUP, mSettings.mGsmEfrPayloadType));
|
mFactoryList.push_back(new GsmEfrCodec::GsmEfrFactory(mSettings.mWrapIuUP, mSettings.mGsmEfrPayloadType));
|
||||||
|
|
||||||
#endif
|
|
||||||
//mFactoryList.push_back(new IsacCodec::IsacFactory16K(mSettings.mIsac16KPayloadType));
|
//mFactoryList.push_back(new IsacCodec::IsacFactory16K(mSettings.mIsac16KPayloadType));
|
||||||
//mFactoryList.push_back(new IlbcCodec::IlbcFactory(mSettings.mIlbc20PayloadType, mSettings.mIlbc30PayloadType));
|
//mFactoryList.push_back(new IlbcCodec::IlbcFactory(mSettings.mIlbc20PayloadType, mSettings.mIlbc30PayloadType));
|
||||||
mFactoryList.push_back(new G711Codec::AlawFactory());
|
mFactoryList.push_back(new G711Codec::AlawFactory());
|
||||||
|
|
@ -66,7 +63,7 @@ CodecList::~CodecList()
|
||||||
|
|
||||||
int CodecList::count() const
|
int CodecList::count() const
|
||||||
{
|
{
|
||||||
return (int)mFactoryList.size();
|
return static_cast<int>(mFactoryList.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
Codec::Factory& CodecList::codecAt(int index) const
|
Codec::Factory& CodecList::codecAt(int index) const
|
||||||
|
|
|
||||||
|
|
@ -258,9 +258,7 @@ Statistics& Statistics::operator += (const Statistics& src)
|
||||||
if (src.mFirstRtpTime.is_initialized())
|
if (src.mFirstRtpTime.is_initialized())
|
||||||
mFirstRtpTime = src.mFirstRtpTime;
|
mFirstRtpTime = src.mFirstRtpTime;
|
||||||
|
|
||||||
#if defined(USE_AMR_CODEC)
|
|
||||||
mBitrateSwitchCounter += src.mBitrateSwitchCounter;
|
mBitrateSwitchCounter += src.mBitrateSwitchCounter;
|
||||||
#endif
|
|
||||||
mRemotePeer = src.mRemotePeer;
|
mRemotePeer = src.mRemotePeer;
|
||||||
mSsrc = src.mSsrc;
|
mSsrc = src.mSsrc;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue