Browse code

Add the null video filter.

Originally committed as revision 20275 to svn://svn.ffmpeg.org/ffmpeg/trunk

Stefano Sabatini authored on 2009/10/18 18:44:33
Showing 4 changed files
... ...
@@ -78,4 +78,8 @@ build.
78 78
 
79 79
 Below is a description of the currently available video filters.
80 80
 
81
+@section null
82
+
83
+Pass the source unchanged to the output.
84
+
81 85
 @bye
... ...
@@ -11,6 +11,6 @@ OBJS = allfilters.o                                                     \
11 11
        defaults.o                                                       \
12 12
        formats.o                                                        \
13 13
 
14
-#OBJS-$(CONFIG_XXX_FILTER)    += vf_xxx.o
14
+OBJS-$(CONFIG_NULL_FILTER)    += vf_null.o
15 15
 
16 16
 include $(SUBDIR)../subdir.mak
... ...
@@ -34,6 +34,5 @@ void avfilter_register_all(void)
34 34
         return;
35 35
     initialized = 1;
36 36
 
37
-//    REGISTER_FILTER (CROP,crop,vf);
38
-
37
+    REGISTER_FILTER (NULL,null,vf);
39 38
 }
40 39
new file mode 100644
... ...
@@ -0,0 +1,56 @@
0
+/*
1
+ * This file is part of FFmpeg.
2
+ *
3
+ * FFmpeg is free software; you can redistribute it and/or
4
+ * modify it under the terms of the GNU Lesser General Public
5
+ * License as published by the Free Software Foundation; either
6
+ * version 2.1 of the License, or (at your option) any later version.
7
+ *
8
+ * FFmpeg is distributed in the hope that it will be useful,
9
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11
+ * Lesser General Public License for more details.
12
+ *
13
+ * You should have received a copy of the GNU Lesser General Public
14
+ * License along with FFmpeg; if not, write to the Free Software
15
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+ */
17
+
18
+/**
19
+ * @file libavfilter/vf_null.c
20
+ * null filter
21
+ */
22
+
23
+#include "avfilter.h"
24
+
25
+static AVFilterPicRef *get_video_buffer(AVFilterLink *link, int perms, int w, int h)
26
+{
27
+    return avfilter_get_video_buffer(link->dst->outputs[0], perms, w, h);
28
+}
29
+
30
+static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
31
+{
32
+    avfilter_start_frame(link->dst->outputs[0], picref);
33
+}
34
+
35
+static void end_frame(AVFilterLink *link)
36
+{
37
+    avfilter_end_frame(link->dst->outputs[0]);
38
+}
39
+
40
+AVFilter avfilter_vf_null = {
41
+    .name      = "null",
42
+
43
+    .priv_size = 0,
44
+
45
+    .inputs    = (AVFilterPad[]) {{ .name             = "default",
46
+                                    .type             = CODEC_TYPE_VIDEO,
47
+                                    .get_video_buffer = get_video_buffer,
48
+                                    .start_frame      = start_frame,
49
+                                    .end_frame        = end_frame },
50
+                                  { .name = NULL}},
51
+
52
+    .outputs   = (AVFilterPad[]) {{ .name             = "default",
53
+                                    .type             = CODEC_TYPE_VIDEO, },
54
+                                  { .name = NULL}},
55
+};