]> git.sesse.net Git - ffmpeg/commitdiff
lavfi: remove request/poll and drawing functions from public API on next bump
authorAnton Khirnov <anton@khirnov.net>
Wed, 30 May 2012 09:20:32 +0000 (11:20 +0200)
committerAnton Khirnov <anton@khirnov.net>
Tue, 5 Jun 2012 07:38:16 +0000 (09:38 +0200)
They are only useful inside filters and we don't allow user filters for
now.

45 files changed:
libavfilter/af_amix.c
libavfilter/af_asyncts.c
libavfilter/af_resample.c
libavfilter/avfilter.c
libavfilter/avfilter.h
libavfilter/buffersink.c
libavfilter/buffersrc.c
libavfilter/internal.h
libavfilter/split.c
libavfilter/vf_aspect.c
libavfilter/vf_blackframe.c
libavfilter/vf_boxblur.c
libavfilter/vf_crop.c
libavfilter/vf_cropdetect.c
libavfilter/vf_delogo.c
libavfilter/vf_drawbox.c
libavfilter/vf_drawtext.c
libavfilter/vf_fade.c
libavfilter/vf_fieldorder.c
libavfilter/vf_fifo.c
libavfilter/vf_fps.c
libavfilter/vf_frei0r.c
libavfilter/vf_gradfun.c
libavfilter/vf_hflip.c
libavfilter/vf_hqdn3d.c
libavfilter/vf_libopencv.c
libavfilter/vf_lut.c
libavfilter/vf_overlay.c
libavfilter/vf_pad.c
libavfilter/vf_pixdesctest.c
libavfilter/vf_scale.c
libavfilter/vf_select.c
libavfilter/vf_setpts.c
libavfilter/vf_settb.c
libavfilter/vf_showinfo.c
libavfilter/vf_slicify.c
libavfilter/vf_transpose.c
libavfilter/vf_unsharp.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 8f8ae3e340a9c86d632ad0738518f2468a4a0d30..3fc2e8499a4f971b28b035583237681af20b35fb 100644 (file)
@@ -349,7 +349,7 @@ static int request_samples(AVFilterContext *ctx, int min_samples)
         if (s->input_state[i] == INPUT_OFF)
             continue;
         while (!ret && av_audio_fifo_size(s->fifos[i]) < min_samples)
