[FFmpeg-soc] [soc]: r4737 - in afilters: af_null.c af_src.c avfilter.c dummy.c

Benoit Fouet benoit.fouet at free.fr
Tue Jul 21 11:50:48 CEST 2009


Hi,

[side note to Vitor]
do you know if Kevin is subscribed to the list ? does he read it ? is he
interested in reviews at all ? at the moment, it seems that at least one
of the conditions is met (although I've checked he is registered to the
list)
If we just declare afilters directolry a sandbox, it's (probably) ok,
but I'd like to know :)
thanks
[/end note]

On 2009-07-21 10:38, kdub wrote:
> Modified: afilters/af_null.c
> ==============================================================================
> --- afilters/af_null.c	Tue Jul 21 01:42:11 2009	(r4736)
> +++ afilters/af_null.c	Tue Jul 21 10:38:11 2009	(r4737)
> @@ -46,8 +50,38 @@ AVFilter avfilter_af_null =
>      .outputs   = (AVFilterPad[]) {{ .name            = "default",
>                                      .type            = CODEC_TYPE_AUDIO, },
>                                    { .name = NULL}},
> +
> +    .init = init_af_null,
> +    .query_formats = query_af_null_formats,
>  };
>  
> +
> +static int init_af_null(AVFilterContext *ctx, const char *args, void *opaque)
> +{
> +    printf("init afnull\n");
> +    int i;

warning: ISO C90 forbids mixed declarations and code

> +    af_null_priv_t * p;
> +    ctx->priv = av_mallocz(sizeof(af_null_priv_t));

isn't that already done by avfilter framework for you ?

> +    p = (af_null_priv_t*) ctx->priv;

useless cast

> +    for (i=0; i<100; i++)
> +       p->history[i] = i;
> +

memset

> +    return 0;
> +}
> +
> +static int query_af_null_formats(AVFilterContext *ctx)
> +{
> +    av_log(0,0, "query formats\n");
> +
> +    AVFilterFormats *formats;

warning: ISO C90 forbids mixed declarations and code

> +    formats = avfilter_make_format_list(3, CODEC_ID_PCM_S16LE,
> +                                            CODEC_ID_PCM_S16BE,
> +                                            CODEC_ID_PCM_F32LE);

can be merged with declaration above

> +    avfilter_set_common_formats(ctx,formats);
> +
> +    return 0;
> +}
> +
>  static int null_filter(AVFilterLink *link, AVFilterBufferRef *sample_ref)
>  {
>      av_log(0,0, "Filter buffer\n");
> 
> Modified: afilters/af_src.c
> ==============================================================================
> --- afilters/af_src.c	Tue Jul 21 01:42:11 2009	(r4736)
> +++ afilters/af_src.c	Tue Jul 21 10:38:11 2009	(r4737)
> @@ -91,6 +91,13 @@ static int src_buf_init (AVFilterContext
>  }
>  
>  
> +static int query_af_src_formats(AVFilterContext *ctx)
> +{
> +    av_log(0,0, "query formats\n");
> +    AVFilterFormats *formats1;
> +    formats1 = avfilter_all_sampleformats();

same 2 remarks here

> +    avfilter_set_common_formats(ctx,formats1);
> +}
>  
>  AVFilter avfilter_af_src =
>  {
> @@ -103,7 +110,8 @@ AVFilter avfilter_af_src =
>      .outputs    = (AVFilterPad[]) { {.name = "default",
>                                       .type = CODEC_TYPE_AUDIO,
>                                       .filter_buffer = dump_next},
> -                                    {.name = NULL}}
> +                                    {.name = NULL}},
>  
> +    .query_formats = query_af_src_formats
>  };
>  
> 
> Modified: afilters/dummy.c
> ==============================================================================
> --- afilters/dummy.c	Tue Jul 21 01:42:11 2009	(r4736)
> +++ afilters/dummy.c	Tue Jul 21 10:38:11 2009	(r4737)
> @@ -123,6 +125,16 @@ int main()
>      avfilter_init_filter(avfiltcont2, NULL, NULL);
>      avfilter_init_filter(src_context, NULL, NULL);
>  
> +    /* configure formats?  */
> +
> +
> +
> +    /* merge lists? */
> +    AVFilterFormats * merge;
> +

warning: ISO C90 forbids mixed declarations and code

-- 
Ben


More information about the FFmpeg-soc mailing list