- forgotten fixes from March

This commit is contained in:
2020-05-05 12:34:52 +03:00
parent 762eb9ca33
commit 0d69c26a13
7 changed files with 233 additions and 212 deletions

View File

@@ -19,41 +19,41 @@
namespace MT
{
class CodecList
{
public:
class CodecList
{
public:
struct Settings
{
bool mWrapIuUP = false;
bool mSkipDecode = false;
bool mWrapIuUP = false;
bool mSkipDecode = false;
// AMR payload types
std::set<int> mAmrWbPayloadType = { MT_AMRWB_PAYLOADTYPE };
std::set<int> mAmrNbPayloadType = { MT_AMRNB_PAYLOADTYPE };
std::set<int> mAmrWbOctetPayloadType = { MT_AMRWB_OCTET_PAYLOADTYPE };
std::set<int> mAmrNbOctetPayloadType = { MT_AMRNB_OCTET_PAYLOADTYPE };
// AMR payload types
std::set<int> mAmrWbPayloadType = { MT_AMRWB_PAYLOADTYPE };
std::set<int> mAmrNbPayloadType = { MT_AMRNB_PAYLOADTYPE };
std::set<int> mAmrWbOctetPayloadType = { MT_AMRWB_OCTET_PAYLOADTYPE };
std::set<int> mAmrNbOctetPayloadType = { MT_AMRNB_OCTET_PAYLOADTYPE };
bool isAmrWb(int ptype) const { return mAmrWbOctetPayloadType.count(ptype) > 0 || mAmrWbPayloadType.count(ptype) > 0; }
bool isAmrNb(int ptype) const { return mAmrNbOctetPayloadType.count(ptype) > 0 || mAmrNbPayloadType.count(ptype) > 0; }
bool isAmrWb(int ptype) const { return mAmrWbOctetPayloadType.count(ptype) > 0 || mAmrWbPayloadType.count(ptype) > 0; }
bool isAmrNb(int ptype) const { return mAmrNbOctetPayloadType.count(ptype) > 0 || mAmrNbPayloadType.count(ptype) > 0; }
int mIsac16KPayloadType = MT_ISAC16K_PAYLOADTYPE;
int mIsac32KPayloadType = MT_ISAC32K_PAYLOADTYPE;
int mIlbc20PayloadType = MT_ILBC20_PAYLOADTYPE;
int mIlbc30PayloadType = MT_ILBC30_PAYLOADTYPE;
int mGsmFrPayloadType = 3; // GSM is codec with fixed payload type. But sometimes it has to be overwritten.
int mGsmFrPayloadLength = 33; // Expected GSM payload length
int mGsmHrPayloadType = MT_GSMHR_PAYLOADTYPE;
int mGsmEfrPayloadType = MT_GSMEFR_PAYLOADTYPE;
int mIsac16KPayloadType = MT_ISAC16K_PAYLOADTYPE;
int mIsac32KPayloadType = MT_ISAC32K_PAYLOADTYPE;
int mIlbc20PayloadType = MT_ILBC20_PAYLOADTYPE;
int mIlbc30PayloadType = MT_ILBC30_PAYLOADTYPE;
int mGsmFrPayloadType = 3; // GSM is codec with fixed payload type. But sometimes it has to be overwritten.
int mGsmFrPayloadLength = 33; // Expected GSM payload length
int mGsmHrPayloadType = MT_GSMHR_PAYLOADTYPE;
int mGsmEfrPayloadType = MT_GSMEFR_PAYLOADTYPE;
struct OpusSpec
{
int mPayloadType = 0;
int mRate = 0;
int mChannels = 0;
};
std::vector<OpusSpec> mOpusSpec;
struct OpusSpec
{
int mPayloadType = 0;
int mRate = 0;
int mChannels = 0;
};
std::vector<OpusSpec> mOpusSpec;
static Settings DefaultSettings;
static Settings DefaultSettings;
};
CodecList(const Settings& settings);
@@ -64,15 +64,15 @@ namespace MT
int findCodec(const std::string& name) const;
void fillCodecMap(CodecMap& cm);
protected:
protected:
typedef std::vector<Codec::Factory*> FactoryList;
FactoryList mFactoryList;
Settings mSettings;
};
};
class CodecListPriority
{
public:
class CodecListPriority
{
public:
CodecListPriority();
~CodecListPriority();
@@ -80,16 +80,16 @@ namespace MT
int count(const CodecList& cl) const;
Codec::Factory& codecAt(const CodecList& cl, int index) const;
protected:
protected:
struct Item
{
int mCodecIndex;
int mPriority;
int mCodecIndex;
int mPriority;
};
std::vector<Item> mPriorityList;
static bool isNegativePriority(const CodecListPriority::Item& item);
static bool compare(const Item& item1, const Item& item2);
};
};
}
#endif