[FFmpeg-cvslog] avfilter/vf_amplify: add timeline support

Paul B Mahol git at videolan.org
Thu Nov 21 19:36:22 EET 2019


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Nov 21 18:34:07 2019 +0100| [55ca21d54e400ec5efc7fd28b1bce6096cbaea42] | committer: Paul B Mahol

avfilter/vf_amplify: add timeline support

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

 libavfilter/vf_amplify.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/libavfilter/vf_amplify.c b/libavfilter/vf_amplify.c
index c70c44c0ae..84d9765a4c 100644
--- a/libavfilter/vf_amplify.c
+++ b/libavfilter/vf_amplify.c
@@ -259,14 +259,21 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
         s->frames[s->nb_inputs - 1] = in;
     }
 
-    out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
-    if (!out)
-        return AVERROR(ENOMEM);
-    out->pts = s->frames[0]->pts;
-
-    td.out = out;
-    td.in = s->frames;
-    ctx->internal->execute(ctx, amplify_frame, &td, NULL, FFMIN(s->height[1], ff_filter_get_nb_threads(ctx)));
+    if (!ctx->is_disabled) {
+        out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+        if (!out)
+            return AVERROR(ENOMEM);
+        av_frame_copy_props(out, s->frames[0]);
+
+        td.out = out;
+        td.in = s->frames;
+        ctx->internal->execute(ctx, amplify_frame, &td, NULL, FFMIN(s->height[1], ff_filter_get_nb_threads(ctx)));
+    } else {
+        out = av_frame_clone(s->frames[s->radius]);
+        if (!out)
+            return AVERROR(ENOMEM);
+        out->pts = s->frames[0]->pts;
+    }
 
     return ff_filter_frame(outlink, out);
 }
@@ -316,6 +323,6 @@ AVFilter ff_vf_amplify = {
     .inputs        = inputs,
     .init          = init,
     .uninit        = uninit,
-    .flags         = AVFILTER_FLAG_SLICE_THREADS,
+    .flags         = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | AVFILTER_FLAG_SLICE_THREADS,
     .process_command = ff_filter_process_command,
 };



More information about the ffmpeg-cvslog mailing list