Commit a72ed50c authored by Thomas Guillem's avatar Thomas Guillem Committed by Martin Storsjö

iomx: add android GraphicBuffers functions.

- OMXAndroid_EnableGraphicBuffers: activate GraphicBuffers.
  Next call of OMX_GetParameter(OMX_IndexParamPortDefinition) will return a
  private eColorFormat compatible with android hal_format.

- OMXAndroid_GetGraphicBufferUsage: return hw_usage that will be used to
  allocate android hw buffers.
Signed-off-by: Martin Storsjö's avatarMartin Storsjö <martin@martin.st>
parent e77a89bc
......@@ -404,5 +404,25 @@ OMX_ERRORTYPE PREFIX(OMX_GetComponentsOfRole)(OMX_STRING role, OMX_U32 *num_comp
*num_comps = i;
return OMX_ErrorNone;
}
#ifdef HAS_USE_BUFFER
OMX_ERRORTYPE PREFIX(OMXAndroid_EnableGraphicBuffers)(OMX_HANDLETYPE component, OMX_U32 port_index, OMX_BOOL enable)
{
OMXNode* node = (OMXNode*) ((OMX_COMPONENTTYPE*)component)->pComponentPrivate;
int ret = ctx->iomx->enableGraphicBuffers(node->node, port_index, enable);
if (ret != OK)
return OMX_ErrorUndefined;
return OMX_ErrorNone;
}
OMX_ERRORTYPE PREFIX(OMXAndroid_GetGraphicBufferUsage)(OMX_HANDLETYPE component, OMX_U32 port_index, OMX_U32* usage)
{
OMXNode* node = (OMXNode*) ((OMX_COMPONENTTYPE*)component)->pComponentPrivate;
int ret = ctx->iomx->getGraphicBufferUsage(node->node, port_index, usage);
if (ret != OK)
return OMX_ErrorUndefined;
return OMX_ErrorNone;
}
#endif
}
......@@ -87,6 +87,9 @@ OMX_ERRORTYPE (*pf_get_handle) (OMX_HANDLETYPE *, OMX_STRING,
OMX_ERRORTYPE (*pf_free_handle) (OMX_HANDLETYPE);
OMX_ERRORTYPE (*pf_component_enum)(OMX_STRING, OMX_U32, OMX_U32);
OMX_ERRORTYPE (*pf_get_roles_of_component)(OMX_STRING, OMX_U32 *, OMX_U8 **);
OMX_ERRORTYPE (*pf_enable_graphic_buffers)(OMX_HANDLETYPE, OMX_U32, OMX_BOOL);
OMX_ERRORTYPE (*pf_get_graphic_buffer_usage)(OMX_HANDLETYPE, OMX_U32, OMX_U32*);
int (*pf_omx_hwbuffer_connect) (void *);
int (*pf_omx_hwbuffer_disconnect) (void *);
int (*pf_omx_hwbuffer_setup) (void *, int, int, int, int, unsigned int *,
......@@ -169,6 +172,9 @@ int InitOmxCore(vlc_object_t *p_this)
return VLC_EGENERIC;
}
#if defined(USE_IOMX)
pf_enable_graphic_buffers = dlsym( dll_handle, "OMXAndroid_EnableGraphicBuffers" );
pf_get_graphic_buffer_usage = dlsym( dll_handle, "OMXAndroid_GetGraphicBufferUsage" );
pf_omx_hwbuffer_connect = dlsym( dll_handle, "OMXHWBuffer_Connect" );
pf_omx_hwbuffer_disconnect = dlsym( dll_handle, "OMXHWBuffer_Disconnect" );
pf_omx_hwbuffer_setup = dlsym( dll_handle, "OMXHWBuffer_Setup" );
......
......@@ -33,6 +33,10 @@ OMX_ERRORTYPE (*pf_free_handle) (OMX_HANDLETYPE);
OMX_ERRORTYPE (*pf_component_enum)(OMX_STRING, OMX_U32, OMX_U32);
OMX_ERRORTYPE (*pf_get_roles_of_component)(OMX_STRING, OMX_U32 *, OMX_U8 **);
/* Extra IOMX android functions. Can be NULL if we don't link with libiomx */
OMX_ERRORTYPE (*pf_enable_graphic_buffers)(OMX_HANDLETYPE, OMX_U32, OMX_BOOL);
OMX_ERRORTYPE (*pf_get_graphic_buffer_usage)(OMX_HANDLETYPE, OMX_U32, OMX_U32*);
/* OMXHWBuffer functions */
int (*pf_omx_hwbuffer_connect) (void *);
int (*pf_omx_hwbuffer_disconnect) (void *);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment