void vcil_in_fill_this_buffer(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen) { IL_PASS_BUFFER_EXECUTE_T *exe = call; IL_RESPONSE_HEADER_T *ret = resp; OMX_COMPONENTTYPE *pComp = exe->reference; OMX_BUFFERHEADERTYPE *pHeader = exe->bufferHeader.pOutputPortPrivate; OMX_U8 *pBuffer = pHeader->pBuffer; OMX_PTR *pAppPrivate = pHeader->pAppPrivate; OMX_PTR *pPlatformPrivate = pHeader->pPlatformPrivate; OMX_PTR *pInputPortPrivate = pHeader->pInputPortPrivate; OMX_PTR *pOutputPortPrivate = pHeader->pOutputPortPrivate; vc_assert(pHeader); memcpy(pHeader, &exe->bufferHeader, sizeof(OMX_BUFFERHEADERTYPE)); pHeader->pBuffer = pBuffer; pHeader->pAppPrivate = pAppPrivate; pHeader->pPlatformPrivate = pPlatformPrivate; pHeader->pInputPortPrivate = pInputPortPrivate; pHeader->pOutputPortPrivate = pOutputPortPrivate; vc_assert(is_valid_hostside_buffer(pHeader)); *rlen = sizeof(IL_RESPONSE_HEADER_T); ret->func = IL_FILL_THIS_BUFFER; ret->err = pComp->FillThisBuffer(pComp, pHeader); }
static OMX_ERRORTYPE vcil_out_FillThisBuffer(OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_BUFFERHEADERTYPE* pBuffer) { OMX_ERRORTYPE err; OMX_COMPONENTTYPE *pComp = (OMX_COMPONENTTYPE *) hComponent; VC_PRIVATE_COMPONENT_T *comp; VC_PRIVATE_PORT_T *port; ILCS_COMMON_T *st; if (!(pComp && pBuffer)) return (OMX_ErrorBadParameter); st = pComp->pApplicationPrivate; comp = (VC_PRIVATE_COMPONENT_T *) pComp->pComponentPrivate; port = find_port(comp, pBuffer->nOutputPortIndex); if(!port) return OMX_ErrorBadPortIndex; if(pBuffer->pBuffer == 0) return OMX_ErrorIncorrectStateOperation; vcos_assert(pComp != NULL && comp != NULL && port != NULL && st != NULL); // The lower layers will attempt to transfer the bytes specified if we don't // clear these - callers should ideally do this themselves, but it is not // mandated in the specification. pBuffer->nFilledLen = 0; pBuffer->nFlags = 0; vc_assert(port->bEGL == OMX_TRUE || is_valid_hostside_buffer(pBuffer)); err = ilcs_pass_buffer(st->ilcs, IL_FILL_THIS_BUFFER, comp->reference, pBuffer); if (err == OMX_ErrorNone && port->bEGL == OMX_TRUE) { // If an output port is marked as an EGL port, we request EGL to notify the IL component // when it's allowed to render into the buffer/EGLImage. vc_assert(local_eglIntOpenMAXILDoneMarker != NULL); local_eglIntOpenMAXILDoneMarker(comp->reference, pBuffer->pBuffer); } return err; }
void vcil_in_empty_this_buffer(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen) { IL_RESPONSE_HEADER_T *ret = resp; OMX_COMPONENTTYPE *pComp; OMX_BUFFERHEADERTYPE *pHeader; pHeader = ilcs_receive_buffer(st->ilcs, call, clen, &pComp); *rlen = sizeof(IL_RESPONSE_HEADER_T); ret->func = IL_EMPTY_THIS_BUFFER; if(pHeader) { vc_assert(is_valid_hostside_buffer(pHeader)); ret->err = pComp->EmptyThisBuffer(pComp, pHeader); } else ret->err = OMX_ErrorHardware; }