lavfi: make avfilter_get_video_buffer() private on next bump.
authorAnton Khirnov <anton@khirnov.net>
Wed, 30 May 2012 08:31:48 +0000 (10:31 +0200)
committerAnton Khirnov <anton@khirnov.net>
Wed, 13 Jun 2012 09:09:15 +0000 (11:09 +0200)
They are only useful inside filters and we don't allow user filters for
now.

18 files changed:
libavfilter/avfilter.h
libavfilter/buffersrc.c
libavfilter/vf_delogo.c
libavfilter/vf_fieldorder.c
libavfilter/vf_frei0r.c
libavfilter/vf_gradfun.c
libavfilter/vf_overlay.c
libavfilter/vf_pad.c
libavfilter/vf_pixdesctest.c
libavfilter/vf_scale.c
libavfilter/vf_transpose.c
libavfilter/vf_vflip.c
libavfilter/vf_yadif.c
libavfilter/video.c
libavfilter/video.h
libavfilter/vsrc_color.c
libavfilter/vsrc_movie.c
libavfilter/vsrc_testsrc.c

index c592372..7fbc160 100644 (file)
@@ -573,19 +573,11 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad,
  */
 int avfilter_config_links(AVFilterContext *filter);
 
  */
 int avfilter_config_links(AVFilterContext *filter);
 
-/**
- * Request a picture buffer with a specific set of permissions.
- *
- * @param link  the output link to the filter from which the buffer will
- *              be requested
- * @param perms the required access permissions
- * @param w     the minimum width of the buffer to allocate
- * @param h     the minimum height of the buffer to allocate
- * @return      A reference to the buffer. This must be unreferenced with
- *              avfilter_unref_buffer when you are finished with it.
- */
+#if FF_API_FILTERS_PUBLIC
+attribute_deprecated
 AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms,
                                           int w, int h);
 AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms,
                                           int w, int h);
