lavfi: update some deprecated functions
authorPaul B Mahol <onemda@gmail.com>
Sat, 16 Jun 2012 09:47:46 +0000 (09:47 +0000)
committerPaul B Mahol <onemda@gmail.com>
Sat, 16 Jun 2012 15:15:16 +0000 (15:15 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
34 files changed:
libavfilter/af_aconvert.c
libavfilter/af_amerge.c
libavfilter/af_aresample.c
libavfilter/af_astreamsync.c
libavfilter/af_earwax.c
libavfilter/af_pan.c
libavfilter/af_silencedetect.c
libavfilter/af_volume.c
libavfilter/asrc_aevalsrc.c
libavfilter/avfiltergraph.c
libavfilter/defaults.c
libavfilter/drawutils.c
libavfilter/formats.c
libavfilter/sink_buffer.c
libavfilter/src_movie.c
libavfilter/vf_bbox.c
libavfilter/vf_blackdetect.c
libavfilter/vf_colormatrix.c
libavfilter/vf_deshake.c
libavfilter/vf_hflip.c
libavfilter/vf_idet.c
libavfilter/vf_removelogo.c
libavfilter/vf_select.c
libavfilter/vf_setfield.c
libavfilter/vf_super2xsai.c
libavfilter/vf_swapuv.c
libavfilter/vf_thumbnail.c
libavfilter/vf_tile.c
libavfilter/vf_tinterlace.c
libavfilter/video.c
libavfilter/vsrc_cellauto.c
libavfilter/vsrc_life.c
libavfilter/vsrc_mandelbrot.c
libavfilter/vsrc_mptestsrc.c

index 9e27856..3cf593b 100644 (file)
@@ -75,14 +75,14 @@ static int query_formats(AVFilterContext *ctx)
     AVFilterLink *outlink = ctx->outputs[0];
     AVFilterChannelLayouts *layouts;
 
-    avfilter_formats_ref(avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO),
+    ff_formats_ref(avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO),
                          &inlink->out_formats);
     if (aconvert->out_sample_fmt != AV_SAMPLE_FMT_NONE) {
         formats = NULL;
-        avfilter_add_format(&formats, aconvert->out_sample_fmt);
-        avfilter_formats_ref(formats, &outlink->in_formats);
+        ff_add_format(&formats, aconvert->out_sample_fmt);
+        ff_formats_ref(formats, &outlink->in_formats);
     } else
-        avfilter_formats_ref(avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO),
+        ff_formats_ref(avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO),
                              &outlink->in_formats);
 
     ff_channel_layouts_ref(ff_all_channel_layouts(),
index a8942a1..43d2a75 100644 (file)
@@ -119,8 +119,8 @@ static int query_formats(AVFilterContext *ctx)
                 if ((inlayout[i] >> c) & 1)
                     *(route[i]++) = out_ch_number++;
     }
-    formats = avfilter_make_format_list(ff_packed_sample_fmts_array);
-    avfilter_set_common_sample_formats(ctx, formats);
+    formats = ff_make_format_list(ff_packed_sample_fmts_array);
+    ff_set_common_formats(ctx, formats);
     for (i = 0; i < am->nb_inputs; i++) {
         layouts = NULL;
         ff_add_channel_layout(&layouts, inlayout[i]);
@@ -315,7 +315,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
             .min_perms        = AV_PERM_READ | AV_PERM_PRESERVE,
         };
         snprintf(name, sizeof(name), "in%d", i);
-        avfilter_insert_inpad(ctx, i, &pad);
+        ff_insert_inpad(ctx, i, &pad);
     }
     return 0;
 }
index 8ead314..81f326f 100644 (file)
@@ -91,29 +91,29 @@ static int query_formats(AVFilterContext *ctx)
     AVFilterLink *inlink  = ctx->inputs[0];
     AVFilterLink *outlink = ctx->outputs[0];
 
-    AVFilterFormats        *in_formats      = avfilter_all_formats(AVMEDIA_TYPE_AUDIO);
+    AVFilterFormats        *in_formats      = ff_all_formats(AVMEDIA_TYPE_AUDIO);
     AVFilterFormats        *out_formats;
     AVFilterFormats        *in_samplerates  = ff_all_samplerates();
     AVFilterFormats        *out_samplerates;
     AVFilterChannelLayouts *in_layouts      = ff_all_channel_layouts();
     AVFilterChannelLayouts *out_layouts;
 
-    avfilter_formats_ref  (in_formats,      &inlink->out_formats);
-    avfilter_formats_ref  (in_samplerates,  &inlink->out_samplerates);
+    ff_formats_ref  (in_formats,      &inlink->out_formats);
+    ff_formats_ref  (in_samplerates,  &inlink->out_samplerates);
     ff_channel_layouts_ref(in_layouts,      &inlink->out_channel_layouts);
 
     if(out_rate > 0) {
-        out_samplerates = avfilter_make_format_list((int[]){ out_rate, -1 });
+        out_samplerates = ff_make_format_list((int[]){ out_rate, -1 });
     } else {
         out_samplerates = ff_all_samplerates();
     }
-    avfilter_formats_ref(out_samplerates, &outlink->in_samplerates);
+    ff_formats_ref(out_samplerates, &outlink->in_samplerates);
 
     if(out_format != AV_SAMPLE_FMT_NONE) {
-        out_formats = avfilter_make_format_list((int[]){ out_format, -1 });
+        out_formats = ff_make_format_list((int[]){ out_format, -1 });
     } else
         out_formats = avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO);
