]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/avfiltergraph.c
Remove header now made useless
[ffmpeg] / libavfilter / avfiltergraph.c
index c9a30c60d9942e01322fc3d7169f6f045a488589..ce8d2a70e5ffa95c5ddd56447eeb1115bb257263 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Filter graphs
+ * filter graphs
  * copyright (c) 2007 Bobby Bingham
  *
  * This file is part of FFmpeg.
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <string.h>
-#include <stddef.h>
-
-#include "avstring.h"
 #include "avfilter.h"
 #include "avfiltergraph.h"
 
-#include "allfilters.h"
+extern AVFilter avfilter_vf_scale;
+extern AVFilter avfilter_vf_graph;
+extern AVFilter avfilter_vf_graphfile;
+extern AVFilter avfilter_vf_graphdesc;
 
 typedef struct AVFilterGraph {
     unsigned filter_count;
@@ -51,7 +50,7 @@ static int link_init(AVFilterContext *ctx, const char *args, void *opaque)
 /**
  * Given the link between the dummy filter and an internal filter whose input
  * is being exported outside the graph, this returns the externally visible
- * link
+ * link.
  */
 static inline AVFilterLink *get_extern_input_link(AVFilterLink *link)
 {
@@ -69,6 +68,15 @@ static int link_in_request_frame(AVFilterLink *link)
     return avfilter_request_frame(link2);
 }
 
+
+static int link_in_poll_frame(AVFilterLink *link)
+{
+    AVFilterLink *link2 = get_extern_input_link(link);
+    if(!link2)
+        return -1;
+    return avfilter_poll_frame(link2);
+}
+
 static int link_in_config_props(AVFilterLink *link)
 {
     AVFilterLink *link2 = get_extern_input_link(link);
@@ -90,7 +98,7 @@ static int link_in_config_props(AVFilterLink *link)
 /**
  * Given the link between the dummy filter and an internal filter whose input
  * is being exported outside the graph, this returns the externally visible
- * link
+ * link.
  */
 static inline AVFilterLink *get_extern_output_link(AVFilterLink *link)
 {
@@ -151,7 +159,6 @@ static void link_out_draw_slice(AVFilterLink *link, int y, int height)
 static AVFilter vf_graph_dummy =
 {
     .name      = "graph_dummy",
-    .author    = "Bobby Bingham",
 
     .priv_size = sizeof(GraphLinkContext),
 
@@ -236,6 +243,16 @@ static int graph_out_request_frame(AVFilterLink *link)
     return -1;
 }
 
+static int graph_out_poll_frame(AVFilterLink *link)
+{
+    AVFilterLink *link2 = get_intern_output_link(link);
+
+    if(!link2)
+        return -1;
+
+    return avfilter_poll_frame(link2);
+}
+
 static int graph_out_config_props(AVFilterLink *link)
 {
     GraphContext *graph = link->src->priv;
@@ -263,7 +280,7 @@ static int add_graph_input(AVFilterContext *gctx, AVFilterContext *filt, unsigne
     AVFilterPad graph_inpad =
     {
         .name             = name,
-        .type             = AV_PAD_VIDEO,
+        .type             = CODEC_TYPE_VIDEO,
         .start_frame      = graph_in_start_frame,
         .end_frame        = graph_in_end_frame,
         .get_video_buffer = graph_in_get_video_buffer,
@@ -274,8 +291,9 @@ static int add_graph_input(AVFilterContext *gctx, AVFilterContext *filt, unsigne
     AVFilterPad dummy_outpad =
     {
         .name          = NULL,          /* FIXME? */
-        .type          = AV_PAD_VIDEO,
+        .type          = CODEC_TYPE_VIDEO,
         .request_frame = link_in_request_frame,
+        .poll_frame    = link_in_poll_frame,
         .config_props  = link_in_config_props,
     };
 
@@ -294,14 +312,15 @@ static int add_graph_output(AVFilterContext *gctx, AVFilterContext *filt, unsign
     AVFilterPad graph_outpad =
     {
         .name             = name,
-        .type             = AV_PAD_VIDEO,
+        .type             = CODEC_TYPE_VIDEO,
         .request_frame    = graph_out_request_frame,
+        .poll_frame       = graph_out_poll_frame,
         .config_props     = graph_out_config_props,
     };
     AVFilterPad dummy_inpad =
     {
         .name             = NULL,          /* FIXME? */
-        .type             = AV_PAD_VIDEO,
+        .type             = CODEC_TYPE_VIDEO,
         .start_frame      = link_out_start_frame,
         .end_frame        = link_out_end_frame,
         .draw_slice       = link_out_draw_slice,
@@ -464,7 +483,7 @@ int avfilter_graph_config_formats(AVFilterContext *graphctx)
 {
     GraphContext *graph = graphctx->priv;
 
-    /* Find supported formats from sub-filters, and merge along links */
+    /* find supported formats from sub-filters, and merge along links */
     if(query_formats(graphctx))
         return -1;
 
@@ -488,12 +507,14 @@ static int graph_load_from_desc(AVFilterContext *ctx, AVFilterGraphDesc *desc)
     for(curfilt = desc->filters; curfilt; curfilt = curfilt->next) {
         if(!(filterdef = avfilter_get_by_name(curfilt->filter)) ||
            !(filt = avfilter_open(filterdef, curfilt->name))) {
-            av_log(ctx, AV_LOG_ERROR, "error creating filter\n");
+            av_log(ctx, AV_LOG_ERROR,
+               "error creating filter '%s'\n", curfilt->name);
             goto fail;
         }
         avfilter_graph_add_filter(ctx, filt);
         if(avfilter_init_filter(filt, curfilt->args, NULL)) {
-            av_log(ctx, AV_LOG_ERROR, "error initializing filter\n");
+            av_log(ctx, AV_LOG_ERROR,
+                "error initializing filter '%s'\n", curfilt->name);
             goto fail;
         }
     }
@@ -574,7 +595,6 @@ fail:
 AVFilter avfilter_vf_graph =
 {
     .name      = "graph",
-    .author    = "Bobby Bingham",
 
     .priv_size = sizeof(GraphContext),
 
@@ -615,7 +635,6 @@ fail:
 AVFilter avfilter_vf_graphdesc =
 {
     .name      = "graph_desc",
-    .author    = "Bobby Bingham",
 
     .priv_size = sizeof(GraphContext),
 
@@ -646,7 +665,6 @@ static int init_file(AVFilterContext *ctx, const char *args, void *opaque)
 AVFilter avfilter_vf_graphfile =
 {
     .name      = "graph_file",
-    .author    = "Bobby Bingham",
 
     .priv_size = sizeof(GraphContext),