[FFmpeg-soc] [soc]: r684 - in libavfilter: avfilter.c avfilter.h avfiltergraph.c vsrc_dummy.c vsrc_ppm.c

koorogi subversion at mplayerhq.hu
Sat Aug 11 19:42:36 CEST 2007


Author: koorogi
Date: Sat Aug 11 19:42:36 2007
New Revision: 684

Log:
Let request_frame() indicate success or failure


Modified:
   libavfilter/avfilter.c
   libavfilter/avfilter.h
   libavfilter/avfiltergraph.c
   libavfilter/vsrc_dummy.c
   libavfilter/vsrc_ppm.c

Modified: libavfilter/avfilter.c
==============================================================================
--- libavfilter/avfilter.c	(original)
+++ libavfilter/avfilter.c	Sat Aug 11 19:42:36 2007
@@ -144,14 +144,15 @@ AVFilterPicRef *avfilter_get_video_buffe
     return ret;
 }
 
-void avfilter_request_frame(AVFilterLink *link)
+int avfilter_request_frame(AVFilterLink *link)
 {
     const AVFilterPad *pad = &link->src->output_pads[link->srcpad];
 
     if(pad->request_frame)
-        pad->request_frame(link);
+        return pad->request_frame(link);
     else if(link->src->inputs[0])
-        avfilter_request_frame(link->src->inputs[0]);
+        return avfilter_request_frame(link->src->inputs[0]);
+    else return -1;
 }
 
 /* XXX: should we do the duplicating of the picture ref here, instead of

Modified: libavfilter/avfilter.h
==============================================================================
--- libavfilter/avfilter.h	(original)
+++ libavfilter/avfilter.h	Sat Aug 11 19:42:36 2007
@@ -139,7 +139,7 @@ struct AVFilterPad
      * Frame request callback.  A call to this should result in at least one
      * frame being output over the given link.  Video output pads only.
      */
-    void (*request_frame)(AVFilterLink *link);
+    int (*request_frame)(AVFilterLink *link);
 
     /**
      * Link configuration callback.  For output pads, this should set the link
@@ -224,7 +224,7 @@ int avfilter_link(AVFilterContext *src, 
 int avfilter_config_link(AVFilterLink *link);
 
 AVFilterPicRef *avfilter_get_video_buffer(AVFilterLink *link, int perms);
-void avfilter_request_frame(AVFilterLink *link);
+int  avfilter_request_frame(AVFilterLink *link);
 void avfilter_start_frame(AVFilterLink *link, AVFilterPicRef *picref);
 void avfilter_end_frame(AVFilterLink *link);
 void avfilter_draw_slice(AVFilterLink *link, uint8_t *data[4], int y, int h);

Modified: libavfilter/avfiltergraph.c
==============================================================================
--- libavfilter/avfiltergraph.c	(original)
+++ libavfilter/avfiltergraph.c	Sat Aug 11 19:42:36 2007
@@ -70,13 +70,13 @@ static int *link_in_query_formats(AVFilt
 }
 
 /** request a frame from a filter providing input to the graph */
-static void link_in_request_frame(AVFilterLink *link)
+static int link_in_request_frame(AVFilterLink *link)
 {
     AVFilterLink *link2 = get_extern_input_link(link);
 
     if(!link2)
-        return;
-    avfilter_request_frame(link2);
+        return -1;
+    return avfilter_request_frame(link2);
 }
 
 static int link_in_config_props(AVFilterLink *link)
@@ -265,12 +265,13 @@ static int *graph_out_query_formats(AVFi
     return link2->src->output_pads[link2->srcpad].query_formats(link2);
 }
 
-static void graph_out_request_frame(AVFilterLink *link)
+static int graph_out_request_frame(AVFilterLink *link)
 {
     AVFilterLink *link2 = get_intern_output_link(link);
 
     if(link2)
-        avfilter_request_frame(link2);
+        return avfilter_request_frame(link2);
+    return -1;
 }
 
 static int graph_out_config_props(AVFilterLink *link)

Modified: libavfilter/vsrc_dummy.c
==============================================================================
--- libavfilter/vsrc_dummy.c	(original)
+++ libavfilter/vsrc_dummy.c	Sat Aug 11 19:42:36 2007
@@ -44,7 +44,7 @@ static int config_props(AVFilterLink *li
     return 0;
 }
 
-static void request_frame(AVFilterLink *link)
+static int request_frame(AVFilterLink *link)
 {
     DummyContext *ctx = link->src->priv;
     AVFilterPicRef *pic;
@@ -72,6 +72,8 @@ static void request_frame(AVFilterLink *
 
     avfilter_end_frame(link);
     avfilter_unref_pic(pic);
+
+    return 0;
 }
 
 AVFilter vsrc_dummy =

Modified: libavfilter/vsrc_ppm.c
==============================================================================
--- libavfilter/vsrc_ppm.c	(original)
+++ libavfilter/vsrc_ppm.c	Sat Aug 11 19:42:36 2007
@@ -65,7 +65,7 @@ static int config_props(AVFilterLink *li
     return 0;
 }
 
-static void request_frame(AVFilterLink *link)
+static int request_frame(AVFilterLink *link)
 {
     PPMContext *ppm = link->src->priv;
     AVFilterPicRef *out;
@@ -91,6 +91,8 @@ static void request_frame(AVFilterLink *
     avfilter_start_frame(link, out);
     avfilter_draw_slice(link, out->data, 0, out->h);
     avfilter_end_frame(link);
+
+    return 0;
 }
 
 static void uninit(AVFilterContext *ctx)



More information about the FFmpeg-soc mailing list