[FFmpeg-cvslog] vf_fps: switch to filter_frame

Anton Khirnov git at videolan.org
Wed Nov 28 19:35:51 CET 2012


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Wed Nov 28 19:28:41 2012 +0100| [92b57e8dac76ee633a59c4e8d256f1247f13c095] | committer: Michael Niedermayer

vf_fps: switch to filter_frame

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavfilter/vf_fps.c |   26 ++++----------------------
 1 file changed, 4 insertions(+), 22 deletions(-)

diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
index d9eedc8..8e7880c 100644
--- a/libavfilter/vf_fps.c
+++ b/libavfilter/vf_fps.c
@@ -152,9 +152,7 @@ static int request_frame(AVFilterLink *outlink)
             buf->pts = av_rescale_q(s->first_pts, ctx->inputs[0]->time_base,
                                     outlink->time_base) + s->frames_out;
 
-            if ((ret = ff_start_frame(outlink, buf)) < 0 ||
-                (ret = ff_draw_slice(outlink, 0, outlink->h, 1)) < 0 ||
-                (ret = ff_end_frame(outlink)) < 0)
+            if ((ret = ff_filter_frame(outlink, buf)) < 0)
                 return ret;
 
             s->frames_out++;
@@ -179,16 +177,14 @@ static int write_to_fifo(AVFifoBuffer *fifo, AVFilterBufferRef *buf)
     return 0;
 }
 
-static int end_frame(AVFilterLink *inlink)
+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf)
 {
     AVFilterContext    *ctx = inlink->dst;
     FPSContext           *s = ctx->priv;
     AVFilterLink   *outlink = ctx->outputs[0];
-    AVFilterBufferRef  *buf = inlink->cur_buf;
     int64_t delta;
     int i, ret;
 
-    inlink->cur_buf = NULL;
     s->frames_in++;
     /* discard frames until we get the first timestamp */
     if (s->pts == AV_NOPTS_VALUE) {
@@ -259,9 +255,7 @@ static int end_frame(AVFilterLink *inlink)
         buf_out->pts = av_rescale_q(s->first_pts, inlink->time_base,
                                     outlink->time_base) + s->frames_out;
 
-        if ((ret = ff_start_frame(outlink, buf_out)) < 0 ||
-            (ret = ff_draw_slice(outlink, 0, outlink->h, 1)) < 0 ||
-            (ret = ff_end_frame(outlink)) < 0) {
+        if ((ret = ff_filter_frame(outlink, buf_out)) < 0) {
             avfilter_unref_bufferp(&buf);
             return ret;
         }
@@ -276,24 +270,12 @@ static int end_frame(AVFilterLink *inlink)
     return ret;
 }
 
-static int null_start_frame(AVFilterLink *link, AVFilterBufferRef *buf)
-{
-    return 0;
-}
-
-static int null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
-{
-    return 0;
-}
-
 static const AVFilterPad avfilter_vf_fps_inputs[] = {
     {
         .name        = "default",
         .type        = AVMEDIA_TYPE_VIDEO,
         .min_perms   = AV_PERM_READ | AV_PERM_PRESERVE,
-        .start_frame = null_start_frame,
-        .draw_slice  = null_draw_slice,
-        .end_frame   = end_frame,
+        .filter_frame = filter_frame,
     },
     { NULL }
 };



More information about the ffmpeg-cvslog mailing list