Go to the documentation of this file.
19 #ifndef AVFILTER_INTERNAL_H
20 #define AVFILTER_INTERNAL_H
66 #define AVFILTERPAD_FLAG_NEEDS_WRITABLE (1 << 0)
71 #define AVFILTERPAD_FLAG_FREE_NAME (1 << 1)
145 void *
arg,
int *
ret,
int nb_jobs)
169 #define FILTER_QUERY_FUNC(func) \
170 .formats.query_func = func, \
171 .formats_state = FF_FILTER_FORMATS_QUERY_FUNC
172 #define FILTER_PIXFMTS_ARRAY(array) \
173 .formats.pixels_list = array, \
174 .formats_state = FF_FILTER_FORMATS_PIXFMT_LIST
175 #define FILTER_SAMPLEFMTS_ARRAY(array) \
176 .formats.samples_list = array, \
177 .formats_state = FF_FILTER_FORMATS_SAMPLEFMTS_LIST
178 #define FILTER_PIXFMTS(...) \
179 FILTER_PIXFMTS_ARRAY(((const enum AVPixelFormat []) { __VA_ARGS__, AV_PIX_FMT_NONE }))
180 #define FILTER_SAMPLEFMTS(...) \
181 FILTER_SAMPLEFMTS_ARRAY(((const enum AVSampleFormat[]) { __VA_ARGS__, AV_SAMPLE_FMT_NONE }))
182 #define FILTER_SINGLE_PIXFMT(pix_fmt_) \
183 .formats.pix_fmt = pix_fmt_, \
184 .formats_state = FF_FILTER_FORMATS_SINGLE_PIXFMT
185 #define FILTER_SINGLE_SAMPLEFMT(sample_fmt_) \
186 .formats.sample_fmt = sample_fmt_, \
187 .formats_state = FF_FILTER_FORMATS_SINGLE_SAMPLEFMT
189 #define FILTER_INOUTPADS(inout, array) \
191 .nb_ ## inout = FF_ARRAY_ELEMS(array)
192 #define FILTER_INPUTS(array) FILTER_INOUTPADS(inputs, (array))
193 #define FILTER_OUTPUTS(array) FILTER_INOUTPADS(outputs, (array))
253 #define D2TS(d) (isnan(d) ? AV_NOPTS_VALUE : (int64_t)(d))
254 #define TS2D(ts) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts))
255 #define TS2T(ts, tb) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts) * av_q2d(tb))
259 #define FF_TPRINTF_START(ctx, func) ff_tlog(NULL, "%-16s: ", #func)
264 #define ff_tlog_link(ctx, link, end) do { } while(0)
311 #define AVFILTER_DEFINE_CLASS_EXT(name, desc, options) \
312 static const AVClass name##_class = { \
313 .class_name = desc, \
314 .item_name = av_default_item_name, \
316 .version = LIBAVUTIL_VERSION_INT, \
317 .category = AV_CLASS_CATEGORY_FILTER, \
319 #define AVFILTER_DEFINE_CLASS(fname) \
320 AVFILTER_DEFINE_CLASS_EXT(fname, #fname, fname##_options)
327 #define FF_INLINK_IDX(link) ((int)((link)->dstpad - (link)->dst->input_pads))
328 #define FF_OUTLINK_IDX(link) ((int)((link)->srcpad - (link)->src->output_pads))
364 #define FF_FILTER_FLAG_HWFRAME_AWARE (1 << 0)
384 const char *
arg,
char *res,
int res_len,
int flags);
400 int default_pool_size);
int(* func)(AVBPrint *dst, const char *in, const char *arg)
AVPixelFormat
Pixel format.
void ff_avfilter_graph_update_heap(AVFilterGraph *graph, AVFilterLink *link)
Update the position of a link in the age heap.
int() avfilter_action_func(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
A function pointer passed to the AVFilterGraph::execute callback to be executed multiple times,...
FFFrameQueueGlobal frame_queues
This structure describes decoded (raw) audio or video data.
int ff_append_outpad(AVFilterContext *f, AVFilterPad *p)
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce then the filter should push the output frames on the output link immediately As an exception to the previous rule if the input frame is enough to produce several output frames then the filter needs output only at least one per link The additional frames can be left buffered in the filter
int ff_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
void ff_avfilter_link_set_in_status(AVFilterLink *link, int status, int64_t pts)
Set the status field of a link from the source filter.
A link between two filters.
@ FF_FILTER_FORMATS_SAMPLEFMTS_LIST
formats.samples_list active.
AVFilterContext * ff_filter_alloc(const AVFilter *filter, const char *inst_name)
Allocate a new filter context and return it.
int ff_filter_activate(AVFilterContext *filter)
A filter pad used for either input or output.
union AVFilterPad::@240 get_buffer
Callback functions to get a video/audio buffers.
int(* request_frame)(AVFilterLink *link)
Frame request callback.
@ FF_FILTER_FORMATS_SINGLE_SAMPLEFMT
formats.sample_fmt active.
Structure to hold global options and statistics for frame queues.
int ff_filter_init_hw_frames(AVFilterContext *avctx, AVFilterLink *link, int default_pool_size)
Perform any additional setup required for hardware frames.
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options.
int ff_fmt_is_in(int fmt, const int *fmts)
Tell if an integer is contained in the provided -1-terminated list of integers.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a link
void ff_filter_graph_remove_filter(AVFilterGraph *graph, AVFilterContext *filter)
Remove a filter from a graph;.
Describe the class of an AVClass context structure.
av_warn_unused_result int ff_parse_pixel_format(enum AVPixelFormat *ret, const char *arg, void *log_ctx)
Parse a pixel format.
int(* filter_frame)(AVFilterLink *link, AVFrame *frame)
Filtering callback.
#define ff_tlog_link(ctx, link, end)
int(* config_props)(AVFilterLink *link)
Link configuration callback.
const OptionDef options[]
int ff_append_outpad_free_name(AVFilterContext *f, AVFilterPad *p)
An AVChannelLayout holds information about the channel layout of audio data.
int() avfilter_execute_func(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
A function executing multiple jobs, possibly in parallel.
struct AVFilterCommand * next
int ff_filter_opt_parse(void *logctx, const AVClass *priv_class, AVDictionary **options, const char *args)
Parse filter options into a dictionary.
avfilter_execute_func * thread_execute
int ff_filter_graph_run_once(AVFilterGraph *graph)
Run one round of processing on a filter graph.
#define av_warn_unused_result
av_warn_unused_result int ff_parse_sample_rate(int *ret, const char *arg, void *log_ctx)
Parse a sample rate.
@ FF_FILTER_FORMATS_PASSTHROUGH
The default value meaning that this filter supports all formats and (for audio) sample rates and chan...
int flags
A combination of AVFILTERPAD_FLAG_* flags.
const char * name
Pad name.
enum AVMediaType type
AVFilterPad type.
int ff_append_inpad_free_name(AVFilterContext *f, AVFilterPad *p)
avfilter_execute_func * execute
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
char * arg
optional argument for the command
@ FF_FILTER_FORMATS_PIXFMT_LIST
formats.pixels_list active.
av_warn_unused_result int ff_parse_channel_layout(AVChannelLayout *ret, int *nret, const char *arg, void *log_ctx)
Parse a channel layout or a corresponding integer representation.
int ff_append_inpad(AVFilterContext *f, AVFilterPad *p)
Append a new input/output pad to the filter's list of such pads.
@ FF_FILTER_FORMATS_QUERY_FUNC
formats.query active.
#define flags(name, subs,...)
static av_always_inline int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
@ FF_FILTER_FORMATS_SINGLE_PIXFMT
formats.pix_fmt active
int ff_filter_get_nb_threads(AVFilterContext *ctx) av_pure
Get number of threads for current filter instance.
double time
time expressed in seconds