本文整理汇总了C++中MpCodecSubInfo类的典型用法代码示例。如果您正苦于以下问题:C++ MpCodecSubInfo类的具体用法?C++ MpCodecSubInfo怎么用?C++ MpCodecSubInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MpCodecSubInfo类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: iter
void MpCodecFactory::freeAllLoadedLibsAndCodec()
{
OsSharedLibMgrBase* pShrMgr = OsSharedLibMgr::getOsSharedLibMgr();
UtlHashBagIterator iter(mCodecsInfo);
MpCodecSubInfo* pinfo;
UtlHashBag libLoaded;
UtlString* libName;
while ((pinfo = (MpCodecSubInfo*)iter()))
{
if ((!pinfo->getCodecCall()->isStatic()) &&
(!libLoaded.find(&pinfo->getCodecCall()->getModuleName()))) {
libLoaded.insert(const_cast<UtlString*>(&pinfo->getCodecCall()->getModuleName()));
}
}
UtlHashBagIterator iter2(libLoaded);
while ((libName = (UtlString*)iter2()))
{
pShrMgr->unloadSharedLib(libName->data());
}
iter.reset();
while ((pinfo = (MpCodecSubInfo*)iter()))
{
if (!pinfo->getCodecCall()->isStatic()) {
mCodecsInfo.remove(pinfo);
delete pinfo;
}
}
mCodecInfoCacheValid = FALSE;
}
示例2: mime_copy
MpCodecSubInfo* MpCodecFactory::searchByMIME(const UtlString& mime,
int sampleRate,
int numChannels) const
{
// Create a lower case copy of MIME-subtype string.
UtlString mime_copy(mime);
mime_copy.toLower();
// Create iterator to list all codecs with given MIME subtype.
UtlHashBagIterator iter(mCodecsInfo, &mime_copy);
MpCodecSubInfo* pInfo;
while ((pInfo = (MpCodecSubInfo*)iter()))
{
if ((int)(pInfo->getCodecInfo()->sampleRate) == sampleRate &&
(int)(pInfo->getCodecInfo()->numChannels) == numChannels)
{
return pInfo;
}
}
return NULL;
/*
// Create a lower case copy of MIME-subtype string.
UtlString mime_copy(mime);
mime_copy.toLower();
// Perform search
return (MpCodecSubInfo*)mCodecsInfo.find(&mime_copy);
*/
}
示例3: searchByMIME
OsStatus MpCodecFactory::createEncoder(const UtlString &mime,
const UtlString &fmtp,
int sampleRate,
int numChannels,
int payloadType,
MpEncoderBase*& rpEncoder) const
{
MpCodecSubInfo* codec = searchByMIME(mime, sampleRate, numChannels);
if (codec)
{
rpEncoder = new MpEncoderBase(payloadType,
*codec->getCodecCall(),
*codec->getCodecInfo(),
fmtp);
}
else
{
OsSysLog::add(FAC_MP, PRI_ERR,
"MpCodecFactory::createEncoder unknown codec type "
"%s, fmtp=%s"
"payloadType = %d",
mime.data(), fmtp.data(), payloadType);
rpEncoder=NULL;
}
if (NULL != rpEncoder)
{
return OS_SUCCESS;
}
return OS_INVALID_ARGUMENT;
}
示例4: mime_copy
MpCodecSubInfo* MpCodecFactory::searchByMIME(const UtlString& mime,
int sampleRate,
int numChannels) const
{
// Create a lower case copy of MIME-subtype string.
UtlString mime_copy(mime);
mime_copy.toLower();
int _sampleRate = sampleRate;
if(mime == "G722" && sampleRate == 8000)
{
// From RFC 3551 s4.5.2:
//
// Even though the actual sampling rate for G.722 audio is 16,000 Hz,
// the RTP clock rate for the G722 payload format is 8,000 Hz because
// that value was erroneously assigned in RFC 1890 and must remain
// unchanged for backward compatibility. The octet rate or sample-pair
// rate is 8,000 Hz.
//
// Therefore, when the codec is G722 and we see 8000 in RTP, we need
// to look for the standard 16000 codec implementation.
//
// This is often described as a hack, but it is a hack specified by the RFC
// and we have to live with it. Some implementations may not implement
// the hack correctly and may not interoperate.
_sampleRate = 16000;
}
// Create iterator to list all codecs with given MIME subtype.
UtlHashBagIterator iter(mCodecsInfo, &mime_copy);
MpCodecSubInfo* pInfo;
while ((pInfo = (MpCodecSubInfo*)iter()))
{
if (pInfo->getCodecInfo()->sampleRate == _sampleRate &&
pInfo->getCodecInfo()->numChannels == numChannels)
{
return pInfo;
}
}
return NULL;
/*
// Create a lower case copy of MIME-subtype string.
UtlString mime_copy(mime);
mime_copy.toLower();
// Perform search
return (MpCodecSubInfo*)mCodecsInfo.find(&mime_copy);
*/
}
示例5: freeAllLoadedLibsAndCodec
MpCodecFactory::~MpCodecFactory()
{
freeAllLoadedLibsAndCodec();
MpCodecSubInfo* pinfo;
UtlHashBagIterator iter(mCodecsInfo);
while ((pinfo = (MpCodecSubInfo*)iter()))
{
if (!pinfo->getCodecCall()->isStatic()) {
assert(!"Dynamically loaded codecs must be unloaded already");
}
delete pinfo;
}
mCodecsInfo.removeAll();
delete[] mpCodecInfoCache;
}