-            ret = avfilter_request_frame(ctx->inputs[i]);
+            ret = ff_request_frame(ctx->inputs[i]);
         if (ret == AVERROR_EOF) {
             if (av_audio_fifo_size(s->fifos[i]) == 0) {
                 s->input_state[i] = INPUT_OFF;
@@ -410,7 +410,7 @@ static int request_frame(AVFilterLink *outlink)
     }
 
     if (s->frame_list->nb_frames == 0) {
-        ret = avfilter_request_frame(ctx->inputs[0]);
+        ret = ff_request_frame(ctx->inputs[0]);
         if (ret == AVERROR_EOF) {
             s->input_state[0] = INPUT_OFF;
             if (s->nb_inputs == 1)
index adb5347a8005c8fcba632371f0aca546ea1b3c03..252b32278d7df24aabe20af8022cfd1780e0851c 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "audio.h"
 #include "avfilter.h"
+#include "internal.h"
 
 typedef struct ASyncContext {
     const AVClass *class;
@@ -116,7 +117,7 @@ static int request_frame(AVFilterLink *link)
 {
     AVFilterContext *ctx = link->src;
     ASyncContext      *s = ctx->priv;
-    int ret = avfilter_request_frame(ctx->inputs[0]);
+    int ret = ff_request_frame(ctx->inputs[0]);
     int nb_samples;
 
     /* flush the fifo */
index 6b1dfbc085cb38656b43facf3031535ec0b5c8eb..8a02cfe976a5db874c0d7ae00d997914dc1be17b 100644 (file)
@@ -130,7 +130,7 @@ static int request_frame(AVFilterLink *outlink)
 {
     AVFilterContext *ctx = outlink->src;
     ResampleContext   *s = ctx->priv;
-    int ret = avfilter_request_frame(ctx->inputs[0]);
+    int ret = ff_request_frame(ctx->inputs[0]);
 
     /* flush the lavr delay buffer */
     if (ret == AVERROR_EOF && s->avr) {
index 6b73e48d81a90ef3d64dec34a2ec05fd1e97db1b..3dbb6920eefedf5ee26eb15266d6687eb8bb3a3f 100644 (file)
@@ -223,18 +223,18 @@ void ff_dlog_link(void *ctx, AVFilterLink *link, int end)
     }
 }
 
-int avfilter_request_frame(AVFilterLink *link)
+int ff_request_frame(AVFilterLink *link)
 {
     FF_DPRINTF_START(NULL, request_frame); ff_dlog_link(NULL, link, 1);
 
     if (link->srcpad->request_frame)
         return link->srcpad->request_frame(link);
     else if (link->src->inputs[0])
-        return avfilter_request_frame(link->src->inputs[0]);
+        return ff_request_frame(link->src->inputs[0]);
     else return -1;
 }
 
-int avfilter_poll_frame(AVFilterLink *link)
+int ff_poll_frame(AVFilterLink *link)
 {
     int i, min = INT_MAX;
 
@@ -245,7 +245,7 @@ int avfilter_poll_frame(AVFilterLink *link)
         int val;
         if (!link->src->inputs[i])
             return -1;
-        val = avfilter_poll_frame(link->src->inputs[i]);
+        val = ff_poll_frame(link->src->inputs[i]);
         min = FFMIN(min, val);
     }
 
@@ -444,4 +444,12 @@ void avfilter_insert_outpad(AVFilterContext *f, unsigned index,
     ff_insert_pad(index, &f->output_count, offsetof(AVFilterLink, srcpad),
                   &f->output_pads, &f->outputs, p);
 }
+int avfilter_poll_frame(AVFilterLink *link)
+{
+    return ff_poll_frame(link);
+}
+int avfilter_request_frame(AVFilterLink *link)
+{
+    return ff_request_frame(link);
+}
 #endif
index 0f5a35fc737df6c1747bf20c21e2690c5dfa6338..c592372cedc5302e6bf7718e52c94f65769c0fe3 100644 (file)
@@ -620,57 +620,20 @@ AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_arrays(uint8_t **data,
                                                              enum AVSampleFormat sample_fmt,
                                                              uint64_t channel_layout);
 
-/**
- * Request an input frame from the filter at the other end of the link.
- *
- * @param link the input link
- * @return     zero on success
- */
+#if FF_API_FILTERS_PUBLIC
+attribute_deprecated
 int avfilter_request_frame(AVFilterLink *link);
 
-/**
- * Poll a frame from the filter chain.
- *
- * @param  link the input link
- * @return the number of immediately available frames, a negative
- * number in case of error
- */
+attribute_deprecated
 int avfilter_poll_frame(AVFilterLink *link);
 
-/**
- * Notify the next filter of the start of a frame.
- *
- * @param link   the output link the frame will be sent over
- * @param picref A reference to the frame about to be sent. The data for this
- *               frame need only be valid once draw_slice() is called for that
- *               portion. The receiving filter will free this reference when
- *               it no longer needs it.
- */
+attribute_deprecated
 void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref);
-
-/**
- * Notifie the next filter that the current frame has finished.
- *
- * @param link the output link the frame was sent over
- */
+attribute_deprecated
 void avfilter_end_frame(AVFilterLink *link);
-
-/**
- * Send a slice to the next filter.
- *
- * Slices have to be provided in sequential order, either in
- * top-bottom or bottom-top order. If slices are provided in
- * non-sequential order the behavior of the function is undefined.
- *
- * @param link the output link over which the frame is being sent
- * @param y    offset in pixels from the top of the image for this slice
- * @param h    height of this slice in pixels
- * @param slice_dir the assumed direction for sending slices,
- *             from the top slice to the bottom slice if the value is 1,
- *             from the bottom slice to the top slice if the value is -1,
- *             for other values the behavior of the function is undefined.
- */
+attribute_deprecated
 void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir);
+#endif
 
 /** Initialize the filter system. Register all builtin filters. */
 void avfilter_register_all(void);
index 8787268f4c63ab3cd00f2ebffcd84a80a72fae07..13fb2558c1924a94db47b4a45030b5c53826c84c 100644 (file)
@@ -31,6 +31,7 @@
 #include "audio.h"
 #include "avfilter.h"
 #include "buffersink.h"
+#include "internal.h"
 
 typedef struct {
     AVFifoBuffer *fifo;          ///< FIFO buffer of frame references
@@ -102,11 +103,11 @@ int av_buffersink_read(AVFilterContext *ctx, AVFilterBufferRef **buf)
         if (av_fifo_size(sink->fifo))
             return av_fifo_size(sink->fifo)/sizeof(*buf);
         else
-            return avfilter_poll_frame(ctx->inputs[0]);
+            return ff_poll_frame(ctx->inputs[0]);
     }
 
     if (!av_fifo_size(sink->fifo) &&
-        (ret = avfilter_request_frame(link)) < 0)
+        (ret = ff_request_frame(link)) < 0)
         return ret;
 
     if (!av_fifo_size(sink->fifo))
index f78b8f6eff741608f978cf48b691d021c47c7564..7af9f6c5713e0e61e88214239ca9a026994de195 100644 (file)
@@ -27,6 +27,7 @@
 #include "avfilter.h"
 #include "buffersrc.h"
 #include "formats.h"
+#include "video.h"
 #include "vsrc_buffer.h"
 
 #include "libavutil/audioconvert.h"
@@ -340,9 +341,9 @@ static int request_frame(AVFilterLink *link)
 
     switch (link->type) {
     case AVMEDIA_TYPE_VIDEO:
-        avfilter_start_frame(link, avfilter_ref_buffer(buf, ~0));
-        avfilter_draw_slice(link, 0, link->h, 1);
-        avfilter_end_frame(link);
+        ff_start_frame(link, avfilter_ref_buffer(buf, ~0));
+        ff_draw_slice(link, 0, link->h, 1);
+        ff_end_frame(link);
         break;
     case AVMEDIA_TYPE_AUDIO:
         ff_filter_samples(link, avfilter_ref_buffer(buf, ~0));
index 7f7cf4577199da3398ef753763a5ff15752ee14f..4b53831063dfc26b5992bf00299f10516f114ca9 100644 (file)
@@ -69,4 +69,21 @@ static inline void ff_insert_outpad(AVFilterContext *f, unsigned index,
                   &f->output_pads, &f->outputs, p);
 }
 
+/**
+ * Poll a frame from the filter chain.
+ *
+ * @param  link the input link
+ * @return the number of immediately available frames, a negative
+ * number in case of error
+ */
+int ff_poll_frame(AVFilterLink *link);
+
+/**
+ * Request an input frame from the filter at the other end of the link.
+ *
+ * @param link the input link
+ * @return     zero on success
+ */
+int ff_request_frame(AVFilterLink *link);
+
 #endif /* AVFILTER_INTERNAL_H */
index 9f7890cde63224394fe0e45d45a8e052a04279c8..95c1b9aa1fb852ed25c6564f608c8a292d9290fc 100644 (file)
@@ -69,8 +69,8 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
     int i;
 
     for (i = 0; i < ctx->output_count; i++)
-        avfilter_start_frame(ctx->outputs[i],
-                             avfilter_ref_buffer(picref, ~AV_PERM_WRITE));
+        ff_start_frame(ctx->outputs[i],
+                       avfilter_ref_buffer(picref, ~AV_PERM_WRITE));
 }
 
 static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
@@ -79,7 +79,7 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
     int i;
 
     for (i = 0; i < ctx->output_count; i++)
-        avfilter_draw_slice(ctx->outputs[i], y, h, slice_dir);
+        ff_draw_slice(ctx->outputs[i], y, h, slice_dir);
 }
 
 static void end_frame(AVFilterLink *inlink)
@@ -88,7 +88,7 @@ static void end_frame(AVFilterLink *inlink)
     int i;
 
     for (i = 0; i < ctx->output_count; i++)
-        avfilter_end_frame(ctx->outputs[i]);
+        ff_end_frame(ctx->outputs[i]);
 
     avfilter_unref_buffer(inlink->cur_buf);
 }
index 4e1fdac90eda7596024e4d24b479c64a81c8c66e..0555afe4c0ac1eca76d81ef7115566d861810af1 100644 (file)
@@ -68,7 +68,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
     AspectContext *aspect = link->dst->priv;
 
     picref->video->pixel_aspect = aspect->aspect;
-    avfilter_start_frame(link->dst->outputs[0], picref);
+    ff_start_frame(link->dst->outputs[0], picref);
 }
 
 #if CONFIG_SETDAR_FILTER
index bdc132285e4126938112c906ebcd9368bd76b491..1d9a75d502cf4f12a1be06d463840b403bd17b0a 100644 (file)
@@ -87,7 +87,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)
@@ -105,7 +105,7 @@ static void end_frame(AVFilterLink *inlink)
 
     blackframe->frame++;
     blackframe->nblack = 0;
