[FFmpeg-devel] [PATCH] Generalize pixel format enum fields to int formats

Michael Niedermayer michaelni
Wed Jul 21 16:16:47 CEST 2010


On Wed, Jul 21, 2010 at 02:38:28AM -0700, S.N. Hemanth Meenakshisundaram wrote:
> Hi,
> 
> Patch updated with the compact notation for intializing num_formats in
> avfilter_all_formats and type in avfilter_default_query_formats. This
> works with make lavfitest and make test. However the next patch in the
> series "lavfi audio framework" fails those tests. More details on that
> in that thread.
> 
> ---
>  libavfilter/avfilter.c      |    5 +++--
>  libavfilter/avfilter.h      |   22 ++++++++++++----------
>  libavfilter/avfiltergraph.c |    4 ++--
>  libavfilter/defaults.c      |    6 +++++-
>  libavfilter/formats.c       |   32 +++++++++++++++++---------------
>  libavfilter/vf_scale.c      |    4 ++--
>  6 files changed, 41 insertions(+), 32 deletions(-)
> 
> 
> 

>  avfilter.c      |    5 +++--
>  avfilter.h      |   22 ++++++++++++----------
>  avfiltergraph.c |    4 ++--
>  defaults.c      |    6 +++++-
>  formats.c       |   32 +++++++++++++++++---------------
>  vf_scale.c      |    4 ++--
>  6 files changed, 41 insertions(+), 32 deletions(-)
> 12c39ea4bb52c84487125c71d0ee4fcfd159e240  0001-Generalize-pixel-format-enum-fields-to-int-formats.patch
> diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
> index f442cdc..411551b 100644
> --- a/libavfilter/avfilter.c
> +++ b/libavfilter/avfilter.c
> @@ -97,7 +97,8 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad,
>      link->dst     = dst;
>      link->srcpad  = srcpad;
>      link->dstpad  = dstpad;
> -    link->format  = PIX_FMT_NONE;
> +    link->type    = src->output_pads[srcpad].type;
> +    link->format  = -1;

this requires an assert(PIX_FMT_NONE == -1 && SAMPLE_FMT_NONE == PIX_FMT_NONE)


[...]
> diff --git a/libavfilter/defaults.c b/libavfilter/defaults.c
> index ed1db94..ded14ff 100644
> --- a/libavfilter/defaults.c
> +++ b/libavfilter/defaults.c
> @@ -160,7 +160,11 @@ void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
>  
>  int avfilter_default_query_formats(AVFilterContext *ctx)
>  {
> -    avfilter_set_common_formats(ctx, avfilter_all_colorspaces());
> +    enum AVMediaType type = ctx->inputs [0] ? ctx->inputs [0]->type :
> +                            ctx->outputs[0] ? ctx->outputs[0]->type :
> +                            AVMEDIA_TYPE_VIDEO; 

trailing whitespace

should be ok otherwise

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There will always be a question for which you do not know the correct awnser.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100721/46c3a5f4/attachment.pgp>



More information about the ffmpeg-devel mailing list