-    avfilter_formats_ref(out_formats, &outlink->in_formats);
+    ff_formats_ref(out_formats, &outlink->in_formats);
 
     if(out_layout) {
         out_layouts = avfilter_make_format64_list((int64_t[]){ out_layout, -1 });
index 3d919d1..18a2fe6 100644 (file)
@@ -85,11 +85,11 @@ static int query_formats(AVFilterContext *ctx)
 
     for (i = 0; i < 2; i++) {
         formats = ctx->inputs[i]->in_formats;
-        avfilter_formats_ref(formats, &ctx->inputs[i]->out_formats);
-        avfilter_formats_ref(formats, &ctx->outputs[i]->in_formats);
+        ff_formats_ref(formats, &ctx->inputs[i]->out_formats);
+        ff_formats_ref(formats, &ctx->outputs[i]->in_formats);
         rates = ff_all_samplerates();
-        avfilter_formats_ref(rates, &ctx->inputs[i]->out_samplerates);
-        avfilter_formats_ref(rates, &ctx->outputs[i]->in_samplerates);
+        ff_formats_ref(rates, &ctx->inputs[i]->out_samplerates);
+        ff_formats_ref(rates, &ctx->outputs[i]->in_samplerates);
         layouts = ctx->inputs[i]->in_channel_layouts;
         ff_channel_layouts_ref(layouts, &ctx->inputs[i]->out_channel_layouts);
         ff_channel_layouts_ref(layouts, &ctx->outputs[i]->in_channel_layouts);
index d4884f0..d86b410 100644 (file)
@@ -82,11 +82,11 @@ static int query_formats(AVFilterContext *ctx)
     AVFilterFormats *formats = NULL;
     AVFilterChannelLayouts *layout = NULL;
 
-    avfilter_add_format(&formats, AV_SAMPLE_FMT_S16);
-    avfilter_set_common_sample_formats(ctx, formats);
+    ff_add_format(&formats, AV_SAMPLE_FMT_S16);
+    ff_set_common_formats(ctx, formats);
     ff_add_channel_layout(&layout, AV_CH_LAYOUT_STEREO);
     ff_set_common_channel_layouts(ctx, layout);
-    ff_set_common_samplerates(ctx, avfilter_make_format_list(sample_rates));
+    ff_set_common_samplerates(ctx, ff_make_format_list(sample_rates));
 
     return 0;
 }
index 0a1bf32..aed59cd 100644 (file)
@@ -217,7 +217,7 @@ static int query_formats(AVFilterContext *ctx)
 
     pan->pure_gains = are_gains_pure(pan);
     /* libswr supports any sample and packing formats */
-    avfilter_set_common_sample_formats(ctx, avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO));
+    ff_set_common_formats(ctx, avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO));
 
     formats = ff_all_samplerates();
     if (!formats)
index 27191cd..331ea87 100644 (file)
@@ -137,10 +137,10 @@ static int query_formats(AVFilterContext *ctx)
         return AVERROR(ENOMEM);
     ff_set_common_channel_layouts(ctx, layouts);
 
-    formats = avfilter_make_format_list(sample_fmts);
+    formats = ff_make_format_list(sample_fmts);
     if (!formats)
         return AVERROR(ENOMEM);
-    avfilter_set_common_sample_formats(ctx, formats);
+    ff_set_common_formats(ctx, formats);
 
     formats = ff_all_samplerates();
     if (!formats)
index 7c51884..e01453b 100644 (file)
@@ -97,10 +97,10 @@ static int query_formats(AVFilterContext *ctx)
         return AVERROR(ENOMEM);
     ff_set_common_channel_layouts(ctx, layouts);
 
-    formats = avfilter_make_format_list(sample_fmts);
+    formats = ff_make_format_list(sample_fmts);
     if (!formats)
         return AVERROR(ENOMEM);
-    avfilter_set_common_sample_formats(ctx, formats);
+    ff_set_common_formats(ctx, formats);
 
     formats = ff_all_samplerates();
     if (!formats)
index 59e5503..85e0ee5 100644 (file)
@@ -199,9 +199,9 @@ static int query_formats(AVFilterContext *ctx)
     int64_t chlayouts[] = { eval->chlayout, -1 };
     int sample_rates[] = { eval->sample_rate, -1 };
 
-    avfilter_set_common_sample_formats (ctx, avfilter_make_format_list(sample_fmts));
+    ff_set_common_formats (ctx, ff_make_format_list(sample_fmts));
     ff_set_common_channel_layouts(ctx, avfilter_make_format64_list(chlayouts));
-    ff_set_common_samplerates(ctx, avfilter_make_format_list(sample_rates));
+    ff_set_common_samplerates(ctx, ff_make_format_list(sample_rates));
 
     return 0;
 }
index 0f363b2..1af77e4 100644 (file)
@@ -189,7 +189,7 @@ static int filter_query_formats(AVFilterContext *ctx)
     formats = avfilter_make_all_formats(type);
     if (!formats)
         return AVERROR(ENOMEM);