-    avfilter_end_frame(inlink->dst->outputs[0]);
+    ff_end_frame(inlink->dst->outputs[0]);
 }
 
 AVFilter avfilter_vf_blackframe = {
index 04486ce1a854401d9334e0d8d65169634ce2bc76..21a0173ccb9a5eeb868f1dd8b6d691dfc8e073bc 100644 (file)
@@ -30,6 +30,7 @@
 #include "libavutil/pixdesc.h"
 #include "avfilter.h"
 #include "formats.h"
+#include "video.h"
 
 static const char *const var_names[] = {
     "w",
@@ -328,7 +329,7 @@ static void draw_slice(AVFilterLink *inlink, int y0, int h0, int slice_dir)
               w[plane], h[plane], boxblur->radius[plane], boxblur->power[plane],
               boxblur->temp);
 
-    avfilter_draw_slice(outlink, y0, h0, slice_dir);
+    ff_draw_slice(outlink, y0, h0, slice_dir);
 }
 
 AVFilter avfilter_vf_boxblur = {
index cb8b94ef7ee20e08c563b131439e3b009bf210a6..f25278e79e7a41013daada8311308139fa5fd7ea 100644 (file)
@@ -290,7 +290,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
         ref2->data[3] += crop->x * crop->max_step[3];
     }
 
-    avfilter_start_frame(link->dst->outputs[0], ref2);
+    ff_start_frame(link->dst->outputs[0], ref2);
 }
 
 static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
@@ -308,7 +308,7 @@ static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
     if (y + h > crop->y + crop->h)
         h = crop->y + crop->h - y;
 
-    avfilter_draw_slice(ctx->outputs[0], y - crop->y, h, slice_dir);
+    ff_draw_slice(ctx->outputs[0], y - crop->y, h, slice_dir);
 }
 
 static void end_frame(AVFilterLink *link)
@@ -317,7 +317,7 @@ static void end_frame(AVFilterLink *link)
 
     crop->var_values[VAR_N] += 1.0;
     avfilter_unref_buffer(link->cur_buf);
-    avfilter_end_frame(link->dst->outputs[0]);
+    ff_end_frame(link->dst->outputs[0]);
 }
 
 AVFilter avfilter_vf_crop = {
index 20bc219d816a9a2c76bd39905dc015c5f7a940fa..38fd5c13558db7c28f79c73d9d70f4674f7d46c3 100644 (file)
@@ -190,7 +190,7 @@ static void end_frame(AVFilterLink *inlink)
                w, h, x, y);
     }
 
-    avfilter_end_frame(inlink->dst->outputs[0]);
+    ff_end_frame(inlink->dst->outputs[0]);
 }
 
 AVFilter avfilter_vf_cropdetect = {
index 3410982b6365e86262a118e676b6f7892bdd3ae3..6fe47306eafee978246d055ab3cbabea23ba6f84 100644 (file)
@@ -228,7 +228,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 null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) { }
@@ -257,8 +257,8 @@ static void end_frame(AVFilterLink *inlink)
                      delogo->show, direct);
     }
 
-    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);
index 46ce6979a0ea8e3ba03e139ee36d9126940a54d9..47db0490a7e2cf0d0f6ac5b8ef0b8559146f69db 100644 (file)
@@ -119,7 +119,7 @@ static void draw_slice(AVFilterLink *inlink, int y0, int h, int slice_dir)
         }
     }
 
-    avfilter_draw_slice(inlink->dst->outputs[0], y0, h, 1);
+    ff_draw_slice(inlink->dst->outputs[0], y0, h, 1);
 }
 
 AVFilter avfilter_vf_drawbox = {
index 92f14a7ba8c66a3004e398de034786e1f2186535..411bcbc78112b80eb3752de80371d10a89750b8e 100644 (file)
@@ -849,7 +849,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
             (int)dtext->var_values[VAR_N], dtext->var_values[VAR_T],
             dtext->x, dtext->y, dtext->x+dtext->w, dtext->y+dtext->h);
 
-    avfilter_start_frame(inlink->dst->outputs[0], inpicref);
+    ff_start_frame(inlink->dst->outputs[0], inpicref);
 }
 
 static void end_frame(AVFilterLink *inlink)
@@ -863,8 +863,8 @@ static void end_frame(AVFilterLink *inlink)
 
     dtext->var_values[VAR_N] += 1.0;
 
-    avfilter_draw_slice(outlink, 0, picref->video->h, 1);
-    avfilter_end_frame(outlink);
+    ff_draw_slice(outlink, 0, picref->video->h, 1);
+    ff_end_frame(outlink);
 }
 
 AVFilter avfilter_vf_drawtext = {
index 8bd4074592804b74d3f04a0d7adba502ac7de596..6b9cb66fe64c55d1d5f043001427490726b776d2 100644 (file)
@@ -133,14 +133,14 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
         }
     }
 
-    avfilter_draw_slice(inlink->dst->outputs[0], y, h, slice_dir);
+    ff_draw_slice(inlink->dst->outputs[0], y, h, slice_dir);
 }
 
 static void end_frame(AVFilterLink *inlink)
 {
     FadeContext *fade = inlink->dst->priv;
 
-    avfilter_end_frame(inlink->dst->outputs[0]);
+    ff_end_frame(inlink->dst->outputs[0]);
 
     if (fade->frame_index >= fade->start_frame &&
         fade->frame_index <= fade->stop_frame)
index d975aab97431ad302c6196f984f86f98ecaf9772..ff1e332572f810979a63204f5e2361b9f53e60ef 100644 (file)
@@ -29,6 +29,7 @@
 #include "libavutil/pixdesc.h"
 #include "avfilter.h"
 #include "formats.h"
+#include "video.h"
 
 typedef struct
 {
@@ -124,7 +125,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
     outpicref = avfilter_ref_buffer(inpicref, ~0);
     outlink->out_buf = outpicref;
 
-    avfilter_start_frame(outlink, outpicref);
+    ff_start_frame(outlink, outpicref);
 }
 
 static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
@@ -141,7 +142,7 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
      *  and that complexity will be added later */
     if (  !inpicref->video->interlaced
         || inpicref->video->top_field_first == fieldorder->dst_tff) {
-        avfilter_draw_slice(outlink, y, h, slice_dir);
+        ff_draw_slice(outlink, y, h, slice_dir);
     }
 }
 
@@ -203,13 +204,13 @@ static void end_frame(AVFilterLink *inlink)
             }
         }
         outpicref->video->top_field_first = fieldorder->dst_tff;
-        avfilter_draw_slice(outlink, 0, h, 1);
+        ff_draw_slice(outlink, 0, h, 1);
     } else {
         av_dlog(ctx,
                 "not interlaced or field order already correct\n");
     }
 
-    avfilter_end_frame(outlink);
+    ff_end_frame(outlink);
     avfilter_unref_buffer(inpicref);
 }
 
