本文整理汇总了C++中OMX_COMPONENTTYPE::UseBuffer方法的典型用法代码示例。如果您正苦于以下问题:C++ OMX_COMPONENTTYPE::UseBuffer方法的具体用法?C++ OMX_COMPONENTTYPE::UseBuffer怎么用?C++ OMX_COMPONENTTYPE::UseBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OMX_COMPONENTTYPE
的用法示例。
在下文中一共展示了OMX_COMPONENTTYPE::UseBuffer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vcil_in_use_buffer
void vcil_in_use_buffer(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen)
{
IL_ADD_BUFFER_EXECUTE_T *exe = call;
IL_ADD_BUFFER_RESPONSE_T *ret = resp;
OMX_COMPONENTTYPE *pComp = exe->reference;
OMX_U8 *buffer;
OMX_BUFFERHEADERTYPE *bufferHeader;
*rlen = sizeof(IL_ADD_BUFFER_RESPONSE_T);
buffer = vcos_malloc_aligned(exe->size, 32, "vcin mapping buffer"); // 32-byte aligned
if (!buffer)
{
ret->err = OMX_ErrorInsufficientResources;
return;
}
//OMX_OSAL_Trace(OMX_OSAL_TRACE_COMPONENT, "hostcomp: use buffer(%p)\n", buffer);
ret->func = IL_USE_BUFFER;
ret->err = pComp->UseBuffer(pComp, &bufferHeader, exe->port, exe->bufferReference, exe->size, buffer);
if (ret->err == OMX_ErrorNone)
{
// we're going to pass this buffer to VC
// initialise our private field in their copy with the host buffer reference
OMX_PARAM_PORTDEFINITIONTYPE def;
OMX_ERRORTYPE error;
def.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
def.nVersion.nVersion = OMX_VERSION;
def.nPortIndex = exe->port;
error = pComp->GetParameter(pComp, OMX_IndexParamPortDefinition, &def);
vc_assert(error == OMX_ErrorNone);
ret->reference = bufferHeader;
memcpy(&ret->bufferHeader, bufferHeader, sizeof(OMX_BUFFERHEADERTYPE));
if (def.eDir == OMX_DirInput)
ret->bufferHeader.pInputPortPrivate = bufferHeader;
else
ret->bufferHeader.pOutputPortPrivate = bufferHeader;
}
else
vcos_free(buffer);
}