+#endif
 
 /**
  * Create a buffer reference wrapped around an already allocated image
 
 /**
  * Create a buffer reference wrapped around an already allocated image
index 7af9f6c..3ffab60 100644 (file)
@@ -109,8 +109,8 @@ int av_buffersrc_write_frame(AVFilterContext *buffer_filter, AVFrame *frame)
     case AVMEDIA_TYPE_VIDEO:
         CHECK_VIDEO_PARAM_CHANGE(buffer_filter, c, frame->width, frame->height,
                                  frame->format);
     case AVMEDIA_TYPE_VIDEO:
         CHECK_VIDEO_PARAM_CHANGE(buffer_filter, c, frame->width, frame->height,
                                  frame->format);
-        buf = avfilter_get_video_buffer(buffer_filter->outputs[0], AV_PERM_WRITE,
-                                        c->w, c->h);
+        buf = ff_get_video_buffer(buffer_filter->outputs[0], AV_PERM_WRITE,
+                                  c->w, c->h);
         av_image_copy(buf->data, buf->linesize, frame->data, frame->linesize,
                       c->pix_fmt, c->w, c->h);
         break;
         av_image_copy(buf->data, buf->linesize, frame->data, frame->linesize,
                       c->pix_fmt, c->w, c->h);
         break;
index 6fe4730..70aa12a 100644 (file)
@@ -219,8 +219,8 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
     AVFilterBufferRef *outpicref;
 
     if (inpicref->perms & AV_PERM_PRESERVE) {
     AVFilterBufferRef *outpicref;
 
     if (inpicref->perms & AV_PERM_PRESERVE) {
-        outpicref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE,
-                                              outlink->w, outlink->h);
+        outpicref = ff_get_video_buffer(outlink, AV_PERM_WRITE,
+                                        outlink->w, outlink->h);
         avfilter_copy_buffer_ref_props(outpicref, inpicref);
         outpicref->video->w = outlink->w;
         outpicref->video->h = outlink->h;
         avfilter_copy_buffer_ref_props(outpicref, inpicref);
         outpicref->video->w = outlink->w;
         outpicref->video->h = outlink->h;
index ff1e332..67a6958 100644 (file)
@@ -112,7 +112,7 @@ static AVFilterBufferRef *get_video_buffer(AVFilterLink *inlink, int perms, int
     AVFilterContext   *ctx        = inlink->dst;
     AVFilterLink      *outlink    = ctx->outputs[0];
 
     AVFilterContext   *ctx        = inlink->dst;
     AVFilterLink      *outlink    = ctx->outputs[0];
 
-    return avfilter_get_video_buffer(outlink, perms, w, h);
+    return ff_get_video_buffer(outlink, perms, w, h);
 }
 
 static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
 }
 
 static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
index 85b4205..2a72fcc 100644 (file)
@@ -432,7 +432,7 @@ static int source_config_props(AVFilterLink *outlink)
 static int source_request_frame(AVFilterLink *outlink)
 {
     Frei0rContext *frei0r = outlink->src->priv;
 static int source_request_frame(AVFilterLink *outlink)
 {
     Frei0rContext *frei0r = outlink->src->priv;
-    AVFilterBufferRef *picref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
+    AVFilterBufferRef *picref = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
     picref->video->pixel_aspect = (AVRational) {1, 1};
     picref->pts = frei0r->pts++;
     picref->pos = -1;
     picref->video->pixel_aspect = (AVRational) {1, 1};
     picref->pts = frei0r->pts++;
     picref->pos = -1;
index 7fde16d..88872b3 100644 (file)
@@ -190,7 +190,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
     AVFilterBufferRef *outpicref;
 
     if (inpicref->perms & AV_PERM_PRESERVE) {
     AVFilterBufferRef *outpicref;
 
     if (inpicref->perms & AV_PERM_PRESERVE) {
-        outpicref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
+        outpicref = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
         avfilter_copy_buffer_ref_props(outpicref, inpicref);
         outpicref->video->w = outlink->w;
         outpicref->video->h = outlink->h;
         avfilter_copy_buffer_ref_props(outpicref, inpicref);
         outpicref->video->w = outlink->w;
         outpicref->video->h = outlink->h;
index 55f1cc3..ff7c348 100644 (file)
@@ -205,7 +205,7 @@ static int config_output(AVFilterLink *outlink)
 
 static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms, int w, int h)
 {
 
 static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms, int w, int h)
 {
-    return avfilter_get_video_buffer(link->dst->outputs[0], perms, w, h);
+    return ff_get_video_buffer(link->dst->outputs[0], perms, w, h);
 }
 
 static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
 }
 
 static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
index 2e98aea..11c59b9 100644 (file)
@@ -256,9 +256,9 @@ static AVFilterBufferRef *get_video_buffer(AVFilterLink *inlink, int perms, int
 {
     PadContext *pad = inlink->dst->priv;
 
 {
     PadContext *pad = inlink->dst->priv;
 
-    AVFilterBufferRef *picref = avfilter_get_video_buffer(inlink->dst->outputs[0], perms,
-                                                       w + (pad->w - pad->in_w),
-                                                       h + (pad->h - pad->in_h));
+    AVFilterBufferRef *picref = ff_get_video_buffer(inlink->dst->outputs[0], perms,
+                                                    w + (pad->w - pad->in_w),
+                                                    h + (pad->h - pad->in_h));
     int plane;
 
     picref->video->w = w;
     int plane;
 
     picref->video->w = w;
@@ -327,9 +327,9 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
     if(pad->needs_copy){
         av_log(inlink->dst, AV_LOG_DEBUG, "Direct padding impossible allocating new frame\n");
         avfilter_unref_buffer(outpicref);
     if(pad->needs_copy){
         av_log(inlink->dst, AV_LOG_DEBUG, "Direct padding impossible allocating new frame\n");
         avfilter_unref_buffer(outpicref);
-        outpicref = avfilter_get_video_buffer(inlink->dst->outputs[0], AV_PERM_WRITE | AV_PERM_NEG_LINESIZES,
-                                                       FFMAX(inlink->w, pad->w),
-                                                       FFMAX(inlink->h, pad->h));
+        outpicref = ff_get_video_buffer(inlink->dst->outputs[0], AV_PERM_WRITE | AV_PERM_NEG_LINESIZES,
+                                        FFMAX(inlink->w, pad->w),
+                                        FFMAX(inlink->h, pad->h));
         avfilter_copy_buffer_ref_props(outpicref, inpicref);
     }
 
         avfilter_copy_buffer_ref_props(outpicref, inpicref);
     }
 
index 7eecdc0..353c57b 100644 (file)
@@ -57,8 +57,8 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
     AVFilterBufferRef *outpicref;
     int i;
 
     AVFilterBufferRef *outpicref;
     int i;
 
-    outlink->out_buf = avfilter_get_video_buffer(outlink, AV_PERM_WRITE,
-                                                outlink->w, outlink->h);
+    outlink->out_buf = ff_get_video_buffer(outlink, AV_PERM_WRITE,
+                                           outlink->w, outlink->h);
     outpicref = outlink->out_buf;
     avfilter_copy_buffer_ref_props(outpicref, picref);
 
     outpicref = outlink->out_buf;
     avfilter_copy_buffer_ref_props(outpicref, picref);
 
index 6f33848..68ff845 100644 (file)
@@ -265,7 +265,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
     scale->hsub = av_pix_fmt_descriptors[link->format].log2_chroma_w;
     scale->vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h;
 
     scale->hsub = av_pix_fmt_descriptors[link->format].log2_chroma_w;
     scale->vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h;
 
-    outpicref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
+    outpicref = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
     avfilter_copy_buffer_ref_props(outpicref, picref);
     outpicref->video->w = outlink->w;
     outpicref->video->h = outlink->h;
     avfilter_copy_buffer_ref_props(outpicref, picref);
     outpicref->video->w = outlink->w;
     outpicref->video->h = outlink->h;
index 5e5feda..aa5c015 100644 (file)
@@ -120,8 +120,8 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
 {
     AVFilterLink *outlink = inlink->dst->outputs[0];
 
 {
     AVFilterLink *outlink = inlink->dst->outputs[0];
 
-    outlink->out_buf = avfilter_get_video_buffer(outlink, AV_PERM_WRITE,
-                                                 outlink->w, outlink->h);
+    outlink->out_buf = ff_get_video_buffer(outlink, AV_PERM_WRITE,
+                                           outlink->w, outlink->h);
     outlink->out_buf->pts = picref->pts;
 
     if (picref->video->pixel_aspect.num == 0) {
     outlink->out_buf->pts = picref->pts;
 
     if (picref->video->pixel_aspect.num == 0) {
index 6d2f42e..bece2b2 100644 (file)
@@ -50,7 +50,7 @@ static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms,
     if (!(perms & AV_PERM_NEG_LINESIZES))
         return ff_default_get_video_buffer(link, perms, w, h);
 
     if (!(perms & AV_PERM_NEG_LINESIZES))
         return ff_default_get_video_buffer(link, perms, w, h);
 
-    picref = avfilter_get_video_buffer(link->dst->outputs[0], perms, w, h);
+    picref = ff_get_video_buffer(link->dst->outputs[0], perms, w, h);
     for (i = 0; i < 4; i ++) {
         int vsub = i == 1 || i == 2 ? flip->vsub : 0;
 
     for (i = 0; i < 4; i ++) {
         int vsub = i == 1 || i == 2 ? flip->vsub : 0;
 
index b498ab9..baf8b7a 100644 (file)
@@ -208,8 +208,8 @@ static void return_frame(AVFilterContext *ctx, int is_second)
     }
 
     if (is_second) {
     }
 
     if (is_second) {
-        yadif->out = avfilter_get_video_buffer(link, AV_PERM_WRITE | AV_PERM_PRESERVE |
-                                               AV_PERM_REUSE, link->w, link->h);
+        yadif->out = ff_get_video_buffer(link, AV_PERM_WRITE | AV_PERM_PRESERVE |
+                                         AV_PERM_REUSE, link->w, link->h);
         avfilter_copy_buffer_ref_props(yadif->out, yadif->cur);
         yadif->out->video->interlaced = 0;
     }
         avfilter_copy_buffer_ref_props(yadif->out, yadif->cur);
         yadif->out->video->interlaced = 0;
     }
@@ -268,8 +268,8 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
     if (!yadif->prev)
         yadif->prev = avfilter_ref_buffer(yadif->cur, AV_PERM_READ);
 
     if (!yadif->prev)
         yadif->prev = avfilter_ref_buffer(yadif->cur, AV_PERM_READ);
 
-    yadif->out = avfilter_get_video_buffer(ctx->outputs[0], AV_PERM_WRITE | AV_PERM_PRESERVE |
-                                       AV_PERM_REUSE, link->w, link->h);
+    yadif->out = ff_get_video_buffer(ctx->outputs[0], AV_PERM_WRITE | AV_PERM_PRESERVE |
+                                     AV_PERM_REUSE, link->w, link->h);
 
     avfilter_copy_buffer_ref_props(yadif->out, yadif->cur);
     yadif->out->video->interlaced = 0;
 
     avfilter_copy_buffer_ref_props(yadif->out, yadif->cur);
     yadif->out->video->interlaced = 0;
index 33082a1..0e10bb7 100644 (file)
@@ -67,7 +67,7 @@ static void ff_dlog_ref(void *ctx, AVFilterBufferRef *ref, int end)
 
 AVFilterBufferRef *ff_null_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
 {
 
 AVFilterBufferRef *ff_null_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
 {
-    return avfilter_get_video_buffer(link->dst->outputs[0], perms, w, h);
+    return ff_get_video_buffer(link->dst->outputs[0], perms, w, h);
 }
 
 /* TODO: set the buffer's priv member to a context structure for the whole
 }
 
 /* TODO: set the buffer's priv member to a context structure for the whole
@@ -138,7 +138,7 @@ fail:
     return NULL;
 }
 
     return NULL;
 }
 
-AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
+AVFilterBufferRef *ff_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
 {
     AVFilterBufferRef *ret = NULL;
 
 {
     AVFilterBufferRef *ret = NULL;
 
@@ -173,7 +173,7 @@ static void default_start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
         outlink = inlink->dst->outputs[0];
 
     if (outlink) {
         outlink = inlink->dst->outputs[0];
 
     if (outlink) {
-        outlink->out_buf = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
+        outlink->out_buf = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
         avfilter_copy_buffer_ref_props(outlink->out_buf, picref);
         ff_start_frame(outlink, avfilter_ref_buffer(outlink->out_buf, ~0));
     }
         avfilter_copy_buffer_ref_props(outlink->out_buf, picref);
         ff_start_frame(outlink, avfilter_ref_buffer(outlink->out_buf, ~0));
     }
@@ -201,7 +201,7 @@ void ff_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
                 picref->perms,
                 link->dstpad->min_perms, link->dstpad->rej_perms);
 
                 picref->perms,
                 link->dstpad->min_perms, link->dstpad->rej_perms);
 
-        link->cur_buf = avfilter_get_video_buffer(link, dst->min_perms, link->w, link->h);
+        link->cur_buf = ff_get_video_buffer(link, dst->min_perms, link->w, link->h);
         link->src_buf = picref;
         avfilter_copy_buffer_ref_props(link->cur_buf, link->src_buf);
     }
         link->src_buf = picref;
         avfilter_copy_buffer_ref_props(link->cur_buf, link->src_buf);
     }
@@ -354,4 +354,8 @@ void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
 {
     ff_draw_slice(link, y, h, slice_dir);
 }
 {
     ff_draw_slice(link, y, h, slice_dir);
 }
+AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
+{
+    return ff_get_video_buffer(link, perms, w, h);
+}
 #endif
 #endif
index 7c9f9a0..ce4e9c2 100644 (file)
@@ -25,6 +25,20 @@ AVFilterBufferRef *ff_default_get_video_buffer(AVFilterLink *link,
                                                int perms, int w, int h);
 AVFilterBufferRef *ff_null_get_video_buffer(AVFilterLink *link, int perms, int w, int h);
 
                                                int perms, int w, int h);
 AVFilterBufferRef *ff_null_get_video_buffer(AVFilterLink *link, int perms, int w, int h);
 
+/**
+ * Request a picture buffer with a specific set of permissions.
+ *
+ * @param link  the output link to the filter from which the buffer will
+ *              be requested
+ * @param perms the required access permissions
+ * @param w     the minimum width of the buffer to allocate
+ * @param h     the minimum height of the buffer to allocate
+ * @return      A reference to the buffer. This must be unreferenced with
+ *              avfilter_unref_buffer when you are finished with it.
+ */
+AVFilterBufferRef *ff_get_video_buffer(AVFilterLink *link, int perms,
+                                       int w, int h);
+
 void ff_null_start_frame(AVFilterLink *link, AVFilterBufferRef *picref);
 void ff_null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir);
 void ff_null_end_frame(AVFilterLink *link);
 void ff_null_start_frame(AVFilterLink *link, AVFilterBufferRef *picref);
 void ff_null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir);
 void ff_null_end_frame(AVFilterLink *link);
