[FFmpeg-soc] [soc]: r3760 - in libavfilter: Makefile allfilters.c diffs/02_ffmpeg_filters.diff vsrc_buffer.c vsrc_buffer.h

Aurelien Jacobs aurel at gnuage.org
Wed Oct 8 20:37:42 CEST 2008


vitor wrote:

> Author: vitor
> Date: Wed Oct  8 20:11:13 2008
> New Revision: 3760
> 
> Log:
> Create a buffer source filter instead of duplicating it in ffmpeg.c and 
> ffplay.c
> 
> [...]
> 
>  Index: ffmpeg.c
>  ===================================================================
> ---- ffmpeg.c	(revision 15000)
> +--- ffmpeg.c	(revision 15585)
>  +++ ffmpeg.c	(working copy)
> -@@ -41,6 +41,12 @@
> +@@ -41,6 +41,13 @@
>   #include "libavutil/avstring.h"
>   #include "libavformat/os_support.h"
>   
> @@ -10,12 +10,13 @@ Index: ffmpeg.c
>  +# include "libavfilter/avfilter.h"
>  +# include "libavfilter/avfiltergraph.h"
>  +# include "libavfilter/graphparser.h"
> ++# include "libavfilter/vsrc_buffer.h"

As long as this header is not public, ffmpeg shouldn't rely on it.

> [...]
> 
>  +#if ENABLE_AVFILTER
>  +        if (ist->st->codec->codec_type == CODEC_TYPE_VIDEO) {
>  +            // add it to be filtered
> -+            memcpy(ist->filter_frame->data,  picture.data,
> -+                   sizeof(picture.data));
> -+            memcpy(ist->filter_frame->linesize, picture.linesize,
> -+                   sizeof(picture.linesize));
> -+            ist->has_filter_frame = 1;
> ++            av_vsrc_buffer_add_frame(ist->input_video_filter, &picture,
> ++                                     ist->pts,
> ++                                     ist->st->codec->sample_aspect_ratio);
>  +        }
>  +#endif

Direct call to a function inside a particular filter is quite ugly.
I have not looked at this more deeply, so I don't know if there is any
better solution, but avoiding such direct call to filter internals
would be nice if possible.

> Added: libavfilter/vsrc_buffer.c
> ==============================================================================
> --- (empty file)
> +++ libavfilter/vsrc_buffer.c	Wed Oct  8 20:11:13 2008
> @@ -0,0 +1,137 @@
> +/*
> + * Memory buffer source filter
> + * Copyright (c) 2008 Vitor Sessak
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> + */
> +
> +#include "avfilter.h"
> +

Missing include of vsrc_buffer.h.

> Added: libavfilter/vsrc_buffer.h
> ==============================================================================
> --- (empty file)
> +++ libavfilter/vsrc_buffer.h	Wed Oct  8 20:11:13 2008
> @@ -0,0 +1,24 @@
> +/*
> + * Memory buffer source filter
> + * Copyright (c) 2008 Vitor Sessak
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> + */
> +
> +int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame,
> +                             int64_t pts, AVRational pixel_aspect);

Missing inclusion guards.

Aurel



More information about the FFmpeg-soc mailing list