[vlc-devel] [RFC PATCH 11/11] omxil: add android hw buffers support (zero copy)

Martin Storsjö martin at martin.st
Tue Jun 24 18:35:37 CEST 2014


On Tue, 24 Jun 2014, Thomas Guillem wrote:

> Activated if cfg "omxil-dr" is true. If extra android symbols are not found or
> if HwBuffer_init() fails: fall back to non direct buffer mode
> ---
> modules/codec/omxil/omxil.c |  643 +++++++++++++++++++++++++++++++++++++------
> modules/codec/omxil/omxil.h |   31 +++
> 2 files changed, 587 insertions(+), 87 deletions(-)
>

> @@ -383,23 +435,35 @@ static OMX_ERRORTYPE AllocateBuffers(decoder_t *p_dec, OmxPort *p_port)
>         p_port->pp_buffers[i] = (void *)ALIGN((uintptr_t)p_buf, p_port->definition.nBufferAlignment);
> #endif
>
> -        if(p_port->b_direct)
> +        if( p_port->p_hwbuf )
> +        {
>             omx_error =
>                 OMX_UseBuffer( p_sys->omx_handle, &p_port->pp_buffers[i],
>                                p_port->i_port_index, 0,
> -                               p_port->definition.nBufferSize, (void*)1);
> +                               def->nBufferSize, p_port->p_hwbuf->pp_handles[i] );
> +            CHECK_ERROR(omx_error, "OMX_UseBuffer failed (%x : %s)",

Here you are removing/overwriting the existing codepaths for b_direct 
and OMX_UseBuffer - please don't do that.

OMX is not only used for android, it's also used on Raspberry Pi (or at 
least was used before) and Maemo, and the OMX_UseBuffer codepaths work 
there (at least more or less). So please keep that working as it used to 
do; if you want to have different behaviour for IOMX here you can add 
ifdefs instead.

// Martin



More information about the vlc-devel mailing list