index 99ea0ad..bfd8493 100644 (file)
@@ -140,7 +140,7 @@ static int color_config_props(AVFilterLink *inlink)
 static int color_request_frame(AVFilterLink *link)
 {
     ColorContext *color = link->src->priv;
 static int color_request_frame(AVFilterLink *link)
 {
     ColorContext *color = link->src->priv;
-    AVFilterBufferRef *picref = avfilter_get_video_buffer(link, AV_PERM_WRITE, color->w, color->h);
+    AVFilterBufferRef *picref = ff_get_video_buffer(link, AV_PERM_WRITE, color->w, color->h);
     picref->video->pixel_aspect = (AVRational) {1, 1};
     picref->pts                 = color->pts++;
     picref->pos                 = -1;
     picref->video->pixel_aspect = (AVRational) {1, 1};
     picref->pts                 = color->pts++;
     picref->pos                 = -1;
index ff3022c..f887e95 100644 (file)
@@ -237,8 +237,8 @@ static int movie_get_frame(AVFilterLink *outlink)
 
             if (frame_decoded) {
                 /* FIXME: avoid the memcpy */
 
             if (frame_decoded) {
                 /* FIXME: avoid the memcpy */
-                movie->picref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE | AV_PERM_PRESERVE |
-                                                          AV_PERM_REUSE2, outlink->w, outlink->h);
+                movie->picref = ff_get_video_buffer(outlink, AV_PERM_WRITE | AV_PERM_PRESERVE |
+                                                    AV_PERM_REUSE2, outlink->w, outlink->h);
                 av_image_copy(movie->picref->data, movie->picref->linesize,
                               movie->frame->data,  movie->frame->linesize,
                               movie->picref->format, outlink->w, outlink->h);
                 av_image_copy(movie->picref->data, movie->picref->linesize,
                               movie->frame->data,  movie->frame->linesize,
                               movie->picref->format, outlink->w, outlink->h);
index 7187241..a6159ef 100644 (file)
@@ -132,8 +132,7 @@ static int request_frame(AVFilterLink *outlink)
 
     if (test->max_pts >= 0 && test->pts > test->max_pts)
         return AVERROR_EOF;
 
     if (test->max_pts >= 0 && test->pts > test->max_pts)
         return AVERROR_EOF;
-    picref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE,
-                                       test->w, test->h);
+    picref = ff_get_video_buffer(outlink, AV_PERM_WRITE, test->w, test->h);
     picref->pts = test->pts++;
     picref->pos = -1;
     picref->video->key_frame = 1;
     picref->pts = test->pts++;
     picref->pos = -1;
     picref->video->key_frame = 1;