index b99cec38dc52f0e8cad3ff6127ac69fde4938357..1785946a4f551e93e36c9da51122974473b93efd 100644 (file)
@@ -24,6 +24,7 @@
  */
 
 #include "avfilter.h"
+#include "internal.h"
 #include "video.h"
 
 typedef struct BufPic {
@@ -77,15 +78,15 @@ static int request_frame(AVFilterLink *outlink)
     int ret;
 
     if (!fifo->root.next) {
-        if ((ret = avfilter_request_frame(outlink->src->inputs[0]) < 0))
+        if ((ret = ff_request_frame(outlink->src->inputs[0]) < 0))
             return ret;
     }
 
     /* by doing this, we give ownership of the reference to the next filter,
      * so we don't have to worry about dereferencing it ourselves. */
-    avfilter_start_frame(outlink, fifo->root.next->picref);
-    avfilter_draw_slice (outlink, 0, outlink->h, 1);
-    avfilter_end_frame  (outlink);
+    ff_start_frame(outlink, fifo->root.next->picref);
+    ff_draw_slice (outlink, 0, outlink->h, 1);
+    ff_end_frame  (outlink);
 
     if (fifo->last == fifo->root.next)
         fifo->last = &fifo->root;
index da38af299b41a6414212118c76b57187c0f4ab70..18cd51a9a84a2fc177dc6ef26a7364c0626b6e7f 100644 (file)
@@ -27,6 +27,8 @@
 #include "libavutil/parseutils.h"
 
 #include "avfilter.h"
+#include "internal.h"
+#include "video.h"
 
 typedef struct FPSContext {
     const AVClass *class;
@@ -129,7 +131,7 @@ static int request_frame(AVFilterLink *outlink)
     int ret = 0;
 
     while (ret >= 0 && s->frames_out == frames_out)
-        ret = avfilter_request_frame(ctx->inputs[0]);
+        ret = ff_request_frame(ctx->inputs[0]);
 
     /* flush the fifo */
     if (ret == AVERROR_EOF && av_fifo_size(s->fifo)) {
@@ -141,9 +143,9 @@ static int request_frame(AVFilterLink *outlink)
             buf->pts = av_rescale_q(s->first_pts, ctx->inputs[0]->time_base,
                                     outlink->time_base) + s->frames_out;
 
-            avfilter_start_frame(outlink, buf);
-            avfilter_draw_slice(outlink, 0, outlink->h, 1);
-            avfilter_end_frame(outlink);
+            ff_start_frame(outlink, buf);
+            ff_draw_slice(outlink, 0, outlink->h, 1);
+            ff_end_frame(outlink);
             s->frames_out++;
         }
         return 0;
@@ -229,9 +231,9 @@ static void end_frame(AVFilterLink *inlink)
         buf_out->pts = av_rescale_q(s->first_pts, inlink->time_base,
                                     outlink->time_base) + s->frames_out;
 
-        avfilter_start_frame(outlink, buf_out);
-        avfilter_draw_slice(outlink, 0, outlink->h, 1);
-        avfilter_end_frame(outlink);
+        ff_start_frame(outlink, buf_out);
+        ff_draw_slice(outlink, 0, outlink->h, 1);
+        ff_end_frame(outlink);
         s->frames_out++;
     }
     flush_fifo(s->fifo);
index 4dd6fbef090bc1be806b323a8d2d0dd2f991fc41..85b420555988f180e7f99cb3e340215c734a4bf8 100644 (file)
@@ -32,6 +32,7 @@
 #include "libavutil/parseutils.h"
 #include "avfilter.h"
 #include "formats.h"
+#include "video.h"
 
 typedef f0r_instance_t (*f0r_construct_f)(unsigned int width, unsigned int height);
 typedef void (*f0r_destruct_f)(f0r_instance_t instance);
@@ -351,8 +352,8 @@ static void end_frame(AVFilterLink *inlink)
                    (const uint32_t *)inpicref->data[0],
                    (uint32_t *)outpicref->data[0]);
     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);
 }
 
@@ -436,11 +437,11 @@ static int source_request_frame(AVFilterLink *outlink)
     picref->pts = frei0r->pts++;
     picref->pos = -1;
 
-    avfilter_start_frame(outlink, avfilter_ref_buffer(picref, ~0));
+    ff_start_frame(outlink, avfilter_ref_buffer(picref, ~0));
     frei0r->update(frei0r->instance, av_rescale_q(picref->pts, frei0r->time_base, (AVRational){1,1000}),
                    NULL, (uint32_t *)picref->data[0]);
-    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(picref);
 
     return 0;
index b61c06317c5d76b6c81862b02dae01b7a7d4ee8c..7fde16d41b1efcb2affb31789e21fe3f5955bdcd 100644 (file)
@@ -38,6 +38,7 @@
 #include "avfilter.h"
 #include "formats.h"
 #include "gradfun.h"
+#include "video.h"
 
 DECLARE_ALIGNED(16, static const uint16_t, dither)[8][8] = {
     {0x00,0x60,0x18,0x78,0x06,0x66,0x1E,0x7E},
@@ -197,7 +198,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 null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) { }
@@ -226,8 +227,8 @@ static void end_frame(AVFilterLink *inlink)
             av_image_copy_plane(outpic->data[p], outpic->linesize[p], inpic->data[p], inpic->linesize[p], w, h);
     }
 
-    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(inpic);
     if (outpic != inpic)
         avfilter_unref_buffer(outpic);
index 5e87a7dc133425b62cf2aad7cf1cc976eb44c7e4..aff0f8c5d33fe88f013d9e50c3b48a3a47207b09 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "avfilter.h"
 #include "formats.h"
+#include "video.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/imgutils.h"
@@ -140,7 +141,7 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
         }
     }
 
-    avfilter_draw_slice(inlink->dst->outputs[0], y, h, slice_dir);
+    ff_draw_slice(inlink->dst->outputs[0], y, h, slice_dir);
 }
 
 AVFilter avfilter_vf_hflip = {
index 51de0d8de6101b778d9d159c20c1eb9578ebfe19..0a26dd001747beb97e06f0519694e84cc25479aa 100644 (file)
@@ -28,6 +28,7 @@
 #include "libavutil/pixdesc.h"
 #include "avfilter.h"
 #include "formats.h"
+#include "video.h"
 
 typedef struct {
     int Coefs[4][512*16];
@@ -318,8 +319,8 @@ static void end_frame(AVFilterLink *inlink)
             hqdn3d->Coefs[2],
             hqdn3d->Coefs[3]);
 
-    avfilter_draw_slice(outlink, 0, inpic->video->h, 1);
-    avfilter_end_frame(outlink);
+    ff_draw_slice(outlink, 0, inpic->video->h, 1);
+    ff_end_frame(outlink);
     avfilter_unref_buffer(inpic);
     avfilter_unref_buffer(outpic);
 }
