Browse code

lavfi: remove avfilter_null_* from public API on next bump.

Those functions are only useful inside filters. It is better to not
support user filters until the API is more stable.

Anton Khirnov authored on 2012/05/19 17:37:56
Showing 21 changed files
... ...
@@ -487,18 +487,24 @@ int avfilter_default_query_formats(AVFilterContext *ctx);
487 487
  */
488 488
 void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats);
489 489
 
490
+#if FF_API_FILTERS_PUBLIC
490 491
 /** start_frame() handler for filters which simply pass video along */
492
+attribute_deprecated
491 493
 void avfilter_null_start_frame(AVFilterLink *link, AVFilterBufferRef *picref);
492 494
 
493 495
 /** draw_slice() handler for filters which simply pass video along */
496
+attribute_deprecated
494 497
 void avfilter_null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir);
495 498
 
496 499
 /** end_frame() handler for filters which simply pass video along */
500
+attribute_deprecated
497 501
 void avfilter_null_end_frame(AVFilterLink *link);
498 502
 
499 503
 /** get_video_buffer() handler for filters which simply pass video along */
504
+attribute_deprecated
500 505
 AVFilterBufferRef *avfilter_null_get_video_buffer(AVFilterLink *link,
501 506
                                                   int perms, int w, int h);
507
+#endif
502 508
 
503 509
 /**
504 510
  * Filter definition. This defines the pads a filter contains, and all the
... ...
@@ -25,6 +25,7 @@
25 25
 
26 26
 #include "avfilter.h"
27 27
 #include "audio.h"
28
+#include "video.h"
28 29
 
29 30
 static int split_init(AVFilterContext *ctx, const char *args, void *opaque)
30 31
 {
... ...
@@ -100,7 +101,7 @@ AVFilter avfilter_vf_split = {
100 100
 
101 101
     .inputs    = (AVFilterPad[]) {{ .name            = "default",
102 102
                                     .type            = AVMEDIA_TYPE_VIDEO,
103
-                                    .get_video_buffer= avfilter_null_get_video_buffer,
103
+                                    .get_video_buffer= ff_null_get_video_buffer,
104 104
                                     .start_frame     = start_frame,
105 105
                                     .draw_slice      = draw_slice,
106 106
                                     .end_frame       = end_frame, },
... ...
@@ -25,6 +25,7 @@
25 25
 
26 26
 #include "libavutil/mathematics.h"
27 27
 #include "avfilter.h"
28
+#include "video.h"
28 29
 
29 30
 typedef struct {
30 31
     AVRational aspect;
... ...
@@ -100,9 +101,9 @@ AVFilter avfilter_vf_setdar = {
100 100
     .inputs    = (AVFilterPad[]) {{ .name             = "default",
101 101
                                     .type             = AVMEDIA_TYPE_VIDEO,
102 102
                                     .config_props     = setdar_config_props,
103
-                                    .get_video_buffer = avfilter_null_get_video_buffer,
103
+                                    .get_video_buffer = ff_null_get_video_buffer,
104 104
                                     .start_frame      = start_frame,
105
-                                    .end_frame        = avfilter_null_end_frame },
105
+                                    .end_frame        = ff_null_end_frame },
106 106
                                   { .name = NULL}},
107 107
 
108 108
     .outputs   = (AVFilterPad[]) {{ .name             = "default",
... ...
@@ -133,9 +134,9 @@ AVFilter avfilter_vf_setsar = {
133 133
     .inputs    = (AVFilterPad[]) {{ .name             = "default",
134 134
                                     .type             = AVMEDIA_TYPE_VIDEO,
135 135
                                     .config_props     = setsar_config_props,
136
-                                    .get_video_buffer = avfilter_null_get_video_buffer,
136
+                                    .get_video_buffer = ff_null_get_video_buffer,
137 137
                                     .start_frame      = start_frame,
138
-                                    .end_frame        = avfilter_null_end_frame },
138
+                                    .end_frame        = ff_null_end_frame },
139 139
                                   { .name = NULL}},
140 140
 
141 141
     .outputs   = (AVFilterPad[]) {{ .name             = "default",
... ...
@@ -28,6 +28,7 @@
28 28
  */