-    avfilter_set_common_formats(ctx, formats);
+    ff_set_common_formats(ctx, formats);
     if (type == AVMEDIA_TYPE_AUDIO) {
         samplerates = ff_all_samplerates();
         if (!samplerates)
@@ -231,9 +231,9 @@ static int insert_conv_filter(AVFilterGraph *graph, AVFilterLink *link,
     filter_query_formats(filt_ctx);
 
     if ( ((link = filt_ctx-> inputs[0]) &&
-           !avfilter_merge_formats(link->in_formats, link->out_formats)) ||
+           !ff_merge_formats(link->in_formats, link->out_formats)) ||
          ((link = filt_ctx->outputs[0]) &&
-           !avfilter_merge_formats(link->in_formats, link->out_formats))
+           !ff_merge_formats(link->in_formats, link->out_formats))
        ) {
         av_log(NULL, AV_LOG_ERROR,
                "Impossible to convert between the formats supported by the filter "
@@ -295,7 +295,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
                 return AVERROR(EINVAL);
 
             if (link->type == AVMEDIA_TYPE_VIDEO &&
-                !avfilter_merge_formats(link->in_formats, link->out_formats)) {
+                !ff_merge_formats(link->in_formats, link->out_formats)) {
 
                 /* couldn't merge format lists, auto-insert scale filter */
                 snprintf(filt_args, sizeof(filt_args), "0:0:%s",
@@ -310,7 +310,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
                 /* Merge all three list before checking: that way, in all
                  * three categories, aconvert will use a common format
                  * whenever possible. */
-                formats   = avfilter_merge_formats(link->in_formats,   link->out_formats);
+                formats     = ff_merge_formats(link->in_formats,   link->out_formats);
                 chlayouts   = ff_merge_channel_layouts(link->in_channel_layouts  , link->out_channel_layouts);
                 samplerates = ff_merge_samplerates    (link->in_samplerates, link->out_samplerates);
 
index c25c037..c18eacd 100644 (file)
@@ -34,13 +34,11 @@ static void set_common_formats(AVFilterContext *ctx, AVFilterFormats *fmts,
     int i;
     for (i = 0; i < ctx->input_count; i++)
         if (ctx->inputs[i] && ctx->inputs[i]->type == type)
-            avfilter_formats_ref(fmts,
-                                 (AVFilterFormats **)((uint8_t *)ctx->inputs[i]+offout));
+            ff_formats_ref(fmts, (AVFilterFormats **)((uint8_t *)ctx->inputs[i]+offout));
 
     for (i = 0; i < ctx->output_count; i++)
         if (ctx->outputs[i] && ctx->outputs[i]->type == type)
-            avfilter_formats_ref(fmts,
-                                 (AVFilterFormats **)((uint8_t *)ctx->outputs[i]+offin));
+            ff_formats_ref(fmts, (AVFilterFormats **)((uint8_t *)ctx->outputs[i]+offin));
 
     if (!fmts->refcount) {
         av_free(fmts->formats);
index 9abe28b..83968ab 100644 (file)
@@ -23,6 +23,7 @@
 #include "libavutil/colorspace.h"
 #include "libavutil/pixdesc.h"
 #include "drawutils.h"
+#include "formats.h"
 
 enum { RED = 0, GREEN, BLUE, ALPHA };
 
@@ -505,7 +506,7 @@ AVFilterFormats *ff_draw_supported_pixel_formats(unsigned flags)
         if (ff_draw_init(&draw, i, flags) >= 0)
             pix_fmts[n++] = i;
     pix_fmts[n++] = PIX_FMT_NONE;
-    return avfilter_make_format_list(pix_fmts);
+    return ff_make_format_list(pix_fmts);
 }
 
 #ifdef TEST
index 0b1ef30..8cdd3be 100644 (file)
@@ -299,7 +299,7 @@ AVFilterFormats *avfilter_make_all_packing_formats(void)
         -1,
     };
 
-    return avfilter_make_format_list(packing);
+    return ff_make_format_list(packing);
 }
 #endif
 
index 35c0b16..27f21b0 100644 (file)
@@ -152,7 +152,7 @@ int av_buffersink_poll_frame(AVFilterContext *ctx)
     BufferSinkContext *buf = ctx->priv;
     AVFilterLink *inlink = ctx->inputs[0];
 
-    return av_fifo_size(buf->fifo)/sizeof(AVFilterBufferRef *) + avfilter_poll_frame(inlink);
+    return av_fifo_size(buf->fifo)/sizeof(AVFilterBufferRef *) + ff_poll_frame(inlink);
 }
 
 #if FF_API_OLD_VSINK_API
@@ -201,9 +201,9 @@ static int vsink_query_formats(AVFilterContext *ctx)
     BufferSinkContext *buf = ctx->priv;
 
     if (buf->pixel_fmts)
-        avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(buf->pixel_fmts));
+        ff_set_common_formats(ctx, ff_make_format_list(buf->pixel_fmts));
     else
-        avfilter_default_query_formats(ctx);
+        ff_default_query_formats(ctx);
 
     return 0;
 }
@@ -272,9 +272,9 @@ static int asink_query_formats(AVFilterContext *ctx)
     AVFilterFormats *formats = NULL;
     AVFilterChannelLayouts *layouts = NULL;
 
-    if (!(formats = avfilter_make_format_list(buf->sample_fmts)))
+    if (!(formats = ff_make_format_list(buf->sample_fmts)))
         return AVERROR(ENOMEM);
-    avfilter_set_common_sample_formats(ctx, formats);
+    ff_set_common_formats(ctx, formats);
 
     if (!(layouts = avfilter_make_format64_list(buf->channel_layouts)))
         return AVERROR(ENOMEM);
index eea2db3..a3239c1 100644 (file)
@@ -371,8 +371,8 @@ static int amovie_query_formats(AVFilterContext *ctx)
     int64_t chlayouts[] = { c->channel_layout ? c->channel_layout :
                             av_get_default_channel_layout(c->channels), -1 };
 
