当前位置: 首页>>代码示例>>C++>>正文


C++ MpCodecSubInfo类代码示例

本文整理汇总了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;
}
开发者ID:,项目名称:,代码行数:35,代码来源:

示例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);
*/
}
开发者ID:,项目名称:,代码行数:31,代码来源:

示例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;
}
开发者ID:,项目名称:,代码行数:33,代码来源:

示例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);
*/
}
开发者ID:xaccc,项目名称:sipXtapi,代码行数:51,代码来源:MpCodecFactory.cpp

示例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;
}
开发者ID:,项目名称:,代码行数:18,代码来源:


注:本文中的MpCodecSubInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。