index 2bbbb6a3735b52916d0d362be7367b1eb9639896..b6dcd191ae6ff3eae9875d690d13e6c238291d94 100644 (file)
@@ -364,8 +364,8 @@ static void end_frame(AVFilterLink *inlink)
     fill_picref_from_iplimage(outpicref, &outimg, inlink->format);
 
     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 29f8b3ce780c2397e90537e7dd159d44bdef31fd..38172289606ccccc2d886fbb211fb939c9eb9115 100644 (file)
@@ -31,6 +31,7 @@
 #include "avfilter.h"
 #include "formats.h"
 #include "internal.h"
+#include "video.h"
 
 static const char *const var_names[] = {
     "E",
@@ -338,7 +339,7 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
         }
     }
 
-    avfilter_draw_slice(outlink, y, h, slice_dir);
+    ff_draw_slice(outlink, y, h, slice_dir);
 }
 
 #define DEFINE_LUT_FILTER(name_, description_, init_)                   \
index 571d48dfad28def1d3a352ed51198c719422815d..55f1cc3a14726417b517aa26d02f61c57de3aceb 100644 (file)
@@ -33,6 +33,7 @@
 #include "libavutil/imgutils.h"
 #include "libavutil/mathematics.h"
 #include "internal.h"
+#include "video.h"
 
 static const char *const var_names[] = {
     "E",
@@ -220,7 +221,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
     if (!over->overpicref || over->overpicref->pts < outpicref->pts) {
         AVFilterBufferRef *old = over->overpicref;
         over->overpicref = NULL;
-        avfilter_request_frame(ctx->inputs[OVERLAY]);
+        ff_request_frame(ctx->inputs[OVERLAY]);
         if (over->overpicref) {
             if (old)
                 avfilter_unref_buffer(old);
@@ -228,7 +229,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
             over->overpicref = old;
     }
 
-    avfilter_start_frame(inlink->dst->outputs[0], outpicref);
+    ff_start_frame(inlink->dst->outputs[0], outpicref);
 }
 
 static void start_frame_overlay(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
@@ -333,12 +334,12 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
                     over->overpicref->video->w, over->overpicref->video->h,
                     y, outpicref->video->w, h);
     }
-    avfilter_draw_slice(outlink, y, h, slice_dir);
+    ff_draw_slice(outlink, y, h, slice_dir);
 }
 
 static void end_frame(AVFilterLink *inlink)
 {
-    avfilter_end_frame(inlink->dst->outputs[0]);
+    ff_end_frame(inlink->dst->outputs[0]);
     avfilter_unref_buffer(inlink->cur_buf);
 }
 
@@ -350,12 +351,12 @@ static int poll_frame(AVFilterLink *link)
 {
     AVFilterContext   *s = link->src;
     OverlayContext *over = s->priv;
-    int ret = avfilter_poll_frame(s->inputs[OVERLAY]);
+    int ret = ff_poll_frame(s->inputs[OVERLAY]);
 
     if (ret == AVERROR_EOF)
         ret = !!over->overpicref;
 
-    return ret && avfilter_poll_frame(s->inputs[MAIN]);
+    return ret && ff_poll_frame(s->inputs[MAIN]);
 }
 
 AVFilter avfilter_vf_overlay = {
index 1091a212d0934e8f5842e8bf832b25642ad84550..2e98aea028631e5f691cb1e861a0979e885c8f2a 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "avfilter.h"
 #include "formats.h"
+#include "video.h"
 #include "libavutil/avstring.h"
 #include "libavutil/eval.h"
 #include "libavutil/pixdesc.h"
@@ -337,12 +338,12 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
     outpicref->video->w = pad->w;
     outpicref->video->h = pad->h;
 
-    avfilter_start_frame(inlink->dst->outputs[0], outpicref);
+    ff_start_frame(inlink->dst->outputs[0], outpicref);
 }
 
 static void end_frame(AVFilterLink *link)
 {
-    avfilter_end_frame(link->dst->outputs[0]);
+    ff_end_frame(link->dst->outputs[0]);
     avfilter_unref_buffer(link->cur_buf);
 }
 
@@ -366,7 +367,7 @@ static void draw_send_bar_slice(AVFilterLink *link, int y, int h, int slice_dir,
                           link->dst->outputs[0]->out_buf->linesize,
                           pad->line, pad->line_step, pad->hsub, pad->vsub,
                           0, bar_y, pad->w, bar_h);
-        avfilter_draw_slice(link->dst->outputs[0], bar_y, bar_h, slice_dir);
+        ff_draw_slice(link->dst->outputs[0], bar_y, bar_h, slice_dir);
     }
 }
 
@@ -400,7 +401,7 @@ static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
     ff_draw_rectangle(outpic->data, outpic->linesize,
                       pad->line, pad->line_step, pad->hsub, pad->vsub,
                       pad->x + pad->in_w, y, pad->w - pad->x - pad->in_w, h);
-    avfilter_draw_slice(link->dst->outputs[0], y, h, slice_dir);
+    ff_draw_slice(link->dst->outputs[0], y, h, slice_dir);
 
     draw_send_bar_slice(link, y, h, slice_dir, -1);
 }
index cf7dfeda3e69ae3c9f82368409cf5a02c26e70d2..7eecdc0bb171d449a9fde3df2eefa83ab2b206df 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "libavutil/pixdesc.h"
 #include "avfilter.h"
+#include "video.h"
 
 typedef struct {
     const AVPixFmtDescriptor *pix_desc;
@@ -76,7 +77,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
         priv->pix_desc->flags & PIX_FMT_PSEUDOPAL)
         memcpy(outpicref->data[1], outpicref->data[1], 256*4);
 
-    avfilter_start_frame(outlink, avfilter_ref_buffer(outpicref, ~0));
+    ff_start_frame(outlink, avfilter_ref_buffer(outpicref, ~0));
 }
 
 static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
@@ -106,7 +107,7 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
         }
     }
 
-    avfilter_draw_slice(inlink->dst->outputs[0], y, h, slice_dir);
+    ff_draw_slice(inlink->dst->outputs[0], y, h, slice_dir);
 }
 
 AVFilter avfilter_vf_pixdesctest = {
index 82a3181cb5a86bfab1b055451d3b0c2cce54213c..6f33848f202f443845fc2f379179934b1e251b16 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "avfilter.h"
 #include "formats.h"
+#include "video.h"
 #include "libavutil/avstring.h"
 #include "libavutil/eval.h"
 #include "libavutil/mathematics.h"
@@ -257,7 +258,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
     AVFilterBufferRef *outpicref;
 
     if (!scale->sws) {
-        avfilter_start_frame(outlink, avfilter_ref_buffer(picref, ~0));
+        ff_start_frame(outlink, avfilter_ref_buffer(picref, ~0));
         return;
     }
 
@@ -277,7 +278,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
               INT_MAX);
 
     scale->slice_y = 0;