-    avfilter_set_common_sample_formats (ctx, avfilter_make_format_list(sample_fmts));
-    ff_set_common_samplerates          (ctx, avfilter_make_format_list(sample_rates));
+    ff_set_common_formats        (ctx, ff_make_format_list(sample_fmts));
+    ff_set_common_samplerates    (ctx, ff_make_format_list(sample_rates));
     ff_set_common_channel_layouts(ctx, avfilter_make_format64_list(chlayouts));
 
     return 0;
index f8dc625..6fc6935 100644 (file)
@@ -52,7 +52,7 @@ static int query_formats(AVFilterContext *ctx)
         PIX_FMT_NONE,
     };
 
-    avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts));
+    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
     return 0;
 }
 
@@ -87,7 +87,7 @@ static void end_frame(AVFilterLink *inlink)
 
     bbox->frame++;
     avfilter_unref_buffer(picref);
-    avfilter_end_frame(inlink->dst->outputs[0]);
+    ff_end_frame(inlink->dst->outputs[0]);
 }
 
 AVFilter avfilter_vf_bbox = {
@@ -100,7 +100,7 @@ AVFilter avfilter_vf_bbox = {
     .inputs = (const AVFilterPad[]) {
         { .name             = "default",
           .type             = AVMEDIA_TYPE_VIDEO,
-          .get_video_buffer = avfilter_null_get_video_buffer,
+          .get_video_buffer = ff_null_get_video_buffer,
           .start_frame      = ff_null_start_frame_keep_ref,
           .end_frame        = end_frame,
           .min_perms        = AV_PERM_READ, },
index a53927b..abb22bd 100644 (file)
@@ -79,7 +79,7 @@ static int query_formats(AVFilterContext *ctx)
         PIX_FMT_NONE
     };
 
-    avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts));
+    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
     return 0;
 }
 
@@ -134,7 +134,7 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
         p += picref->linesize[0];
     }
 
-    avfilter_draw_slice(ctx->outputs[0], y, h, slice_dir);
+    ff_draw_slice(ctx->outputs[0], y, h, slice_dir);
 }
 
 static void end_frame(AVFilterLink *inlink)
@@ -176,7 +176,7 @@ static void end_frame(AVFilterLink *inlink)
     blackdetect->frame_count++;
     blackdetect->nb_black_pixels = 0;
     avfilter_unref_buffer(picref);
-    avfilter_end_frame(inlink->dst->outputs[0]);
+    ff_end_frame(inlink->dst->outputs[0]);
 }
 
 AVFilter avfilter_vf_blackdetect = {
@@ -191,7 +191,7 @@ AVFilter avfilter_vf_blackdetect = {
           .type             = AVMEDIA_TYPE_VIDEO,
           .config_props     = config_input,
           .draw_slice       = draw_slice,
-          .get_video_buffer = avfilter_null_get_video_buffer,
+          .get_video_buffer = ff_null_get_video_buffer,
           .start_frame      = ff_null_start_frame_keep_ref,
           .end_frame        = end_frame, },
         { .name = NULL }
index fa20b6a..80814de 100644 (file)
@@ -31,6 +31,8 @@
 #include <strings.h>
 #include <float.h>
 #include "avfilter.h"
+#include "formats.h"
+#include "video.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/avstring.h"
 
@@ -325,7 +327,7 @@ static int query_formats(AVFilterContext *ctx)
         PIX_FMT_NONE
     };
 
-    avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts));
+    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
 
     return 0;
 }
@@ -333,7 +335,7 @@ static int query_formats(AVFilterContext *ctx)
 static AVFilterBufferRef *get_video_buffer(AVFilterLink *inlink, int perms, int w, int h)
 {
     AVFilterBufferRef *picref =
-        avfilter_get_video_buffer(inlink->dst->outputs[0], perms, w, h);
+        ff_get_video_buffer(inlink->dst->outputs[0], perms, w, h);
     return picref;
 }
 
@@ -343,7 +345,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
 
     link->dst->outputs[0]->out_buf = outpicref;
 
-    avfilter_start_frame(link->dst->outputs[0], outpicref);
+    ff_start_frame(link->dst->outputs[0], outpicref);
 }
 
 static void end_frame(AVFilterLink *link)
@@ -359,8 +361,8 @@ static void end_frame(AVFilterLink *link)
     else
         process_frame_uyvy422(color, out, link->cur_buf);
 
-    avfilter_draw_slice(ctx->outputs[0], 0, link->dst->outputs[0]->h, 1);
-    avfilter_end_frame(ctx->outputs[0]);
+    ff_draw_slice(ctx->outputs[0], 0, link->dst->outputs[0]->h, 1);
+    ff_end_frame(ctx->outputs[0]);
     avfilter_unref_buffer(link->cur_buf);
 }
 
index cdece5c..6b2a3d4 100644 (file)
@@ -50,6 +50,8 @@
  */
 
 #include "avfilter.h"
+#include "formats.h"
+#include "video.h"
 #include "libavutil/common.h"
 #include "libavutil/mem.h"
 #include "libavutil/pixdesc.h"
@@ -390,7 +392,7 @@ static int query_formats(AVFilterContext *ctx)
         PIX_FMT_YUVJ444P, PIX_FMT_YUVJ440P, PIX_FMT_NONE
     };
 
-    avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts));
+    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
 
     return 0;
 }
@@ -525,8 +527,8 @@ static void end_frame(AVFilterLink *link)
     deshake->ref = in;
 
     // Draw the transformed frame information
