예제 #1
0
// Called on host-side to pass a buffer to VideoCore to be emptied
static OMX_ERRORTYPE vcil_out_EmptyThisBuffer(OMX_IN  OMX_HANDLETYPE hComponent,
      OMX_IN  OMX_BUFFERHEADERTYPE* pBuffer)
{
   OMX_COMPONENTTYPE *pComp = (OMX_COMPONENTTYPE *) hComponent;
   VC_PRIVATE_COMPONENT_T *comp;
   ILCS_COMMON_T *st;
 
   if (!(pComp && pBuffer))
      return (OMX_ErrorBadParameter);

   st = pComp->pApplicationPrivate;
   comp = (VC_PRIVATE_COMPONENT_T *) pComp->pComponentPrivate;
   
   return ilcs_pass_buffer(st->ilcs, IL_EMPTY_THIS_BUFFER, comp->reference, pBuffer);
}
예제 #2
0
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;
}