]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/internal.h
avfilter: add rubberband wrapper
[ffmpeg] / libavfilter / internal.h
index 7dde2e133496f8f7dc3dc4cc09faf4b49dc0d2fa..bb947072e069ba9894df216a5eaaeb7328b14fb6 100644 (file)
 #include "video.h"
 #include "libavcodec/avcodec.h"
 
-#if FF_API_AVFILTERBUFFER
-#define POOL_SIZE 32
-typedef struct AVFilterPool {
-    AVFilterBufferRef *pic[POOL_SIZE];
-    int count;
-    int refcount;
-    int draining;
-} AVFilterPool;
-#endif
-
 typedef struct AVFilterCommand {
     double time;                ///< time expressed in seconds
     char *command;              ///< command
@@ -56,7 +46,6 @@ typedef struct AVFilterCommand {
  */
 void ff_avfilter_graph_update_heap(AVFilterGraph *graph, AVFilterLink *link);
 
-#if !FF_API_AVFILTERPAD_PUBLIC
 /**
  * A filter pad used for either input or output.
  */
@@ -113,9 +102,9 @@ struct AVFilterPad {
     int (*poll_frame)(AVFilterLink *link);
 
     /**
-     * Frame request callback. A call to this should result in at least one
-     * frame being output over the given link. This should return zero on
-     * success, and another value on error.
+     * Frame request callback. A call to this should result in some progress
+     * towards producing output over the given link. This should return zero
+     * on success, and another value on error.
      *
      * Output pads only.
      */
@@ -153,7 +142,6 @@ struct AVFilterPad {
      */
     int needs_writable;
 };
-#endif
 
 struct AVFilterGraphInternal {
     void *thread;
@@ -164,11 +152,6 @@ struct AVFilterInternal {
     avfilter_execute_func *execute;
 };
 
-#if FF_API_AVFILTERBUFFER
-/** default handler for freeing audio/video buffer when there are no references left */
-void ff_avfilter_default_free_buffer(AVFilterBuffer *buf);
-#endif
-
 /** Tell is a format is contained in the provided list terminated by -1. */
 int ff_fmt_is_in(int fmt, const int *fmts);
 
@@ -271,28 +254,16 @@ int ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
 static inline int ff_insert_inpad(AVFilterContext *f, unsigned index,
                                    AVFilterPad *p)
 {
-    int ret = ff_insert_pad(index, &f->nb_inputs, offsetof(AVFilterLink, dstpad),
+    return ff_insert_pad(index, &f->nb_inputs, offsetof(AVFilterLink, dstpad),
                   &f->input_pads, &f->inputs, p);
-#if FF_API_FOO_COUNT
-FF_DISABLE_DEPRECATION_WARNINGS
-    f->input_count = f->nb_inputs;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-    return ret;
 }
 
 /** Insert a new output pad for the filter. */
 static inline int ff_insert_outpad(AVFilterContext *f, unsigned index,
                                     AVFilterPad *p)
 {
-    int ret = ff_insert_pad(index, &f->nb_outputs, offsetof(AVFilterLink, srcpad),
+    return ff_insert_pad(index, &f->nb_outputs, offsetof(AVFilterLink, srcpad),
                   &f->output_pads, &f->outputs, p);
-#if FF_API_FOO_COUNT
-FF_DISABLE_DEPRECATION_WARNINGS
-    f->output_count = f->nb_outputs;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-    return ret;
 }
 
 /**
@@ -320,8 +291,11 @@ int ff_poll_frame(AVFilterLink *link);
  * caller (generally eventually a user application) as this step may (but does
  * not have to be) necessary to provide the input with the next frame.
  *
- * If a request is successful then the filter_frame() function will be called
- * at least once before ff_request_frame() returns
+ * If a request is successful then some progress has been made towards
+ * providing a frame on the link (through ff_filter_frame()). A filter that
+ * needs several frames to produce one is allowed to return success if one
+ * more frame has been processed but no output has been produced yet. A
+ * filter is also allowed to simply forward a success return value.
  *
  * @param link the input link
  * @return     zero on success
@@ -361,20 +335,6 @@ int ff_request_frame(AVFilterLink *link);
  */
 int ff_filter_frame(AVFilterLink *link, AVFrame *frame);
 
-/**
- * Flags for AVFilterLink.flags.
- */
-enum {
-
-    /**
-     * Frame requests may need to loop in order to be fulfilled.
-     * A filter must set this flags on an output link if it may return 0 in
-     * request_frame() without filtering a frame.
-     */
-    FF_LINK_FLAG_REQUEST_LOOP = 1,
-
-};
-
 /**
  * Allocate a new filter context and return it.
  *