-    avfilter_draw_slice(link->dst->outputs[0], 0, link->h, 1);
-    avfilter_end_frame(link->dst->outputs[0]);
+    ff_draw_slice(link->dst->outputs[0], 0, link->h, 1);
+    ff_end_frame(link->dst->outputs[0]);
     avfilter_unref_buffer(out);
 }
 
index bfc83f2..459cfab 100644 (file)
@@ -88,14 +88,14 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
     AVFilterLink *outlink = inlink->dst->outputs[0];
 
     outlink->out_buf =
-        avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
+        ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
     avfilter_copy_buffer_ref_props(outlink->out_buf, picref);
 
     /* copy palette if required */
     if (av_pix_fmt_descriptors[inlink->format].flags & PIX_FMT_PAL)
         memcpy(inlink->dst->outputs[0]->out_buf->data[1], picref->data[1], AVPALETTE_SIZE);
 
-    avfilter_start_frame(outlink, avfilter_ref_buffer(outlink->out_buf, ~0));
+    ff_start_frame(outlink, avfilter_ref_buffer(outlink->out_buf, ~0));
 }
 
 static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
index 0441c78..48aad5f 100644 (file)
@@ -22,6 +22,7 @@
 #include "libavutil/common.h"
 #include "libavutil/pixdesc.h"
 #include "avfilter.h"
+#include "internal.h"
 
 #undef NDEBUG
 #include <assert.h>
@@ -185,7 +186,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
     if (!idet->prev)
         idet->prev = avfilter_ref_buffer(idet->cur, AV_PERM_READ);
 
-    avfilter_start_frame(ctx->outputs[0], avfilter_ref_buffer(idet->cur, AV_PERM_READ));
+    ff_start_frame(ctx->outputs[0], avfilter_ref_buffer(idet->cur, AV_PERM_READ));
 }
 
 static void end_frame(AVFilterLink *link)
@@ -203,8 +204,8 @@ static void end_frame(AVFilterLink *link)
 
     filter(ctx);
 
-    avfilter_draw_slice(ctx->outputs[0], 0, link->h, 1);
-    avfilter_end_frame(ctx->outputs[0]);
+    ff_draw_slice(ctx->outputs[0], 0, link->h, 1);
+    ff_end_frame(ctx->outputs[0]);
 }
 
 static int request_frame(AVFilterLink *link)
@@ -227,12 +228,12 @@ static int poll_frame(AVFilterLink *link)
     IDETContext *idet = link->src->priv;
     int ret, val;
 
-    val = avfilter_poll_frame(link->src->inputs[0]);
+    val = ff_poll_frame(link->src->inputs[0]);
 
     if (val >= 1 && !idet->next) { //FIXME change API to not requre this red tape
         if ((ret = avfilter_request_frame(link->src->inputs[0])) < 0)
             return ret;
-        val = avfilter_poll_frame(link->src->inputs[0]);
+        val = ff_poll_frame(link->src->inputs[0]);
     }
     assert(idet->next || !val);
 
@@ -286,7 +287,7 @@ static int query_formats(AVFilterContext *ctx)
         PIX_FMT_NONE
     };
 
-    avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts));
+    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
 
     return 0;
 }
index b1a6fc7..c912fc3 100644 (file)
@@ -71,6 +71,8 @@
 
 #include "libavutil/imgutils.h"
 #include "avfilter.h"
+#include "formats.h"
+#include "video.h"
 #include "bbox.h"
 #include "lavfutils.h"
 #include "lswsutils.h"
@@ -190,7 +192,7 @@ static void convert_mask_to_strength_mask(uint8_t *data, int linesize,
 static int query_formats(AVFilterContext *ctx)
 {
     enum PixelFormat pix_fmts[] = { PIX_FMT_YUV420P, PIX_FMT_NONE };
-    avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts));
+    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
     return 0;
 }
 
@@ -476,7 +478,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
     AVFilterBufferRef *outpicref;
 
     if (inpicref->perms & AV_PERM_PRESERVE) {
-        outpicref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE,
+        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;
@@ -485,7 +487,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
         outpicref = inpicref;
 
     outlink->out_buf = outpicref;
-    avfilter_start_frame(outlink, avfilter_ref_buffer(outpicref, ~0));
+    ff_start_frame(outlink, avfilter_ref_buffer(outpicref, ~0));
 }
 
 static void end_frame(AVFilterLink *inlink)
@@ -512,8 +514,8 @@ static void end_frame(AVFilterLink *inlink)
                removelogo->half_mask_data, inlink->w/2,
                inlink->w/2, inlink->h/2, direct, &removelogo->half_mask_bbox);
 
-    avfilter_draw_slice(outlink, 0, inlink->h, 1);
-    avfilter_end_frame(outlink);
+    ff_draw_slice(outlink, 0, inlink->h, 1);
+    ff_end_frame(outlink);
     avfilter_unref_buffer(inpicref);
     if (!direct)
         avfilter_unref_buffer(outpicref);
@@ -554,7 +556,7 @@ AVFilter avfilter_vf_removelogo = {
     .inputs = (const AVFilterPad[]) {
         { .name             = "default",
           .type             = AVMEDIA_TYPE_VIDEO,
-          .get_video_buffer = avfilter_null_get_video_buffer,
+          .get_video_buffer = ff_null_get_video_buffer,
           .config_props     = config_props_input,
           .draw_slice       = null_draw_slice,
           .start_frame      = start_frame,
index aa996cb..1fc71eb 100644 (file)
@@ -390,7 +390,7 @@ static int query_formats(AVFilterContext *ctx)
             PIX_FMT_RGB24, PIX_FMT_BGR24,
             PIX_FMT_NONE
         };
-        avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts));
+        ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
     }
     return 0;
 }
