[FFmpeg-soc] [soc]: r4191 - in libavfilter: Makefile allfilters.c vf_null.c

stefano subversion at mplayerhq.hu
Mon Apr 6 21:34:24 CEST 2009


Author: stefano
Date: Mon Apr  6 21:34:24 2009
New Revision: 4191

Log:
Implement a null filter. It is pedagogically useful.

Added:
   libavfilter/vf_null.c
Modified:
   libavfilter/Makefile
   libavfilter/allfilters.c

Modified: libavfilter/Makefile
==============================================================================
--- libavfilter/Makefile	Mon Apr  6 21:23:41 2009	(r4190)
+++ libavfilter/Makefile	Mon Apr  6 21:34:24 2009	(r4191)
@@ -20,6 +20,7 @@ OBJS-$(CONFIG_HFLIP_FILTER)      += vf_h
 OBJS-$(CONFIG_NEGATE_FILTER)     += vf_negate.o
 OBJS-$(CONFIG_FIFO_FILTER)       += vf_fifo.o
 OBJS-$(CONFIG_FORMAT_FILTER)     += vf_format.o
+OBJS-$(CONFIG_NULL_FILTER)       += vf_null.o
 OBJS-$(CONFIG_OVERLAY_FILTER)    += vf_overlay.o
 OBJS-$(CONFIG_ROTATE_FILTER)     += vf_rotate.o
 OBJS-$(CONFIG_SCALE_FILTER)      += vf_scale.o

Modified: libavfilter/allfilters.c
==============================================================================
--- libavfilter/allfilters.c	Mon Apr  6 21:23:41 2009	(r4190)
+++ libavfilter/allfilters.c	Mon Apr  6 21:34:24 2009	(r4191)
@@ -42,6 +42,7 @@ void avfilter_register_all(void)
     REGISTER_FILTER(HFLIP,hflip,vf);
     REGISTER_FILTER(NEGATE,negate,vf);
     REGISTER_FILTER(NOFORMAT,noformat,vf);
+    REGISTER_FILTER(NULL,null,vf);
     REGISTER_FILTER(OVERLAY,overlay,vf);
     REGISTER_FILTER(ROTATE,rotate,vf);
     REGISTER_FILTER(SCALE,scale,vf);

Added: libavfilter/vf_null.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ libavfilter/vf_null.c	Mon Apr  6 21:34:24 2009	(r4191)
@@ -0,0 +1,52 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file libavfilter/vf_null.c
+ * null filter
+ */
+
+#include <stdio.h>
+#include "avfilter.h"
+
+static void start_frame(AVFilterLink *in_link, AVFilterPicRef *picref)
+{
+    avfilter_start_frame(in_link->dst->outputs[0], picref);
+}
+
+static void end_frame(AVFilterLink *in_link)
+{
+    avfilter_end_frame(in_link->dst->outputs[0]);
+}
+
+AVFilter avfilter_vf_null =
+{
+    .name      = "null",
+
+    .priv_size = 0,
+
+    .inputs    = (AVFilterPad[]) {{ .name            = "default",
+                                    .type            = CODEC_TYPE_VIDEO,
+                                    .start_frame     = start_frame,
+                                    .end_frame       = end_frame },
+                                  { .name = NULL}},
+
+    .outputs   = (AVFilterPad[]) {{ .name            = "default",
+                                    .type            = CODEC_TYPE_VIDEO, },
+                                  { .name = NULL}},
+};


More information about the FFmpeg-soc mailing list