[FFmpeg-devel] [PATCH 02/10] lavfi: support unknown channel layouts.

Stefano Sabatini stefasab at gmail.com
Mon Dec 31 19:38:15 CET 2012


On date Monday 2012-12-31 18:57:59 +0100, Nicolas George encoded:
[...]
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  libavfilter/audio.c         |    2 +-
>  libavfilter/avcodec.c       |    3 --
>  libavfilter/avfiltergraph.c |   86 ++++++++++++++++++++++++++++++++++++++-----
>  libavfilter/formats.c       |   76 +++++++++++++++++++++++++++++++++-----
>  libavfilter/formats.h       |   31 ++++++++++++++++
>  5 files changed, 176 insertions(+), 22 deletions(-)
> 
> 
> Slightly changed the data structure, inspired by Stefano's comments.
> Some code simplification, a few bug fixes. FATE passes.
> 
> diff --git a/libavfilter/formats.h b/libavfilter/formats.h
> index c5a4e3d..9fbed21 100644
> --- a/libavfilter/formats.h
> +++ b/libavfilter/formats.h
> @@ -69,15 +69,46 @@ struct AVFilterFormats {
>      struct AVFilterFormats ***refs; ///< references to this list
>  };
>  

> +/**
> + * A list of supported channel layouts.
> + *
> + * The list works the same as AVFilterFormats, except for the following
> + * differences:
> + * - A list with all_layouts = 1 means all channel layouts with a known
> + *   disposition; nb_channel_layouts must then be 0.
> + * - A list with all_counts = 1 means all channel counts, with a known or
> + *   unknown disposition ; nb_channel_layouts must then be 0 and all_layouts 1.
> + * - The list must not contain a layout with a known disposition and a
> + *   channel count with unknown disposition with the same number of channels
> + *   (e.g. AV_CH_LAYOUT_STEREO and FF_CHAN2LAYOUT(2).
> + */

This is excluding lists supporting all channel layouts with a known
disposition, and channel layouts with unknown disposition and a
certain number N of channels, which could be represented as:

all_channels = 1;
list = { FF_CHAN2LAYOUT(N) };

Another case: a list supporting all channel layouts with unknown
disposition, but only a few with known disposition.

I wonder if this is by purpose. On the other hands such lists don't
make much sense, but even in this case I wonder which are the
pros/cons of adding more constraints.

[...]

I'll review the rest of the patch tomorrow.
-- 
FFmpeg = Fostering Formidable Meaningful Problematic Enhancing Gospel


More information about the ffmpeg-devel mailing list