index 00be599..d50a252 100644 (file)
@@ -24,6 +24,7 @@
  */
 
 #include "avfilter.h"
+#include "video.h"
 
 enum SetFieldMode {
     MODE_AUTO = -1,
@@ -79,7 +80,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
         outpicref->video->interlaced = 1;
         outpicref->video->top_field_first = setfield->mode;
     }
-    avfilter_start_frame(inlink->dst->outputs[0], outpicref);
+    ff_start_frame(inlink->dst->outputs[0], outpicref);
 }
 
 AVFilter avfilter_vf_setfield = {
@@ -92,7 +93,7 @@ AVFilter avfilter_vf_setfield = {
     .inputs = (const AVFilterPad[]) {
         { .name             = "default",
           .type             = AVMEDIA_TYPE_VIDEO,
-          .get_video_buffer = avfilter_null_get_video_buffer,
+          .get_video_buffer = ff_null_get_video_buffer,
           .start_frame      = start_frame, },
         { .name = NULL }
     },
index 1b0b6a0..adfc41d 100644 (file)
@@ -29,6 +29,8 @@
 #include "libavutil/pixdesc.h"
 #include "libavutil/intreadwrite.h"
 #include "avfilter.h"
+#include "formats.h"
+#include "video.h"
 
 typedef struct {
     /* masks used for two pixels interpolation */
@@ -238,7 +240,7 @@ static int query_formats(AVFilterContext *ctx)
         PIX_FMT_NONE
     };
 
-    avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts));
+    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
     return 0;
 }
 
@@ -313,8 +315,8 @@ static void end_frame(AVFilterLink *inlink)
                inlink->w, inlink->h);
 
     avfilter_unref_buffer(inpicref);
-    avfilter_draw_slice(outlink, 0, outlink->h, 1);
-    avfilter_end_frame(outlink);
+    ff_draw_slice(outlink, 0, outlink->h, 1);
+    ff_end_frame(outlink);
     avfilter_unref_buffer(outpicref);
 }
 
index 6e35333..1a13eda 100644 (file)
  */
 
 #include "avfilter.h"
+#include "formats.h"
+#include "video.h"
 
 static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms,
                                            int w, int h)
 {
     AVFilterBufferRef *picref =
-        avfilter_default_get_video_buffer(link, perms, w, h);
+        ff_default_get_video_buffer(link, perms, w, h);
     uint8_t *tmp;
     int tmp2;
 
@@ -54,7 +56,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *inpicref)
     outpicref->linesize[1] = inpicref->linesize[2];
     outpicref->linesize[2] = inpicref->linesize[1];
 
-    avfilter_start_frame(link->dst->outputs[0], outpicref);
+    ff_start_frame(link->dst->outputs[0], outpicref);
 }
 
 static int query_formats(AVFilterContext *ctx)
@@ -68,7 +70,7 @@ static int query_formats(AVFilterContext *ctx)
         PIX_FMT_NONE,
     };
 
-    avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts));
+    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
     return 0;
 }
 
index 0b7ba06..215f50a 100644 (file)
@@ -28,6 +28,7 @@
  */
 
 #include "avfilter.h"
+#include "internal.h"
 
 #define HIST_SIZE (3*256)
 
@@ -151,10 +152,10 @@ static void end_frame(AVFilterLink *inlink)
     picref = thumb->frames[best_frame_idx].buf;
     av_log(ctx, AV_LOG_INFO, "frame id #%d (pts_time=%f) selected\n",
            best_frame_idx, picref->pts * av_q2d(inlink->time_base));
-    avfilter_start_frame(outlink, picref);
+    ff_start_frame(outlink, picref);
     thumb->frames[best_frame_idx].buf = NULL;
-    avfilter_draw_slice(outlink, 0, inlink->h, 1);
-    avfilter_end_frame(outlink);
+    ff_draw_slice(outlink, 0, inlink->h, 1);
+    ff_end_frame(outlink);
 }
 
 static av_cold void uninit(AVFilterContext *ctx)
@@ -188,7 +189,7 @@ static int poll_frame(AVFilterLink *link)
 {
     ThumbContext *thumb  = link->src->priv;
     AVFilterLink *inlink = link->src->inputs[0];
-    int ret, available_frames = avfilter_poll_frame(inlink);
+    int ret, available_frames = ff_poll_frame(inlink);
 
     /* If the input link is not able to provide any frame, we can't do anything
      * at the moment and thus have zero thumbnail available. */
@@ -212,7 +213,7 @@ static int query_formats(AVFilterContext *ctx)
         PIX_FMT_RGB24, PIX_FMT_BGR24,
         PIX_FMT_NONE
     };
-    avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts));
+    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
     return 0;
 }
 