29 29
 
30 30
 #include "avfilter.h"
31
+#include "video.h"
31 32
 
32 33
 typedef struct {
33 34
     unsigned int bamount; ///< black amount
... ...
@@ -118,8 +119,8 @@ AVFilter avfilter_vf_blackframe = {
118 118
     .inputs    = (AVFilterPad[]) {{ .name = "default",
119 119
                                     .type             = AVMEDIA_TYPE_VIDEO,
120 120
                                     .draw_slice       = draw_slice,
121
-                                    .get_video_buffer = avfilter_null_get_video_buffer,
122
-                                    .start_frame      = avfilter_null_start_frame,
121
+                                    .get_video_buffer = ff_null_get_video_buffer,
122
+                                    .start_frame      = ff_null_start_frame,
123 123
                                     .end_frame        = end_frame, },
124 124
                                   { .name = NULL}},
125 125
 
... ...
@@ -22,6 +22,7 @@
22 22
  */
23 23
 
24 24
 #include "avfilter.h"
25
+#include "video.h"
25 26
 
26 27
 AVFilter avfilter_vf_copy = {
27 28
     .name      = "copy",
... ...
@@ -29,9 +30,9 @@ AVFilter avfilter_vf_copy = {
29 29
 
30 30
     .inputs    = (AVFilterPad[]) {{ .name             = "default",
31 31
                                     .type             = AVMEDIA_TYPE_VIDEO,
32
-                                    .get_video_buffer = avfilter_null_get_video_buffer,
33
-                                    .start_frame      = avfilter_null_start_frame,
34
-                                    .end_frame        = avfilter_null_end_frame,
32
+                                    .get_video_buffer = ff_null_get_video_buffer,
33
+                                    .start_frame      = ff_null_start_frame,
34
+                                    .end_frame        = ff_null_end_frame,
35 35
                                     .rej_perms        = ~0 },
36 36
                                   { .name = NULL}},
37 37
     .outputs   = (AVFilterPad[]) {{ .name             = "default",
... ...
@@ -26,6 +26,7 @@
26 26
 /* #define DEBUG */
27 27
 
28 28
 #include "avfilter.h"
29
+#include "video.h"
29 30
 #include "libavutil/eval.h"
30 31
 #include "libavutil/avstring.h"
31 32
 #include "libavutil/libm.h"
... ...
@@ -333,7 +334,7 @@ AVFilter avfilter_vf_crop = {
333 333
                                     .start_frame      = start_frame,
334 334
                                     .draw_slice       = draw_slice,
335 335
                                     .end_frame        = end_frame,
336
-                                    .get_video_buffer = avfilter_null_get_video_buffer,
336
+                                    .get_video_buffer = ff_null_get_video_buffer,
337 337
                                     .config_props     = config_input, },
338 338
                                   { .name = NULL}},
339 339
     .outputs   = (AVFilterPad[]) {{ .name             = "default",
... ...
@@ -25,6 +25,7 @@
25 25
 
26 26
 #include "libavutil/imgutils.h"
27 27
 #include "avfilter.h"
28
+#include "video.h"
28 29
 
29 30
 typedef struct {
30 31
     int x1, y1, x2, y2;
... ...
@@ -203,8 +204,8 @@ AVFilter avfilter_vf_cropdetect = {
203 203
     .inputs    = (AVFilterPad[]) {{ .name = "default",
204 204
                                     .type             = AVMEDIA_TYPE_VIDEO,
205 205
                                     .config_props     = config_input,
206
-                                    .get_video_buffer = avfilter_null_get_video_buffer,
207
-                                    .start_frame      = avfilter_null_start_frame,
206
+                                    .get_video_buffer = ff_null_get_video_buffer,
207
+                                    .start_frame      = ff_null_start_frame,
208 208
                                     .end_frame        = end_frame, },
209 209
                                   { .name = NULL}},
210 210
 
... ...
@@ -29,6 +29,7 @@
29 29
 #include "libavutil/opt.h"
30 30
 #include "libavutil/pixdesc.h"
31 31
 #include "avfilter.h"
32
+#include "video.h"
32 33
 
33 34
 /**
34 35
  * Apply a simple delogo algorithm to the image in dst and put the
... ...
@@ -271,7 +272,7 @@ AVFilter avfilter_vf_delogo = {
271 271
 
272 272
     .inputs    = (AVFilterPad[]) {{ .name             = "default",
273 273
                                     .type             = AVMEDIA_TYPE_VIDEO,
274
-                                    .get_video_buffer = avfilter_null_get_video_buffer,
274
+                                    .get_video_buffer = ff_null_get_video_buffer,
275 275
                                     .start_frame      = start_frame,
276 276
                                     .draw_slice       = null_draw_slice,
277 277
                                     .end_frame        = end_frame,
... ...
@@ -28,6 +28,7 @@
28 28
 #include "libavutil/pixdesc.h"
29 29
 #include "libavutil/parseutils.h"
30 30
 #include "avfilter.h"
31
+#include "video.h"
31 32
 
32 33
 enum { Y, U, V, A };
33 34
 
... ...
@@ -130,10 +131,10 @@ AVFilter avfilter_vf_drawbox = {
130 130
     .inputs    = (AVFilterPad[]) {{ .name             = "default",
131 131
                                     .type             = AVMEDIA_TYPE_VIDEO,
132 132
                                     .config_props     = config_input,
133
-                                    .get_video_buffer = avfilter_null_get_video_buffer,
134
-                                    .start_frame      = avfilter_null_start_frame,
133
+                                    .get_video_buffer = ff_null_get_video_buffer,
134
+                                    .start_frame      = ff_null_start_frame,
135 135
                                     .draw_slice       = draw_slice,
136
-                                    .end_frame        = avfilter_null_end_frame,
136
+                                    .end_frame        = ff_null_end_frame,
137 137
                                     .min_perms        = AV_PERM_WRITE | AV_PERM_READ,
138 138
                                     .rej_perms        = AV_PERM_PRESERVE },
139 139
                                   { .name = NULL}},
... ...
@@ -41,6 +41,7 @@
41 41
 #include "libavutil/lfg.h"
42 42
 #include "avfilter.h"
43 43
 #include "drawutils.h"
44
+#include "video.h"
44 45
 
45 46
 #undef time
46 47
 
... ...
@@ -875,7 +876,7 @@ AVFilter avfilter_vf_drawtext = {
875 875
 
876 876
     .inputs    = (AVFilterPad[]) {{ .name             = "default",
877 877
                                     .type             = AVMEDIA_TYPE_VIDEO,
878
-                                    .get_video_buffer = avfilter_null_get_video_buffer,
878
+                                    .get_video_buffer = ff_null_get_video_buffer,
879 879
                                     .start_frame      = start_frame,
880 880
                                     .draw_slice       = null_draw_slice,
881 881
                                     .end_frame        = end_frame,
... ...
@@ -27,6 +27,7 @@
27 27
 
28 28
 #include "libavutil/pixdesc.h"
29 29
 #include "avfilter.h"
30
+#include "video.h"
30 31
 
31 32
 typedef struct {
32 33
     int factor, fade_per_frame;
... ...
@@ -157,8 +158,8 @@ AVFilter avfilter_vf_fade = {
157 157
     .inputs    = (AVFilterPad[]) {{ .name            = "default",
158 158
                                     .type            = AVMEDIA_TYPE_VIDEO,
159 159
                                     .config_props    = config_props,
160
-                                    .get_video_buffer = avfilter_null_get_video_buffer,
161
-                                    .start_frame      = avfilter_null_start_frame,
160
+                                    .get_video_buffer = ff_null_get_video_buffer,
161
+                                    .start_frame      = ff_null_start_frame,
162 162
                                     .draw_slice      = draw_slice,
163 163
                                     .end_frame       = end_frame,
164 164
                                     .min_perms       = AV_PERM_READ | AV_PERM_WRITE,
... ...
@@ -24,6 +24,7 @@
24 24
  */
25 25
 
26 26
 #include "avfilter.h"
27
+#include "video.h"
27 28
 
28 29
 typedef struct BufPic {
29 30
     AVFilterBufferRef *picref;
... ...
@@ -106,7 +107,7 @@ AVFilter avfilter_vf_fifo = {
106 106
 
107 107
     .inputs    = (AVFilterPad[]) {{ .name            = "default",
108 108
                                     .type            = AVMEDIA_TYPE_VIDEO,
109
-                                    .get_video_buffer= avfilter_null_get_video_buffer,
109
+                                    .get_video_buffer= ff_null_get_video_buffer,
110 110
                                     .start_frame     = start_frame,
111 111
                                     .draw_slice      = draw_slice,
112 112
                                     .end_frame       = end_frame,
... ...
@@ -25,6 +25,7 @@
25 25
 
26 26
 #include "libavutil/pixdesc.h"
27 27
 #include "avfilter.h"
28
+#include "video.h"
28 29
 
29 30
 typedef struct {
30 31
     /**
... ...
@@ -104,10 +105,10 @@ AVFilter avfilter_vf_format = {
104 104
 
105 105
     .inputs    = (AVFilterPad[]) {{ .name            = "default",
106 106
                                     .type            = AVMEDIA_TYPE_VIDEO,
107
-                                    .get_video_buffer= avfilter_null_get_video_buffer,
108
-                                    .start_frame     = avfilter_null_start_frame,
109
-                                    .draw_slice      = avfilter_null_draw_slice,
110
-                                    .end_frame       = avfilter_null_end_frame, },
107
+                                    .get_video_buffer= ff_null_get_video_buffer,
108
+                                    .start_frame     = ff_null_start_frame,
109
+                                    .draw_slice      = ff_null_draw_slice,
110
+                                    .end_frame       = ff_null_end_frame, },
111 111
                                   { .name = NULL}},
112 112
     .outputs   = (AVFilterPad[]) {{ .name            = "default",
113 113
                                     .type            = AVMEDIA_TYPE_VIDEO },
... ...
@@ -134,10 +135,10 @@ AVFilter avfilter_vf_noformat = {
134 134
 
135 135
     .inputs    = (AVFilterPad[]) {{ .name            = "default",
136 136
                                     .type            = AVMEDIA_TYPE_VIDEO,
137
-                                    .get_video_buffer= avfilter_null_get_video_buffer,
138
-                                    .start_frame     = avfilter_null_start_frame,
139
-                                    .draw_slice      = avfilter_null_draw_slice,
140
-                                    .end_frame       = avfilter_null_end_frame, },
137
+                                    .get_video_buffer= ff_null_get_video_buffer,
138
+                                    .start_frame     = ff_null_start_frame,
139
+                                    .draw_slice      = ff_null_draw_slice,
140
+                                    .end_frame       = ff_null_end_frame, },
141 141
                                   { .name = NULL}},
142 142
     .outputs   = (AVFilterPad[]) {{ .name            = "default",
143 143
                                     .type            = AVMEDIA_TYPE_VIDEO },
... ...
@@ -22,6 +22,7 @@
22 22
  */
23 23
 
24 24
 #include "avfilter.h"
25
+#include "video.h"
25 26
 
26 27
 AVFilter avfilter_vf_null = {
27 28
     .name      = "null",
... ...
@@ -31,9 +32,9 @@ AVFilter avfilter_vf_null = {
31 31
 
32 32
     .inputs    = (AVFilterPad[]) {{ .name             = "default",
33 33
                                     .type             = AVMEDIA_TYPE_VIDEO,
34
-                                    .get_video_buffer = avfilter_null_get_video_buffer,
35
-                                    .start_frame      = avfilter_null_start_frame,
36
-                                    .end_frame        = avfilter_null_end_frame },
34
+                                    .get_video_buffer = ff_null_get_video_buffer,
35
+                                    .start_frame      = ff_null_start_frame,
36
+                                    .end_frame        = ff_null_end_frame },
37 37
                                   { .name = NULL}},
38 38
 
39 39
     .outputs   = (AVFilterPad[]) {{ .name             = "default",
... ...
@@ -27,6 +27,7 @@
27 27
 #include "libavutil/fifo.h"
28 28
 #include "libavutil/mathematics.h"
29 29
 #include "avfilter.h"
30
+#include "video.h"
30 31
 
31 32
 static const char *const var_names[] = {
32 33
     "E",                 ///< Euler number
... ...
@@ -339,7 +340,7 @@ AVFilter avfilter_vf_select = {
339 339
 
340 340
     .inputs    = (AVFilterPad[]) {{ .name             = "default",
341 341
                                     .type             = AVMEDIA_TYPE_VIDEO,
342
-                                    .get_video_buffer = avfilter_null_get_video_buffer,
342
+                                    .get_video_buffer = ff_null_get_video_buffer,
343 343
                                     .config_props     = config_input,
344 344
                                     .start_frame      = start_frame,
345 345
                                     .draw_slice       = draw_slice,
... ...
@@ -29,6 +29,7 @@
29 29
 #include "libavutil/eval.h"
30 30
 #include "libavutil/mathematics.h"
31 31
 #include "avfilter.h"
32
+#include "video.h"
32 33
 
33 34
 static const char *const var_names[] = {
34 35
     "E",           ///< Euler number
... ...
@@ -148,7 +149,7 @@ AVFilter avfilter_vf_setpts = {
148 148
 
149 149
     .inputs    = (AVFilterPad[]) {{ .name             = "default",
150 150
                                     .type             = AVMEDIA_TYPE_VIDEO,
151
-                                    .get_video_buffer = avfilter_null_get_video_buffer,
151
+                                    .get_video_buffer = ff_null_get_video_buffer,
152 152
                                     .config_props     = config_input,
153 153
                                     .start_frame      = start_frame, },
154 154
                                   { .name = NULL }},
... ...
@@ -29,6 +29,7 @@
29 29
 #include "libavutil/rational.h"
30 30
 #include "avfilter.h"
31 31
 #include "internal.h"
32
+#include "video.h"
32 33
 
33 34
 static const char *const var_names[] = {
34 35
     "E",
... ...
@@ -130,9 +131,9 @@ AVFilter avfilter_vf_settb = {
130 130
 
131 131
     .inputs    = (AVFilterPad[]) {{ .name             = "default",
132 132
                                     .type             = AVMEDIA_TYPE_VIDEO,
133
-                                    .get_video_buffer = avfilter_null_get_video_buffer,
133
+                                    .get_video_buffer = ff_null_get_video_buffer,
134 134
                                     .start_frame      = start_frame,
135
-                                    .end_frame        = avfilter_null_end_frame },
135
+                                    .end_frame        = ff_null_end_frame },
136 136
                                   { .name = NULL }},
137 137
 
138 138
     .outputs   = (AVFilterPad[]) {{ .name            = "default",
... ...
@@ -26,6 +26,7 @@
26 26
 #include "libavutil/imgutils.h"
27 27
 #include "libavutil/pixdesc.h"
28 28
 #include "avfilter.h"
29
+#include "video.h"
29 30
 
30 31
 typedef struct {
31 32
     unsigned int frame;
... ...
@@ -86,8 +87,8 @@ AVFilter avfilter_vf_showinfo = {
86 86
 
87 87
     .inputs    = (AVFilterPad[]) {{ .name = "default",
88 88
                                     .type             = AVMEDIA_TYPE_VIDEO,
89
-                                    .get_video_buffer = avfilter_null_get_video_buffer,
90
-                                    .start_frame      = avfilter_null_start_frame,
89
+                                    .get_video_buffer = ff_null_get_video_buffer,
90
+                                    .start_frame      = ff_null_start_frame,
91 91
                                     .end_frame        = end_frame,
92 92
                                     .min_perms        = AV_PERM_READ, },
93 93
                                   { .name = NULL}},
... ...
@@ -24,6 +24,7 @@
24 24
  */
25 25
 
26 26
 #include "avfilter.h"
27
+#include "video.h"
27 28
 #include "libavutil/pixdesc.h"
28 29
 
29 30
 typedef struct {
... ...
@@ -105,11 +106,11 @@ AVFilter avfilter_vf_slicify = {
105 105
 
106 106
     .inputs    = (AVFilterPad[]) {{ .name             = "default",
107 107
                                     .type             = AVMEDIA_TYPE_VIDEO,
108
-                                    .get_video_buffer = avfilter_null_get_video_buffer,
108
+                                    .get_video_buffer = ff_null_get_video_buffer,
109 109
                                     .start_frame      = start_frame,
110 110
                                     .draw_slice       = draw_slice,
111 111
                                     .config_props     = config_props,
112
-                                    .end_frame        = avfilter_null_end_frame, },
112
+                                    .end_frame        = ff_null_end_frame, },
113 113
                                   { .name = NULL}},
114 114
     .outputs   = (AVFilterPad[]) {{ .name            = "default",
115 115
                                     .type            = AVMEDIA_TYPE_VIDEO, },
... ...
@@ -65,7 +65,7 @@ static void ff_dlog_ref(void *ctx, AVFilterBufferRef *ref, int end)
65 65
     av_dlog(ctx, "]%s", end ? "\n" : "");
66 66
 }
67 67
 
68
-AVFilterBufferRef *avfilter_null_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
68
+AVFilterBufferRef *ff_null_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
69 69
 {
70 70
     return avfilter_get_video_buffer(link->dst->outputs[0], perms, w, h);
71 71
 }
... ...
@@ -160,7 +160,7 @@ AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int
160 160
     return ret;
161 161
 }
162 162
 
163
-void avfilter_null_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
163
+void ff_null_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
164 164
 {
165 165
     avfilter_start_frame(link->dst->outputs[0], picref);
166 166
 }
... ...
@@ -211,7 +211,7 @@ void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
211 211
     start_frame(link, link->cur_buf);
212 212
 }
213 213
 
214
-void avfilter_null_end_frame(AVFilterLink *link)
214
+void ff_null_end_frame(AVFilterLink *link)
215 215
 {
216 216
     avfilter_end_frame(link->dst->outputs[0]);
217 217
 }
... ...
@@ -252,7 +252,7 @@ void avfilter_end_frame(AVFilterLink *link)
252 252
     }
253 253
 }
254 254
 
255
-void avfilter_null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
255
+void ff_null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
256 256
 {
257 257
     avfilter_draw_slice(link->dst->outputs[0], y, h, slice_dir);
258 258
 }
... ...
@@ -326,4 +326,20 @@ void avfilter_default_draw_slice(AVFilterLink *inlink, int y, int h, int slice_d
326 326
 {
327 327
     default_draw_slice(inlink, y, h, slice_dir);
328 328
 }
329
+AVFilterBufferRef *avfilter_null_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
330
+{
331
+    return ff_null_get_video_buffer(link, perms, w, h);
332
+}
333
+void avfilter_null_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
334
+{
335
+    ff_null_start_frame(link, picref);
336
+}
337
+void avfilter_null_end_frame(AVFilterLink *link)
338
+{
339
+    ff_null_end_frame(link);
340
+}
341
+void avfilter_null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
342
+{
343
+    ff_null_draw_slice(link, y, h, slice_dir);
344
+}
329 345
 #endif
... ...
@@ -21,4 +21,10 @@
21 21
 
22 22
 AVFilterBufferRef *ff_default_get_video_buffer(AVFilterLink *link,
23 23
                                                int perms, int w, int h);
24
+AVFilterBufferRef *ff_null_get_video_buffer(AVFilterLink *link, int perms, int w, int h);
25
+
26
+void ff_null_start_frame(AVFilterLink *link, AVFilterBufferRef *picref);
27
+void ff_null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir);
28
+void ff_null_end_frame(AVFilterLink *link);
29
+
24 30
 #endif /* AVFILTER_VIDEO_H */