[vlc-devel] [PATCH] Adding invmem decoder (first relase)

Rémi Denis-Courmont rem at videolan.org
Tue Dec 2 18:12:36 CET 2008


Le mardi 2 décembre 2008 14:01:05 Robert Paciorek, vous avez écrit :
> ---

What's it doing? I mean, how is it different from vmem?

>  modules/codec/Modules.am |    1 +
>  modules/codec/invmem.c   |  205
> ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 206
> insertions(+), 0 deletions(-)
>  create mode 100644 modules/codec/invmem.c
>
> diff --git a/modules/codec/Modules.am b/modules/codec/Modules.am
> index 0f87d0d..999f0b8 100644
> --- a/modules/codec/Modules.am
> +++ b/modules/codec/Modules.am
> @@ -25,6 +25,7 @@ SOURCES_png = png.c
>  SOURCES_svcdsub = svcdsub.c
>  SOURCES_cvdsub = cvdsub.c
>  SOURCES_fake = fake.c
> +SOURCES_invmem = invmem.c

You also need to build it. As it does not depend on anything fancy, you can 
probably add it to libvlc_LTLIBRARIES directly.

> +#include <vlc_charset.h>

I did not try to compile it, but I wonder why you need this header.

> +    set_capability( "decoder", 1000 );

That's probably a bit exagerated  ^^^^.

> +    msg_Dbg( p_dec, "Initialize INVMEM DECODER moduule" );

Please remove this, or at least move it after that:

> +    if( p_dec->fmt_in.i_codec != VLC_FOURCC('f','a','k','e'))
> +    {
> +        return VLC_EGENERIC;
> +    }

...otherwise it will clutter everybody's debug.

> +    p_sys->i_width = config_GetInt( p_this, "invmem-width" );
> +    p_sys->i_height = config_GetInt( p_this, "invmem-height" );

var_CreateGetInteger().

> +    psz_tmp = config_GetPsz( p_dec, "invmem-lock" );

var_CreateGetString(). Same for the following.

> +    p_dec->p_sys->p_pic = p_dec->pf_vout_buffer_new( p_dec );

Use p_sys directly.

> +    p_dec->p_sys->p_pic = p_dec->pf_vout_buffer_new( p_dec );
> +    p_dec->p_sys->p_pic->b_force = true;
> +    p_dec->p_sys->p_pic->p->i_pitch = p_dec->p_sys->i_width*3;
> +
> +   // lock input and copy to picture
> +    p_dec->p_sys->p_pic->p->p_pixels = p_dec->p_sys->pf_lock(
> p_dec->p_sys->p_data ); +
> +    // unlock input
> +    p_dec->p_sys->pf_unlock( p_dec->p_sys->p_data );
> +
> +    block_Release( *pp_block ); *pp_block = NULL;
> +    return p_dec->p_sys->p_pic;

Same here.


> + * CloseDecoder: png decoder destruction
                    ^^^
-- 
Rémi Denis-Courmont
http://git.remlab.net/cgi-bin/gitweb.cgi?p=vlc-courmisch.git;a=summary



More information about the vlc-devel mailing list