summaryrefslogtreecommitdiff
path: root/ffmpeg/libavfilter/internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'ffmpeg/libavfilter/internal.h')
-rw-r--r--ffmpeg/libavfilter/internal.h87
1 files changed, 64 insertions, 23 deletions
diff --git a/ffmpeg/libavfilter/internal.h b/ffmpeg/libavfilter/internal.h
index 9a42ae0..5e19698 100644
--- a/ffmpeg/libavfilter/internal.h
+++ b/ffmpeg/libavfilter/internal.h
@@ -24,9 +24,12 @@
* internal API functions
*/
+#include "libavutil/internal.h"
#include "avfilter.h"
#include "avfiltergraph.h"
#include "formats.h"
+#include "thread.h"
+#include "version.h"
#include "video.h"
#define POOL_SIZE 32
@@ -141,24 +144,23 @@ struct AVFilterPad {
};
#endif
+struct AVFilterGraphInternal {
+ void *thread;
+ avfilter_execute_func *thread_execute;
+};
+
+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);
-/**
- * Return a copy of a list of integers terminated by -1, or NULL in
- * case of copy failure.
- */
-int *ff_copy_int_list(const int * const list);
-
-/**
- * Return a copy of a list of 64-bit integers, or NULL in case of
- * copy failure.
- */
-int64_t *ff_copy_int64_list(const int64_t * const list);
-
/* Functions to parse audio format arguments */
/**
@@ -167,7 +169,7 @@ int64_t *ff_copy_int64_list(const int64_t * const list);
* @param ret pixel format pointer to where the value should be written
* @param arg string to parse
* @param log_ctx log context
- * @return 0 in case of success, a negative AVERROR code on error
+ * @return >= 0 in case of success, a negative AVERROR code on error
*/
int ff_parse_pixel_format(enum AVPixelFormat *ret, const char *arg, void *log_ctx);
@@ -177,7 +179,7 @@ int ff_parse_pixel_format(enum AVPixelFormat *ret, const char *arg, void *log_ct
* @param ret unsigned integer pointer to where the value should be written
* @param arg string to parse
* @param log_ctx log context
- * @return 0 in case of success, a negative AVERROR code on error
+ * @return >= 0 in case of success, a negative AVERROR code on error
*/
int ff_parse_sample_rate(int *ret, const char *arg, void *log_ctx);
@@ -187,7 +189,7 @@ int ff_parse_sample_rate(int *ret, const char *arg, void *log_ctx);
* @param ret unsigned AVRational pointer to where the value should be written
* @param arg string to parse
* @param log_ctx log context
- * @return 0 in case of success, a negative AVERROR code on error
+ * @return >= 0 in case of success, a negative AVERROR code on error
*/
int ff_parse_time_base(AVRational *ret, const char *arg, void *log_ctx);
@@ -197,7 +199,7 @@ int ff_parse_time_base(AVRational *ret, const char *arg, void *log_ctx);
* @param ret integer pointer to where the value should be written
* @param arg string to parse
* @param log_ctx log context
- * @return 0 in case of success, a negative AVERROR code on error
+ * @return >= 0 in case of success, a negative AVERROR code on error
*/
int ff_parse_sample_format(int *ret, const char *arg, void *log_ctx);
@@ -205,11 +207,14 @@ int ff_parse_sample_format(int *ret, const char *arg, void *log_ctx);
* Parse a channel layout or a corresponding integer representation.
*
* @param ret 64bit integer pointer to where the value should be written.
+ * @param nret integer pointer to the number of channels;
+ * if not NULL, then unknown channel layouts are accepted
* @param arg string to parse
* @param log_ctx log context
- * @return 0 in case of success, a negative AVERROR code on error
+ * @return >= 0 in case of success, a negative AVERROR code on error
*/
-int ff_parse_channel_layout(int64_t *ret, const char *arg, void *log_ctx);
+int ff_parse_channel_layout(int64_t *ret, int *nret, const char *arg,
+ void *log_ctx);
void ff_update_link_current_pts(AVFilterLink *link, int64_t pts);
@@ -245,31 +250,38 @@ void ff_tlog_link(void *ctx, AVFilterLink *link, int end);
* @param pads Pointer to the pointer to the beginning of the list of pads
* @param links Pointer to the pointer to the beginning of the list of links
* @param newpad The new pad to add. A copy is made when adding.
+ * @return >= 0 in case of success, a negative AVERROR code on error
*/
-void ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
+int ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
AVFilterPad **pads, AVFilterLink ***links,
AVFilterPad *newpad);
/** Insert a new input pad for the filter. */
-static inline void ff_insert_inpad(AVFilterContext *f, unsigned index,
+static inline int ff_insert_inpad(AVFilterContext *f, unsigned index,
AVFilterPad *p)
{
- ff_insert_pad(index, &f->nb_inputs, offsetof(AVFilterLink, dstpad),
+ int ret = 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 void ff_insert_outpad(AVFilterContext *f, unsigned index,
+static inline int ff_insert_outpad(AVFilterContext *f, unsigned index,
AVFilterPad *p)
{
- ff_insert_pad(index, &f->nb_outputs, offsetof(AVFilterLink, srcpad),
+ int ret = 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;
}
/**
@@ -325,4 +337,33 @@ int ff_buffersink_read_samples_compat(AVFilterContext *ctx, AVFilterBufferRef **
*/
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.
+ *
+ * @param filter what filter to create an instance of
+ * @param inst_name name to give to the new filter context
+ *
+ * @return newly created filter context or NULL on failure
+ */
+AVFilterContext *ff_filter_alloc(const AVFilter *filter, const char *inst_name);
+
+/**
+ * Remove a filter from a graph;
+ */
+void ff_filter_graph_remove_filter(AVFilterGraph *graph, AVFilterContext *filter);
+
#endif /* AVFILTER_INTERNAL_H */