On Sat, May 12, 2012 at 06:12:39PM +0200, Anton Khirnov wrote:
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -151,6 +151,33 @@ anullsrc=48000:4
>  
> +@section abuffer
> +Buffer audio frames, and make them available to the filter chain.
> +
> +This source is intended for a programmatic use through the interface defined 
> in
> +@file{libavfilter/buffersrc.h}.

"programmatic" does not mean for use by a computer program as you seem
to intend here.

  This source is not intended to be part of user-supplied graph
  descriptions but for insertion by calling programs through the
  interface defined in @file{libavfilter/buffersrc.h}.

> --- a/libavfilter/buffersrc.c
> +++ b/libavfilter/buffersrc.c
> @@ -165,9 +278,29 @@ static av_cold void uninit(AVFilterContext *ctx)
>  static int query_formats(AVFilterContext *ctx)
>  {
>      BufferSourceContext *c = ctx->priv;
> -    enum PixelFormat pix_fmts[] = { c->pix_fmt, PIX_FMT_NONE };
> +    AVFilterChannelLayouts *channel_layouts = NULL;
> +    AVFilterFormats                *formats = NULL;
> +    AVFilterFormats            *samplerates = NULL;
> +
> +    switch (ctx->outputs[0]->type) {
> +    case AVMEDIA_TYPE_VIDEO:
> +        avfilter_add_format(&formats, c->pix_fmt);
> +        avfilter_set_common_formats(ctx, formats);
> +        break;
> +    case AVMEDIA_TYPE_AUDIO:
> +        avfilter_add_format(&formats,           c->sample_fmt);
> +        avfilter_set_common_formats(ctx, formats);
> +
> +        avfilter_add_format(&samplerates,       c->sample_rate);
> +        ff_set_common_samplerates(ctx, samplerates);
> +
> +        ff_add_channel_layout(&channel_layouts, c->channel_layout);

The aligned arguments look strange IMO.

> @@ -229,3 +382,21 @@ AVFilter avfilter_vsrc_buffer = {
> +
> +AVFilter avfilter_asrc_abuffer = {
> +    .name      = "abuffer",
> +    .description = NULL_IF_CONFIG_SMALL("Buffer audio frames, and make them 
> accessible to the filterchain."),
> +    .priv_size = sizeof(BufferSourceContext),
> +    .query_formats = query_formats,

There's a bunch of '=' that could be aligned here.

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to