@@ -226,7 +227,7 @@ AVFilter avfilter_vf_thumbnail = {
     .inputs        = (const AVFilterPad[]) {
         {   .name             = "default",
             .type             = AVMEDIA_TYPE_VIDEO,
-            .get_video_buffer = avfilter_null_get_video_buffer,
+            .get_video_buffer = ff_null_get_video_buffer,
             .start_frame      = null_start_frame,
             .draw_slice       = draw_slice,
             .end_frame        = end_frame,
index 6ae787d..e6971de 100644 (file)
@@ -103,7 +103,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
 
     if (tile->current)
         return;
-    outlink->out_buf = avfilter_get_video_buffer(outlink, AV_PERM_WRITE,
+    outlink->out_buf = ff_get_video_buffer(outlink, AV_PERM_WRITE,
                                                  outlink->w, outlink->h);
     avfilter_copy_buffer_ref_props(outlink->out_buf, picref);
     outlink->out_buf->video->w = outlink->w;
index adf10b1..8f9dc00 100644 (file)
@@ -76,7 +76,7 @@ static int query_formats(AVFilterContext *ctx)
         PIX_FMT_NONE
     };
 
-    avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts));
+    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
     return 0;
 }
 
@@ -224,7 +224,7 @@ static void end_frame(AVFilterLink *inlink)
     switch (tinterlace->mode) {
     case MODE_MERGE: /* move the odd frame into the upper field of the new image, even into
              * the lower field, generating a double-height video at half framerate */
-        out = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
+        out = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
         avfilter_copy_buffer_ref_props(out, cur);
         out->video->h = outlink->h;
         out->video->interlaced = 1;
@@ -251,7 +251,7 @@ static void end_frame(AVFilterLink *inlink)
 
     case MODE_PAD: /* expand each frame to double height, but pad alternate
                     * lines with black; framerate unchanged */
-        out = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
+        out = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
         avfilter_copy_buffer_ref_props(out, cur);
         out->video->h = outlink->h;
 
@@ -273,7 +273,7 @@ static void end_frame(AVFilterLink *inlink)
     case MODE_INTERLEAVE_TOP:    /* top    field first */
     case MODE_INTERLEAVE_BOTTOM: /* bottom field first */
         tff = tinterlace->mode == MODE_INTERLEAVE_TOP;
-        out = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
+        out = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
         avfilter_copy_buffer_ref_props(out, cur);
         out->video->interlaced = 1;
         out->video->top_field_first = tff;
@@ -295,13 +295,13 @@ static void end_frame(AVFilterLink *inlink)
         out = avfilter_ref_buffer(cur, AV_PERM_READ);
         out->video->interlaced = 1;
 
-        avfilter_start_frame(outlink, out);
-        avfilter_draw_slice(outlink, 0, outlink->h, 1);
-        avfilter_end_frame(outlink);
+        ff_start_frame(outlink, out);
+        ff_draw_slice(outlink, 0, outlink->h, 1);
+        ff_end_frame(outlink);
 
         /* output mix of current and next frame */
         tff = next->video->top_field_first;
-        out = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
+        out = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
         avfilter_copy_buffer_ref_props(out, next);
         out->video->interlaced = 1;
 
@@ -318,9 +318,9 @@ static void end_frame(AVFilterLink *inlink)
         break;
     }
 
-    avfilter_start_frame(outlink, out);
-    avfilter_draw_slice(outlink, 0, outlink->h, 1);
-    avfilter_end_frame(outlink);
+    ff_start_frame(outlink, out);
+    ff_draw_slice(outlink, 0, outlink->h, 1);
+    ff_end_frame(outlink);
 
     tinterlace->frame++;
 }
@@ -331,12 +331,12 @@ static int poll_frame(AVFilterLink *outlink)
     AVFilterLink *inlink = outlink->src->inputs[0];
     int ret, val;
 
-    val = avfilter_poll_frame(inlink);
+    val = ff_poll_frame(inlink);
 
     if (val == 1 && !tinterlace->next) {
         if ((ret = avfilter_request_frame(inlink)) < 0)
             return ret;
-        val = avfilter_poll_frame(inlink);
+        val = ff_poll_frame(inlink);
     }
     assert(tinterlace->next);
 
index dce3478..ab6e2cd 100644 (file)
@@ -220,7 +220,7 @@ void ff_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
 void ff_null_start_frame_keep_ref(AVFilterLink *inlink,
                                                 AVFilterBufferRef *picref)
 {
-    avfilter_start_frame(inlink->dst->outputs[0], avfilter_ref_buffer(picref, ~0));
+    ff_start_frame(inlink->dst->outputs[0], avfilter_ref_buffer(picref, ~0));
 }
 
 void ff_null_end_frame(AVFilterLink *link)
index 1f6ba6a..b08205e 100644 (file)
@@ -31,6 +31,8 @@
 #include "libavutil/parseutils.h"
 #include "libavutil/random_seed.h"
 #include "avfilter.h"
