本文整理汇总了C++中SharedMemory::InitResource方法的典型用法代码示例。如果您正苦于以下问题:C++ SharedMemory::InitResource方法的具体用法?C++ SharedMemory::InitResource怎么用?C++ SharedMemory::InitResource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharedMemory
的用法示例。
在下文中一共展示了SharedMemory::InitResource方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateSharedMemory
ELTE_INT32 SharedMemoryMgr::CreateSharedMemory(const std::string& strResId)
{
LOG_TRACE();
INFO_PARAM1(strResId);
std::map <std::string, SharedMemory*>::iterator iter = m_sharedMemorys.find(strResId);
if(m_sharedMemorys.end() != iter)
{
return eLTE_SDK_ERR_SUCCESS;
}
SharedMemory* pSharedMemory = new SharedMemory(strResId);
if (NULL == pSharedMemory)
{
return eLTE_SDK_ERR_NULL_POINTER;
}
//初始化资源
ELTE_INT32 iRet = pSharedMemory->InitResource();
if(eLTE_SDK_ERR_SUCCESS != iRet)
{
delete pSharedMemory;
pSharedMemory = NULL;
return iRet;//lint !e438
}
//开启接受视频流线程
iRet = pSharedMemory->StartYuvFrameProcess();
if(eLTE_SDK_ERR_SUCCESS != iRet)
{
delete pSharedMemory;
pSharedMemory = NULL;
return iRet;//lint !e438
}
//开启发送视频流线程
iRet = pSharedMemory->StartRevMsg();
if(eLTE_SDK_ERR_SUCCESS != iRet)
{
delete pSharedMemory;
pSharedMemory = NULL;
return iRet;//lint !e438
}
(ELTE_VOID)m_sharedMemorys.insert(std::pair <std::string, SharedMemory*> (strResId, pSharedMemory));
return eLTE_SDK_ERR_SUCCESS;//lint !e429
}