-    avfilter_start_frame(outlink, avfilter_ref_buffer(outpicref, ~0));
+    ff_start_frame(outlink, avfilter_ref_buffer(outpicref, ~0));
 }
 
 static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
@@ -288,7 +289,7 @@ static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
     const uint8_t *data[4];
 
     if (!scale->sws) {
-        avfilter_draw_slice(link->dst->outputs[0], y, h, slice_dir);
+        ff_draw_slice(link->dst->outputs[0], y, h, slice_dir);
         return;
     }
 
@@ -308,7 +309,7 @@ static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
 
     if (slice_dir == -1)
         scale->slice_y -= out_h;
-    avfilter_draw_slice(link->dst->outputs[0], scale->slice_y, out_h, slice_dir);
+    ff_draw_slice(link->dst->outputs[0], scale->slice_y, out_h, slice_dir);
     if (slice_dir == 1)
         scale->slice_y += out_h;
 }
index 2b6b49c15386da6d1871278c0150734a41c7b7a7..dab47ced85b653845f8980e4586ef7f1ef512922 100644 (file)
@@ -27,6 +27,7 @@
 #include "libavutil/fifo.h"
 #include "libavutil/mathematics.h"
 #include "avfilter.h"
+#include "internal.h"
 #include "video.h"
 
 static const char *const var_names[] = {
@@ -242,7 +243,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
                                       sizeof(picref), NULL);
             return;
         }
-        avfilter_start_frame(inlink->dst->outputs[0], avfilter_ref_buffer(picref, ~0));
+        ff_start_frame(inlink->dst->outputs[0], avfilter_ref_buffer(picref, ~0));
     }
 }
 
@@ -251,7 +252,7 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
     SelectContext *select = inlink->dst->priv;
 
     if (select->select && !select->cache_frames)
-        avfilter_draw_slice(inlink->dst->outputs[0], y, h, slice_dir);
+        ff_draw_slice(inlink->dst->outputs[0], y, h, slice_dir);
 }
 
 static void end_frame(AVFilterLink *inlink)
@@ -262,7 +263,7 @@ static void end_frame(AVFilterLink *inlink)
     if (select->select) {
         if (select->cache_frames)
             return;
-        avfilter_end_frame(inlink->dst->outputs[0]);
+        ff_end_frame(inlink->dst->outputs[0]);
     }
     avfilter_unref_buffer(picref);
 }
@@ -277,15 +278,15 @@ static int request_frame(AVFilterLink *outlink)
     if (av_fifo_size(select->pending_frames)) {
         AVFilterBufferRef *picref;
         av_fifo_generic_read(select->pending_frames, &picref, sizeof(picref), NULL);
-        avfilter_start_frame(outlink, avfilter_ref_buffer(picref, ~0));
-        avfilter_draw_slice(outlink, 0, outlink->h, 1);
-        avfilter_end_frame(outlink);
+        ff_start_frame(outlink, avfilter_ref_buffer(picref, ~0));
+        ff_draw_slice(outlink, 0, outlink->h, 1);
+        ff_end_frame(outlink);
         avfilter_unref_buffer(picref);
         return 0;
     }
 
     while (!select->select) {
-        int ret = avfilter_request_frame(inlink);
+        int ret = ff_request_frame(inlink);
         if (ret < 0)
             return ret;
     }
@@ -300,12 +301,12 @@ static int poll_frame(AVFilterLink *outlink)
     int count, ret;
 
     if (!av_fifo_size(select->pending_frames)) {
-        if ((count = avfilter_poll_frame(inlink)) <= 0)
+        if ((count = ff_poll_frame(inlink)) <= 0)
             return count;
         /* request frame from input, and apply select condition to it */
         select->cache_frames = 1;
         while (count-- && av_fifo_space(select->pending_frames)) {
-            ret = avfilter_request_frame(inlink);
+            ret = ff_request_frame(inlink);
             if (ret < 0)
                 break;
         }
index 103f2657821dc089d3b77094eafd0611d05815fb..d30385168684aa8070c2bb580f72d4a3f6f9e14a 100644 (file)
@@ -129,7 +129,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
     setpts->var_values[VAR_N] += 1.0;
     setpts->var_values[VAR_PREV_INPTS ] = TS2D(inpicref ->pts);
     setpts->var_values[VAR_PREV_OUTPTS] = TS2D(outpicref->pts);
-    avfilter_start_frame(inlink->dst->outputs[0], outpicref);
+    ff_start_frame(inlink->dst->outputs[0], outpicref);
 }
 
 static av_cold void uninit(AVFilterContext *ctx)
index b40ede87cb074d4304ac958799450ece7d70aad2..78d4617526ad2d7c28f69c8a986648d283c14769 100644 (file)
@@ -119,7 +119,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
         avfilter_unref_buffer(picref);
     }
 
-    avfilter_start_frame(outlink, picref2);
+    ff_start_frame(outlink, picref2);
 }
 
 AVFilter avfilter_vf_settb = {
index 0475f9bf90d6c9dd2dc4360cf5a7be9a0ef0e50e..1a8f16e2c308e8752c7f0350ebf672c05df41406 100644 (file)
@@ -75,7 +75,7 @@ static void end_frame(AVFilterLink *inlink)
            checksum, plane_checksum[0], plane_checksum[1], plane_checksum[2], plane_checksum[3]);
 
     showinfo->frame++;
-    avfilter_end_frame(inlink->dst->outputs[0]);
+    ff_end_frame(inlink->dst->outputs[0]);
 }
 
 AVFilter avfilter_vf_showinfo = {
index 31d74979af97c060cb10764c7e32fb7f4bd35d10..fdc10bea9d2c09f2433ec7a23b3d431868926f82 100644 (file)
@@ -73,7 +73,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
 
     av_log(link->dst, AV_LOG_DEBUG, "h:%d\n", slice->h);
 
-    avfilter_start_frame(link->dst->outputs[0], picref);
+    ff_start_frame(link->dst->outputs[0], picref);
 }
 
 static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