+#include "formats.h"
+#include "video.h"
 
 typedef struct {
     const AVClass *class;
@@ -305,7 +307,7 @@ static int request_frame(AVFilterLink *outlink)
 {
     CellAutoContext *cellauto = outlink->src->priv;
     AVFilterBufferRef *picref =
-        avfilter_get_video_buffer(outlink, AV_PERM_WRITE, cellauto->w, cellauto->h);
+        ff_get_video_buffer(outlink, AV_PERM_WRITE, cellauto->w, cellauto->h);
     picref->video->sample_aspect_ratio = (AVRational) {1, 1};
     if (cellauto->generation == 0 && cellauto->start_full) {
         int i;
@@ -322,9 +324,9 @@ static int request_frame(AVFilterLink *outlink)
     show_cellauto_row(outlink->src);
 #endif
 
-    avfilter_start_frame(outlink, avfilter_ref_buffer(picref, ~0));
-    avfilter_draw_slice(outlink, 0, cellauto->h, 1);
-    avfilter_end_frame(outlink);
+    ff_start_frame(outlink, avfilter_ref_buffer(picref, ~0));
+    ff_draw_slice(outlink, 0, cellauto->h, 1);
+    ff_end_frame(outlink);
     avfilter_unref_buffer(picref);
 
     return 0;
@@ -333,7 +335,7 @@ static int request_frame(AVFilterLink *outlink)
 static int query_formats(AVFilterContext *ctx)
 {
     static const enum PixelFormat pix_fmts[] = { PIX_FMT_MONOBLACK, PIX_FMT_NONE };
-    avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts));
+    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
     return 0;
 }
 
index 4846f5d..756ad68 100644 (file)
@@ -32,6 +32,8 @@
 #include "libavutil/parseutils.h"
 #include "libavutil/random_seed.h"
 #include "avfilter.h"
+#include "formats.h"
+#include "video.h"
 
 typedef struct {
     const AVClass *class;
@@ -431,7 +433,7 @@ static void fill_picture_rgb(AVFilterContext *ctx, AVFilterBufferRef *picref)
 static int request_frame(AVFilterLink *outlink)
 {
     LifeContext *life = outlink->src->priv;
-    AVFilterBufferRef *picref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, life->w, life->h);
+    AVFilterBufferRef *picref = ff_get_video_buffer(outlink, AV_PERM_WRITE, life->w, life->h);
     picref->video->sample_aspect_ratio = (AVRational) {1, 1};
     picref->pts = life->pts++;
     picref->pos = -1;
@@ -442,9 +444,9 @@ static int request_frame(AVFilterLink *outlink)
     show_life_grid(outlink->src);
 #endif
 
-    avfilter_start_frame(outlink, avfilter_ref_buffer(picref, ~0));
-    avfilter_draw_slice(outlink, 0, life->h, 1);
-    avfilter_end_frame(outlink);
+    ff_start_frame(outlink, avfilter_ref_buffer(picref, ~0));
+    ff_draw_slice(outlink, 0, life->h, 1);
+    ff_end_frame(outlink);
     avfilter_unref_buffer(picref);
 
     return 0;
@@ -462,7 +464,7 @@ static int query_formats(AVFilterContext *ctx)
         pix_fmts[0] = PIX_FMT_MONOBLACK;
         life->draw = fill_picture_monoblack;
     }
-    avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts));
+    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
     return 0;
 }
 
index 2ecb03d..1760570 100644 (file)
@@ -27,6 +27,8 @@
  */
 
 #include "avfilter.h"
+#include "formats.h"
+#include "video.h"
 #include "libavutil/imgutils.h"
 #include "libavutil/opt.h"
 #include "libavutil/parseutils.h"
@@ -161,7 +163,7 @@ static int query_formats(AVFilterContext *ctx)
         PIX_FMT_NONE
     };
 
-    avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts));
+    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
     return 0;
 }
 
@@ -385,15 +387,15 @@ static void draw_mandelbrot(AVFilterContext *ctx, uint32_t *color, int linesize,
 static int request_frame(AVFilterLink *link)
 {
     MBContext *mb = link->src->priv;
-    AVFilterBufferRef *picref = avfilter_get_video_buffer(link, AV_PERM_WRITE, mb->w, mb->h);
+    AVFilterBufferRef *picref = ff_get_video_buffer(link, AV_PERM_WRITE, mb->w, mb->h);
     picref->video->sample_aspect_ratio = (AVRational) {1, 1};
     picref->pts = mb->pts++;
     picref->pos = -1;
 
-    avfilter_start_frame(link, avfilter_ref_buffer(picref, ~0));
+    ff_start_frame(link, avfilter_ref_buffer(picref, ~0));
     draw_mandelbrot(link->src, (uint32_t*)picref->data[0], picref->linesize[0]/4, picref->pts);
-    avfilter_draw_slice(link, 0, mb->h, 1);
-    avfilter_end_frame(link);
+    ff_draw_slice(link, 0, mb->h, 1);
+    ff_end_frame(link);
     avfilter_unref_buffer(picref);
 
     return 0;
index 98c7988..c2ae5a1 100644 (file)
@@ -28,6 +28,8 @@
 #include "libavutil/parseutils.h"
 #include "libavutil/pixdesc.h"
 #include "avfilter.h"
+#include "formats.h"
+#include "video.h"
 
 #define WIDTH 512
 #define HEIGHT 512
@@ -320,7 +322,7 @@ static int query_formats(AVFilterContext *ctx)
         PIX_FMT_YUV420P, PIX_FMT_NONE
     };
 
-    avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts));
+    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
     return 0;
 }
 
@@ -334,7 +336,7 @@ static int request_frame(AVFilterLink *outlink)
 
     if (test->max_pts >= 0 && test->pts > test->max_pts)
         return AVERROR_EOF;
-    picref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, w, h);
+    picref = ff_get_video_buffer(outlink, AV_PERM_WRITE, w, h);
     picref->pts = test->pts++;
 
     // clean image
@@ -360,9 +362,9 @@ static int request_frame(AVFilterLink *outlink)
 
     test->frame_nb++;
 
-    avfilter_start_frame(outlink, avfilter_ref_buffer(picref, ~0));
-    avfilter_draw_slice(outlink, 0, picref->video->h, 1);
-    avfilter_end_frame(outlink);
+    ff_start_frame(outlink, avfilter_ref_buffer(picref, ~0));
+    ff_draw_slice(outlink, 0, picref->video->h, 1);
+    ff_end_frame(outlink);
     avfilter_unref_buffer(picref);
 
     return 0;