#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
*/
void ff_avfilter_graph_update_heap(AVFilterGraph *graph, AVFilterLink *link);
-#if !FF_API_AVFILTERPAD_PUBLIC
/**
* A filter pad used for either input or output.
*/
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.
*/
*/
int needs_writable;
};
-#endif
struct AVFilterGraphInternal {
void *thread;
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);
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;
}
/**
* 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
*/
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.
*