[FFmpeg-devel] [PATCH 1/2] lavfi: use a new field for automatic buffer copy.

Michael Niedermayer michaelni at gmx.at
Mon Jul 30 03:03:49 CEST 2012


On Sun, Jul 29, 2012 at 07:29:50PM +0200, Nicolas George wrote:
> The code currently use cur_buf as the target of the copy,
> but cur_buf can be cleared by the filter if it has given
> the reference away or stored it elsewhere as soon as start_frame.
> 
> The code still relies on the fact that the reference is not
> destroyed until end_frame. All filters currently follow that condition.
> An av_assert1() is added to check it; it should at least cause
> very visible errors in valgrind.
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  libavfilter/avfilter.h |    9 +++++++++
>  libavfilter/video.c    |   20 ++++++++++++++++----
>  2 files changed, 25 insertions(+), 4 deletions(-)
> 
> diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
> index 91820dd..d256eeb 100644
> --- a/libavfilter/avfilter.h
> +++ b/libavfilter/avfilter.h
> @@ -669,6 +669,15 @@ struct AVFilterLink {
>       * called with more samples, it will split them.
>       */
>      int max_samples;
> +
> +    /**
> +     * The buffer reference currently being received across the link by the
> +     * destination filter. This is used internally by the filter system to
> +     * allow automatic copying of buffers which do not have sufficient
> +     * permissions for the destination. This should not be accessed directly
> +     * by the filters.
> +     */
> +    AVFilterBufferRef *dst_buf;

i think the name cur_buf_nofree or cur_buf_copy or something similar
is clearer

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

He who knows, does not speak. He who speaks, does not know. -- Lao Tsu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120730/c72692a6/attachment.asc>


More information about the ffmpeg-devel mailing list