[SCM] libav/experimental: Adjust the default start_frame() and end_frame() implementations to simplify the implementation of simple filters.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:14:21 UTC 2013


The following commit has been merged in the experimental branch:
commit 3628fbe0920484c0d11747e077af7af6a32b3e5b
Author: Vitor Sessak <vitor1001 at gmail.com>
Date:   Fri Feb 15 21:36:13 2008 +0000

    Adjust the default start_frame() and end_frame() implementations to simplify
    the implementation of simple filters.
    
    Commited in SoC by Bobby Bingham on 2007-07-08 16:48:15
    
    Originally committed as revision 11982 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index ae69134..001c729 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -64,13 +64,28 @@ AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms)
 
 void avfilter_default_start_frame(AVFilterLink *link, AVFilterPicRef *picref)
 {
+    AVFilterLink *out = link->dst->outputs[0];
+
     link->cur_pic = picref;
+
+    if(out) {
+        out->outpic  = avfilter_get_video_buffer(out, AV_PERM_WRITE);
+        avfilter_start_frame(out, avfilter_ref_pic(out->outpic, ~0));
+    }
 }
 
 void avfilter_default_end_frame(AVFilterLink *link)
 {
+    AVFilterLink *out = link->dst->outputs[0];
+
     avfilter_unref_pic(link->cur_pic);
     link->cur_pic = NULL;
+
+    if(out) {
+        avfilter_unref_pic(out->outpic);
+        out->outpic = NULL;
+        avfilter_end_frame(out);
+    }
 }
 
 AVFilterPicRef *avfilter_ref_pic(AVFilterPicRef *ref, int pmask)

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list