[FFmpeg-devel] [PATCH 2/2] lavfi/mp: switch to ff_filter_frame.

Clément Bœsch ubitux at gmail.com
Sun Dec 2 21:46:30 CET 2012


On Sun, Dec 02, 2012 at 09:38:59PM +0100, Michael Niedermayer wrote:
> On Sun, Dec 02, 2012 at 09:33:59PM +0100, Clément Bœsch wrote:
> > ---
> >  libavfilter/vf_mp.c | 5 +----
> >  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> should be ok if tested
> 

FATE has vf mp=pp, so I trusted it. Though, it was incomplete… New
attached patch should be better.

-- 
Clément B.
-------------- next part --------------
From 91499c9f1161548ba12aae50cf4d8460e97619e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= <ubitux at gmail.com>
Date: Sun, 2 Dec 2012 21:15:48 +0100
Subject: [PATCH] lavfi/mp: switch to ff_filter_frame.

---
 libavfilter/vf_mp.c | 22 +++-------------------
 1 file changed, 3 insertions(+), 19 deletions(-)

diff --git a/libavfilter/vf_mp.c b/libavfilter/vf_mp.c
index c70ab28..81fc401 100644
--- a/libavfilter/vf_mp.c
+++ b/libavfilter/vf_mp.c
@@ -608,10 +608,7 @@ int vf_next_put_image(struct vf_instance *vf,mp_image_t *mpi, double pts){
     if(pts != MP_NOPTS_VALUE)
         picref->pts= pts * av_q2d(outlink->time_base);
 
-    ff_start_frame(outlink, avfilter_ref_buffer(picref, ~0));
-    ff_draw_slice(outlink, 0, picref->video->h, 1);
-    ff_end_frame(outlink);
-    avfilter_unref_buffer(picref);
+    ff_filter_frame(outlink, picref);
     m->frame_returned++;
 
     return 1;
@@ -823,20 +820,9 @@ static int request_frame(AVFilterLink *outlink)
     return ret;
 }
 
-static int start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
-{
-    return 0;
-}
-
-static int null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
-{
-    return 0;
-}
-
-static int end_frame(AVFilterLink *inlink)
+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *inpic)
 {
     MPContext *m = inlink->dst->priv;
-    AVFilterBufferRef *inpic  = inlink->cur_buf;
     int i;
     double pts= MP_NOPTS_VALUE;
     mp_image_t* mpi = new_mp_image(inpic->video->w, inpic->video->h);
@@ -867,9 +853,7 @@ static const AVFilterPad mp_inputs[] = {
     {
         .name         = "default",
         .type         = AVMEDIA_TYPE_VIDEO,
-        .start_frame  = start_frame,
-        .draw_slice   = null_draw_slice,
-        .end_frame    = end_frame,
+        .filter_frame = filter_frame,
         .config_props = config_inprops,
         .min_perms    = AV_PERM_READ,
     },
-- 
1.8.0.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121202/40ba9ff3/attachment.asc>


More information about the ffmpeg-devel mailing list