@@ -83,16 +83,16 @@ static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
 
     if (slice_dir == 1) {
         for (y2 = y; y2 + slice->h <= y + h; y2 += slice->h)
-            avfilter_draw_slice(link->dst->outputs[0], y2, slice->h, slice_dir);
+            ff_draw_slice(link->dst->outputs[0], y2, slice->h, slice_dir);
 
         if (y2 < y + h)
-            avfilter_draw_slice(link->dst->outputs[0], y2, y + h - y2, slice_dir);
+            ff_draw_slice(link->dst->outputs[0], y2, y + h - y2, slice_dir);
     } else if (slice_dir == -1) {
         for (y2 = y + h; y2 - slice->h >= y; y2 -= slice->h)
-            avfilter_draw_slice(link->dst->outputs[0], y2 - slice->h, slice->h, slice_dir);
+            ff_draw_slice(link->dst->outputs[0], y2 - slice->h, slice->h, slice_dir);
 
         if (y2 > y)
-            avfilter_draw_slice(link->dst->outputs[0], y, y2 - y, slice_dir);
+            ff_draw_slice(link->dst->outputs[0], y, y2 - y, slice_dir);
     }
 }
 
index 78010668241e9bb6e55e8c5d5fa2ba631ab1ed2c..5e5feda85f3e927e92909277f9d76647d231e8ea 100644 (file)
@@ -30,6 +30,7 @@
 #include "libavutil/imgutils.h"
 #include "avfilter.h"
 #include "formats.h"
+#include "video.h"
 
 typedef struct {
     int hsub, vsub;
@@ -130,7 +131,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
         outlink->out_buf->video->pixel_aspect.den = picref->video->pixel_aspect.num;
     }
 
-    avfilter_start_frame(outlink, avfilter_ref_buffer(outlink->out_buf, ~0));
+    ff_start_frame(outlink, avfilter_ref_buffer(outlink->out_buf, ~0));
 }
 
 static void end_frame(AVFilterLink *inlink)
@@ -191,8 +192,8 @@ static void end_frame(AVFilterLink *inlink)
     }
 
     avfilter_unref_buffer(inpic);
-    avfilter_draw_slice(outlink, 0, outpic->video->h, 1);
-    avfilter_end_frame(outlink);
+    ff_draw_slice(outlink, 0, outpic->video->h, 1);
+    ff_end_frame(outlink);
     avfilter_unref_buffer(outpic);
 }
 
index 9c0809f331c72efa413bb5c84dbb6caedbadaa97..a5d301cd722cfd21f8fe722d065a83442adfbeaa 100644 (file)
@@ -38,6 +38,7 @@
 
 #include "avfilter.h"
 #include "formats.h"
+#include "video.h"
 #include "libavutil/common.h"
 #include "libavutil/mem.h"
 #include "libavutil/pixdesc.h"
@@ -224,8 +225,8 @@ static void end_frame(AVFilterLink *link)
     apply_unsharp(out->data[2], out->linesize[2], in->data[2], in->linesize[2], cw,      ch,      &unsharp->chroma);
 
     avfilter_unref_buffer(in);
-    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 a7f14c0775d47bddf7836c46ea906f21e49c1d38..6d2f42ed5dfb40ac8b02a4e120bc5d5c55381caf 100644 (file)
@@ -78,14 +78,14 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *inpicref)
         }
     }
 
-    avfilter_start_frame(link->dst->outputs[0], outpicref);
+    ff_start_frame(link->dst->outputs[0], outpicref);
 }
 
 static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
 {
     AVFilterContext *ctx = link->dst;
 
-    avfilter_draw_slice(ctx->outputs[0], link->h - (y+h), h, -1 * slice_dir);
+    ff_draw_slice(ctx->outputs[0], link->h - (y+h), h, -1 * slice_dir);
 }
 
 AVFilter avfilter_vf_vflip = {
index 694b98476476822199ac93a1e733dc752de9c600..b498ab9d392bf80fb8921f973eb3a283d1345f2c 100644 (file)
@@ -24,6 +24,7 @@
 #include "libavutil/pixdesc.h"
 #include "avfilter.h"
 #include "formats.h"
+#include "internal.h"
 #include "video.h"
 #include "yadif.h"
 
@@ -229,10 +230,10 @@ static void return_frame(AVFilterContext *ctx, int is_second)
         } else {
             yadif->out->pts = AV_NOPTS_VALUE;
         }
-        avfilter_start_frame(ctx->outputs[0], yadif->out);
+        ff_start_frame(ctx->outputs[0], yadif->out);
     }
-    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]);
 
     yadif->frame_pending = (yadif->mode&1) && !is_second;
 }
@@ -260,7 +261,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
         yadif->prev = NULL;
         if (yadif->out->pts != AV_NOPTS_VALUE)
             yadif->out->pts *= 2;
-        avfilter_start_frame(ctx->outputs[0], yadif->out);
+        ff_start_frame(ctx->outputs[0], yadif->out);
         return;
     }
 
@@ -274,7 +275,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
     yadif->out->video->interlaced = 0;
     if (yadif->out->pts != AV_NOPTS_VALUE)
         yadif->out->pts *= 2;
-    avfilter_start_frame(ctx->outputs[0], yadif->out);
+    ff_start_frame(ctx->outputs[0], yadif->out);
 }
 
 static void end_frame(AVFilterLink *link)
@@ -286,8 +287,8 @@ static void end_frame(AVFilterLink *link)
         return;
 
     if (yadif->auto_enable && !yadif->cur->video->interlaced) {
-        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]);
         return;
     }
 
@@ -310,7 +311,7 @@ static int request_frame(AVFilterLink *link)
         if (yadif->eof)
             return AVERROR_EOF;
 
-        ret  = avfilter_request_frame(link->src->inputs[0]);
+        ret  = ff_request_frame(link->src->inputs[0]);
 
         if (ret == AVERROR_EOF && yadif->next) {
             AVFilterBufferRef *next = avfilter_ref_buffer(yadif->next, AV_PERM_READ);
@@ -335,14 +336,14 @@ static int poll_frame(AVFilterLink *link)
     if (yadif->frame_pending)
         return 1;
 
-    val = avfilter_poll_frame(link->src->inputs[0]);
+    val = ff_poll_frame(link->src->inputs[0]);
     if (val <= 0)
         return val;
 
     if (val==1 && !yadif->next) { //FIXME change API to not requre this red tape
-        if ((ret = avfilter_request_frame(link->src->inputs[0])) < 0)
+        if ((ret = ff_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]);
         if (val <= 0)
             return val;
     }
index 6a19388f6eb5ce25582cd76812bca327b544258d..33082a148240a06938f97f2f237ba48d6b1d3468 100644 (file)
@@ -162,7 +162,7 @@ AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int
 
 void ff_null_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
 {
-    avfilter_start_frame(link->dst->outputs[0], picref);
+    ff_start_frame(link->dst->outputs[0], picref);
 }
 
 static void default_start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
@@ -175,13 +175,13 @@ static void default_start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
     if (outlink) {
         outlink->out_buf = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
         avfilter_copy_buffer_ref_props(outlink->out_buf, picref);
-        avfilter_start_frame(outlink, avfilter_ref_buffer(outlink->out_buf, ~0));
+        ff_start_frame(outlink, avfilter_ref_buffer(outlink->out_buf, ~0));
     }
 }
 
 /* XXX: should we do the duplicating of the picture ref here, instead of
  * forcing the source filter to do it? */
