[FFmpeg-cvslog] lavfi/blend: timeline support

Paul B Mahol git at videolan.org
Tue May 14 19:43:55 CEST 2013


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue May 14 17:41:50 2013 +0000| [b24530019f28fa53528fda695fce50a438668f4b] | committer: Paul B Mahol

lavfi/blend: timeline support

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b24530019f28fa53528fda695fce50a438668f4b
---

 libavfilter/vf_blend.c |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c
index a0022cd..b0987ef 100644
--- a/libavfilter/vf_blend.c
+++ b/libavfilter/vf_blend.c
@@ -412,14 +412,19 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
         top_buf = ff_bufqueue_get(&b->queue_top);
         bottom_buf = ff_bufqueue_get(&b->queue_bottom);
 
-        out_buf = ff_get_video_buffer(outlink, outlink->w, outlink->h);
-        if (!out_buf) {
-            return AVERROR(ENOMEM);
+        if (!ctx->is_disabled) {
+            out_buf = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+            if (!out_buf)
+                return AVERROR(ENOMEM);
+            av_frame_copy_props(out_buf, top_buf);
+            blend_frame(ctx, top_buf, bottom_buf, out_buf);
+        } else {
+            out_buf = av_frame_clone(top_buf);
+            if (!out_buf)
+                return AVERROR(ENOMEM);
         }
-        av_frame_copy_props(out_buf, top_buf);
 
         b->frame_requested = 0;
-        blend_frame(ctx, top_buf, bottom_buf, out_buf);
         ret = ff_filter_frame(outlink, out_buf);
         av_frame_free(&top_buf);
         av_frame_free(&bottom_buf);
@@ -460,4 +465,5 @@ AVFilter avfilter_vf_blend = {
     .inputs        = blend_inputs,
     .outputs       = blend_outputs,
     .priv_class    = &blend_class,
+    .flags         = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
 };



More information about the ffmpeg-cvslog mailing list