[FFmpeg-devel] [PATCH 04/10] lavfi: implement ff_query_formats_all().

Stefano Sabatini stefasab at gmail.com
Fri Jan 4 18:34:00 CET 2013


On date Monday 2012-12-31 18:58:01 +0100, Nicolas George encoded:
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  libavfilter/formats.c |    8 ++++++++
>  libavfilter/formats.h |    8 ++++++++
>  2 files changed, 16 insertions(+)
> 
> 
> Unchanged.
> 
> 
> diff --git a/libavfilter/formats.c b/libavfilter/formats.c
> index 0795af3..7450114 100644
> --- a/libavfilter/formats.c
> +++ b/libavfilter/formats.c
> @@ -523,6 +523,14 @@ int ff_default_query_formats(AVFilterContext *ctx)
>      return 0;
>  }
>  
> +int ff_query_formats_all(AVFilterContext *ctx)
> +{
> +    ff_set_common_formats(ctx, ff_all_formats(AVMEDIA_TYPE_AUDIO));
> +    ff_set_common_channel_layouts(ctx, ff_all_channel_counts());
> +    ff_set_common_samplerates(ctx, ff_all_samplerates());
> +    return 0;
> +}

Yes, although we should really make the called functions check for
failures and return an int.

> +
>  /* internal functions for parsing audio format arguments */
>  
>  int ff_parse_pixel_format(enum AVPixelFormat *ret, const char *arg, void *log_ctx)
> diff --git a/libavfilter/formats.h b/libavfilter/formats.h
> index ec15a8d..28aa8ad 100644
> --- a/libavfilter/formats.h
> +++ b/libavfilter/formats.h
> @@ -172,6 +172,14 @@ void ff_channel_layouts_changeref(AVFilterChannelLayouts **oldref,
>  
>  int ff_default_query_formats(AVFilterContext *ctx);
>  
> +/**
> + * Sets the formats list to all existing formats.

Nit: Set

> + * This function behaves like ff_default_query_formats(), except it also
> + * accepts channel layouts with unknown disposition. It should only be used
> + * with audio filters.
> + */
> +int ff_query_formats_all(AVFilterContext *ctx);

LGTM otherwise.
-- 
FFmpeg = Fanciful and Friendly Mournful Perennial Enhancing Gladiator


More information about the ffmpeg-devel mailing list