[FFmpeg-devel] [PATCH 3/4] audioconvert: add av_get_standard_channel_layout().

Stefano Sabatini stefasab at gmail.com
Mon Jul 30 11:13:02 CEST 2012


On date Monday 2012-07-30 10:41:08 +0200, Nicolas George encoded:
> Also bump minor version and add APIchanges entry.
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  doc/APIchanges           |    4 ++++
>  libavutil/audioconvert.c |   10 ++++++++++
>  libavutil/audioconvert.h |   12 ++++++++++++
>  libavutil/version.h      |    2 +-
>  4 files changed, 27 insertions(+), 1 deletion(-)
> 
> diff --git a/doc/APIchanges b/doc/APIchanges
> index 4d8404c..359ac32 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -15,6 +15,10 @@ libavutil:     2011-04-18
>  
>  API changes, most recent first:
>  
> +2012-07-30 - xxxxxxx - lavu 51.66.100
> +  Add av_get_channel_description()
> +  and av_get_standard_channel_layout() functions.
> +
>  2012-07-20 - xxxxxxx - lavc 54.43.100
>    Add decode_error_flags field to AVFrame.
>  
> diff --git a/libavutil/audioconvert.c b/libavutil/audioconvert.c
> index 224db86..0164171 100644
> --- a/libavutil/audioconvert.c
> +++ b/libavutil/audioconvert.c
> @@ -243,3 +243,13 @@ uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index)
>      }
>      return 0;
>  }
> +
> +int av_get_standard_channel_layout(unsigned index, uint64_t *layout,
> +                                   const char **name)
> +{
> +    if (index >= FF_ARRAY_ELEMS(channel_layout_map))
> +        return AVERROR_EOF;
> +    if (layout) *layout = channel_layout_map[index].layout;
> +    if (name)   *name   = channel_layout_map[index].name;
> +    return 0;
> +}
> diff --git a/libavutil/audioconvert.h b/libavutil/audioconvert.h
> index 063cb12..68e231f 100644
> --- a/libavutil/audioconvert.h
> +++ b/libavutil/audioconvert.h
> @@ -188,6 +188,18 @@ const char *av_get_channel_name(uint64_t channel);
>  const char *av_get_channel_description(uint64_t channel);
>  
>  /**
> + * Get the value and name of standard channel layouts.

Nit: plural form "layouts" sounds a bit weird, maybe drop the final
"s".

> + *
> + * @param[in]  index   index in an internal list, starting at 0
> + * @param[out] layout  channel layout mask
> + * @param[out] name    name of the layout

> + * @return  0  if the layout exists

nit: a comman at the end of the line may help doxygen rendering

> + *          <0 if index is beyond the limits

> + */
> +int av_get_standard_channel_layout(unsigned index, uint64_t *layout,
> +                                   const char **name);
> +

LGTM otherwise, thanks.
-- 
FFmpeg = Fierce & Frightening Mega Philosophical Evil Ghost


More information about the ffmpeg-devel mailing list