[vlc-devel] [Patches]: Video Decoder Acceleration (VDA) avcodec module for Mac OS X

Jean-Baptiste Kempf jb at videolan.org
Wed Mar 28 11:52:30 CEST 2012


On Sun, Mar 25, 2012 at 04:34:14PM +0200, Sebastien Zwickert wrote :
> Patch in attachment updated with minors changes and the availability to
> select the VDA output pixel format in the users's settings.


> +  [  --enable-vda          VDA  support (default auto)])

  auto on darwin

> +#if defined(HAVE_AVCODEC_VDA)
> +static const int  nvda_pix_fmt_list[] = { 0, 1 };
> +static const char *const nvda_pix_fmt_list_text[] =
> +  { N_("420YpCbCr8Planar"), N_("422YpCbCr8") };
> +#endif

Why do we need that? Why does the user care?

> -#if defined(HAVE_AVCODEC_VAAPI) || defined(HAVE_AVCODEC_DXVA2)
> +#if defined(HAVE_AVCODEC_VAAPI) || defined(HAVE_AVCODEC_DXVA2)  || defined(HAVE_AVCODEC_VDA)
>      add_bool( "ffmpeg-hw", false, HW_TEXT, HW_LONGTEXT, false )
>  #endif
> +#if defined(HAVE_AVCODEC_VDA)
> +    add_integer ( "ffmpeg-vda-pix-fmt", 0, VDA_PIX_FMT_TEXT,
> +                  VDA_PIX_FMT_LONGTEXT, false)
> +        change_safe ()

Is it really safe?

> +++ b/modules/codec/avcodec/vda.c
> + * Copyright (c) 2011 Sebastien Zwickert

2012 too

> +#include <libavformat/avformat.h>
> +#include <libavformat/avio.h>

avio and avformat for HWAccell?

> +#ifdef HAVE_LIBAVCODEC_AVCODEC_H
> +#   include <libavcodec/avcodec.h>
> +#elif defined(HAVE_FFMPEG_AVCODEC_H)
> +#   include <ffmpeg/avcodec.h>
> +#else
> +#   include <avcodec.h>
> +#endif

Use only the libavcodec/avcodec.h form now.

> +    memset( &p_va->hw_ctx, 0, sizeof(p_va->hw_ctx) );
> +    p_va->hw_ctx.queue = NULL;

Isn't memset already setting to NULL ?

> +    int i_pix_fmt = var_CreateGetInteger( p_va->p_log, "ffmpeg-vda-pix-fmt" );

Why not inherit here?

> +vlc_va_t *vlc_va_NewVDA( vlc_object_t *p_log, int i_codec_id, void *p_extra, int i_extra )
> +{
> +    if ( i_codec_id != CODEC_ID_H264 )

Inconsistent spacing before (

> +    if ( !p_extra || i_extra < 7 )
idem

Seems ok for me

Best regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device



More information about the vlc-devel mailing list