-void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
+void ff_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
 {
     void (*start_frame)(AVFilterLink *, AVFilterBufferRef *);
     AVFilterPad *dst = link->dstpad;
@@ -213,7 +213,7 @@ void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
 
 void ff_null_end_frame(AVFilterLink *link)
 {
-    avfilter_end_frame(link->dst->outputs[0]);
+    ff_end_frame(link->dst->outputs[0]);
 }
 
 static void default_end_frame(AVFilterLink *inlink)
@@ -231,11 +231,11 @@ static void default_end_frame(AVFilterLink *inlink)
             avfilter_unref_buffer(outlink->out_buf);
             outlink->out_buf = NULL;
         }
-        avfilter_end_frame(outlink);
+        ff_end_frame(outlink);
     }
 }
 
-void avfilter_end_frame(AVFilterLink *link)
+void ff_end_frame(AVFilterLink *link)
 {
     void (*end_frame)(AVFilterLink *);
 
@@ -254,7 +254,7 @@ void avfilter_end_frame(AVFilterLink *link)
 
 void ff_null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
 {
-    avfilter_draw_slice(link->dst->outputs[0], y, h, slice_dir);
+    ff_draw_slice(link->dst->outputs[0], y, h, slice_dir);
 }
 
 static void default_draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
@@ -265,10 +265,10 @@ static void default_draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir
         outlink = inlink->dst->outputs[0];
 
     if (outlink)
-        avfilter_draw_slice(outlink, y, h, slice_dir);
+        ff_draw_slice(outlink, y, h, slice_dir);
 }
 
-void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
+void ff_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
 {
     uint8_t *src[4], *dst[4];
     int i, j, vsub;
@@ -342,4 +342,16 @@ void avfilter_null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
 {
     ff_null_draw_slice(link, y, h, slice_dir);
 }
+void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
+{
+    ff_start_frame(link, picref);
+}
+void avfilter_end_frame(AVFilterLink *link)
+{
+    ff_end_frame(link);
+}
+void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
+{
+    ff_draw_slice(link, y, h, slice_dir);
+}
 #endif
index 2256482eee2d351d16316d43147f5e8b692b5b88..7c9f9a0d2882776413641ace69e8ff0cba5b7621 100644 (file)
@@ -29,4 +29,39 @@ 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);
 
+/**
+ * Notify the next filter of the start of a frame.
+ *
+ * @param link   the output link the frame will be sent over
+ * @param picref A reference to the frame about to be sent. The data for this
+ *               frame need only be valid once draw_slice() is called for that
+ *               portion. The receiving filter will free this reference when
+ *               it no longer needs it.
+ */
+void ff_start_frame(AVFilterLink *link, AVFilterBufferRef *picref);
+
+/**
+ * Notify the next filter that the current frame has finished.
+ *
+ * @param link the output link the frame was sent over
+ */
+void ff_end_frame(AVFilterLink *link);
+
+/**
+ * Send a slice to the next filter.
+ *
+ * Slices have to be provided in sequential order, either in
+ * top-bottom or bottom-top order. If slices are provided in
+ * non-sequential order the behavior of the function is undefined.
+ *
+ * @param link the output link over which the frame is being sent
+ * @param y    offset in pixels from the top of the image for this slice
+ * @param h    height of this slice in pixels
+ * @param slice_dir the assumed direction for sending slices,
+ *             from the top slice to the bottom slice if the value is 1,
+ *             from the bottom slice to the top slice if the value is -1,
+ *             for other values the behavior of the function is undefined.
+ */
+void ff_draw_slice(AVFilterLink *link, int y, int h, int slice_dir);
+
 #endif /* AVFILTER_VIDEO_H */
index 803196ebf7066687b72b0b77c88b50c3ac75942b..99ea0ad5c1443824cdaf0b25aebc4e3f0826216a 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "avfilter.h"
 #include "formats.h"
+#include "video.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/colorspace.h"
 #include "libavutil/imgutils.h"
@@ -144,12 +145,12 @@ static int color_request_frame(AVFilterLink *link)
     picref->pts                 = color->pts++;
     picref->pos                 = -1;
 
-    avfilter_start_frame(link, avfilter_ref_buffer(picref, ~0));
+    ff_start_frame(link, avfilter_ref_buffer(picref, ~0));
     ff_draw_rectangle(picref->data, picref->linesize,
                       color->line, color->line_step, color->hsub, color->vsub,
                       0, 0, color->w, color->h);
-    avfilter_draw_slice(link, 0, color->h, 1);
-    avfilter_end_frame(link);
+    ff_draw_slice(link, 0, color->h, 1);
+    ff_end_frame(link);
     avfilter_unref_buffer(picref);
 
     return 0;
index 45772319c6d7117788e06b9cdc5a599ab5fd0d8c..ff3022cdd61c63787eb89cf3c3cf2f97f6fba1ea 100644 (file)
@@ -37,6 +37,7 @@
 #include "libavformat/avformat.h"
 #include "avfilter.h"
 #include "formats.h"
+#include "video.h"
 
 typedef struct {
     const AVClass *class;
@@ -287,9 +288,9 @@ static int request_frame(AVFilterLink *outlink)
         return ret;
 
     outpicref = avfilter_ref_buffer(movie->picref, ~0);
-    avfilter_start_frame(outlink, outpicref);
-    avfilter_draw_slice(outlink, 0, outlink->h, 1);
-    avfilter_end_frame(outlink);
+    ff_start_frame(outlink, outpicref);
+    ff_draw_slice(outlink, 0, outlink->h, 1);
+    ff_end_frame(outlink);
     avfilter_unref_buffer(movie->picref);
     movie->picref = NULL;
 
index 43495d6fd4fdf16fa798a45d694d274aebd10b2f..7187241136228b791bbd55a5e70ac67b7e783858 100644 (file)
@@ -38,6 +38,7 @@
 #include "libavutil/parseutils.h"
 #include "avfilter.h"
 #include "formats.h"
+#include "video.h"
 
 typedef struct {
     const AVClass *class;
@@ -142,9 +143,9 @@ static int request_frame(AVFilterLink *outlink)
     test->nb_frame++;
     test->fill_picture_fn(outlink->src, picref);
 
-    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;