22#ifndef AVFILTER_AVFILTER_H
23#define AVFILTER_AVFILTER_H
51#ifndef HAVE_AV_CONFIG_H
116#define AVFILTER_FLAG_DYNAMIC_INPUTS (1 << 0)
122#define AVFILTER_FLAG_DYNAMIC_OUTPUTS (1 << 1)
127#define AVFILTER_FLAG_SLICE_THREADS (1 << 2)
143#define AVFILTER_FLAG_METADATA_ONLY (1 << 3)
152#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC (1 << 16)
160#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL (1 << 17)
165#define AVFILTER_FLAG_SUPPORT_TIMELINE (AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL)
403#define AVFILTER_THREAD_SLICE (1 << 0)
552#if FF_API_OLD_CHANNEL_LAYOUT
558 uint64_t channel_layout;
678#ifndef FF_INTERNAL_FIELDS
699 int frame_blocked_in;
711 int64_t status_in_pts;
749#define AVFILTER_CMD_FLAG_ONE 1
750#define AVFILTER_CMD_FLAG_FAST 2
831 unsigned filt_srcpad_idx,
unsigned filt_dstpad_idx);
869 void *arg,
int *ret,
int nb_jobs);
989 const char *name,
const char *args,
void *opaque,
Macro definitions for various function/variable attributes.
#define attribute_deprecated
Convenience header that includes libavutil's core.
refcounted data buffer API
reference-counted frame API
struct AVFilterPad AVFilterPad
int avfilter_init_str(AVFilterContext *ctx, const char *args)
Initialize a filter with the supplied parameters.
int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt, unsigned filt_srcpad_idx, unsigned filt_dstpad_idx)
Insert a filter in the middle of an existing link.
void avfilter_free(AVFilterContext *filter)
Free a filter context.
int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx)
Check validity and configure all the links and formats in the graph.
const AVFilter * avfilter_get_by_name(const char *name)
Get a filter definition matching the given name.
attribute_deprecated int avfilter_pad_count(const AVFilterPad *pads)
Get the number of elements in an AVFilter's inputs or outputs array.
char * avfilter_graph_dump(AVFilterGraph *graph, const char *options)
Dump a graph into a human-readable string representation.
void avfilter_inout_free(AVFilterInOut **inout)
Free the supplied list of AVFilterInOut and set *inout to NULL.
enum AVMediaType avfilter_pad_get_type(const AVFilterPad *pads, int pad_idx)
Get the type of an AVFilterPad.
int avfilter_graph_queue_command(AVFilterGraph *graph, const char *target, const char *cmd, const char *arg, int flags, double ts)
Queue a command for one or more filter instances.
const char * avfilter_configuration(void)
Return the libavfilter build-time configuration.
int avfilter_graph_parse_ptr(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx)
Add a graph described by a string to a graph.
AVFilterContext * avfilter_graph_get_filter(AVFilterGraph *graph, const char *name)
Get a filter instance identified by instance name from graph.
unsigned avfilter_filter_pad_count(const AVFilter *filter, int is_output)
Get the number of elements in an AVFilter's inputs or outputs array.
AVFilterContext * avfilter_graph_alloc_filter(AVFilterGraph *graph, const AVFilter *filter, const char *name)
Create a new filter instance in a filter graph.
const char * avfilter_pad_get_name(const AVFilterPad *pads, int pad_idx)
Get the name of an AVFilterPad.
const AVFilter * av_filter_iterate(void **opaque)
Iterate over all registered filters.
int avfilter_graph_parse2(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs)
Add a graph described by a string to a graph.
int avfilter_process_command(AVFilterContext *filter, const char *cmd, const char *arg, char *res, int res_len, int flags)
Make the filter instance process a command.
struct AVFilterInternal AVFilterInternal
void avfilter_graph_free(AVFilterGraph **graph)
Free a graph, destroy its links, and set *graph to NULL.
int avfilter_init_dict(AVFilterContext *ctx, AVDictionary **options)
Initialize a filter with the supplied dictionary of options.
const char * avfilter_license(void)
Return the libavfilter license.
struct AVFilterChannelLayouts AVFilterChannelLayouts
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,...
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 AVFilterGraphInternal AVFilterGraphInternal
int avfilter_graph_send_command(AVFilterGraph *graph, const char *target, const char *cmd, const char *arg, char *res, int res_len, int flags)
Send a command to one or more filter instances.
int avfilter_config_links(AVFilterContext *filter)
Negotiate the media format, dimensions, etc of all inputs to a filter.
int avfilter_graph_request_oldest(AVFilterGraph *graph)
Request a frame on the oldest sink link.
unsigned avfilter_version(void)
Return the LIBAVFILTER_VERSION_INT constant.
int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, AVFilterInOut *inputs, AVFilterInOut *outputs, void *log_ctx)
Add a graph described by a string to a graph.
int avfilter_link(AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad)
Link two filters together.
int avfilter_graph_create_filter(AVFilterContext **filt_ctx, const AVFilter *filt, const char *name, const char *args, void *opaque, AVFilterGraph *graph_ctx)
Create and add a filter instance into an existing graph.
const AVClass * avfilter_get_class(void)
struct AVFilterFormats AVFilterFormats
void avfilter_link_free(AVFilterLink **link)
Free the link in *link, and set its pointer to NULL.
void avfilter_graph_set_auto_convert(AVFilterGraph *graph, unsigned flags)
Enable or disable automatic format conversion inside the graph.
AVFilterInOut * avfilter_inout_alloc(void)
Allocate a single AVFilterInOut entry.
AVFilterGraph * avfilter_graph_alloc(void)
Allocate a filter graph.
@ AVFILTER_AUTO_CONVERT_NONE
all automatic conversions disabled
@ AVFILTER_AUTO_CONVERT_ALL
all automatic conversions enabled
struct AVDictionary AVDictionary
AVSampleFormat
Audio sample formats.
Libavfilter version macros.
Libavfilter version macros.
AVPixelFormat
Pixel format.
Utilties for rational number calculation.
A reference to a data buffer.
An AVChannelLayout holds information about the channel layout of audio data.
Describe the class of an AVClass context structure.
const AVClass * av_class
needed for av_log() and filters common options
int nb_threads
Max number of threads allowed in this filter instance.
int thread_type
Type of multithreading being allowed/used.
int extra_hw_frames
Sets the number of extra hardware frames which the filter will allocate on its output links for use i...
char * name
name of this filter instance
void * enable
parsed expression (AVExpr*)
unsigned nb_inputs
number of input pads
AVFilterLink ** inputs
array of pointers to input links
char * enable_str
enable expression string
const AVFilter * filter
the AVFilter of which this is an instance
AVFilterInternal * internal
An opaque struct for libavfilter internal use.
struct AVFilterGraph * graph
filtergraph this filter belongs to
AVFilterPad * input_pads
array of input pads
void * priv
private data for use by the filter
unsigned nb_outputs
number of output pads
unsigned ready
Ready status of the filter.
struct AVFilterCommand * command_queue
AVFilterPad * output_pads
array of output pads
double * var_values
variable values for the enable expression
int is_disabled
the enabled state from the last expression evaluation
AVBufferRef * hw_device_ctx
For filters which will create hardware frames, sets the device the filter should create them in.
AVFilterLink ** outputs
array of pointers to output links
AVFilterLink ** sink_links
Private fields.
char * scale_sws_opts
sws options to use for the auto-inserted scale filters
AVFilterContext ** filters
void * opaque
Opaque user data.
char * aresample_swr_opts
swr options to use for the auto-inserted aresample filters, Access ONLY through AVOptions
AVFilterGraphInternal * internal
Opaque object for libavfilter internal use.
unsigned disable_auto_convert
int thread_type
Type of multithreading allowed for filters in this graph.
avfilter_execute_func * execute
This callback may be set by the caller immediately after allocating the graph and before adding any f...
int nb_threads
Maximum number of threads used by filters in this graph.
A linked-list of the inputs/outputs of the filter chain.
AVFilterContext * filter_ctx
filter context associated to this input/output
int pad_idx
index of the filt_ctx pad to use for linking
char * name
unique name for this input/output in the list
struct AVFilterInOut * next
next input/input in the list, NULL if this is the last
A link between two filters.
AVFilterFormatsConfig incfg
Lists of supported formats / etc.
struct AVFilterGraph * graph
Graph the filter belongs to.
int w
agreed upon image width
int64_t current_pts
Current timestamp of the link, as defined by the most recent frame(s), in link time_base units.
int max_samples
Maximum number of samples to filter at once.
int h
agreed upon image height
@ AVLINK_UNINIT
not started
@ AVLINK_STARTINIT
started, but incomplete
AVFilterFormatsConfig outcfg
Lists of supported formats / etc.
enum AVMediaType type
filter media type
AVFilterContext * src
source filter
int64_t frame_count_in
Number of past frames sent through the link.
enum AVFilterLink::@2 init_state
stage of the initialization of the link properties (dimensions, etc)
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
int sample_rate
samples per second
int frame_wanted_out
True if a frame is currently wanted on the output of this filter.
AVChannelLayout ch_layout
channel layout of current buffer (see libavutil/channel_layout.h)
AVBufferRef * hw_frames_ctx
For hwaccel pixel formats, this should be a reference to the AVHWFramesContext describing the frames.
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable; if left to 0/0,...
AVFilterPad * srcpad
output pad on the source filter
int age_index
Index in the age array.
int64_t current_pts_us
Current timestamp of the link, as defined by the most recent frame(s), in AV_TIME_BASE units.
AVFilterPad * dstpad
input pad on the dest filter
AVFilterContext * dst
dest filter
int format
agreed upon media format
char reserved[0xF000]
Internal structure members.
int64_t sample_count_in
Number of past samples sent through the link.
int min_samples
Minimum number of samples to filter at once.
void * frame_pool
A pointer to a FFFramePool struct.
uint8_t nb_inputs
The number of entries in the list of inputs.
int(* process_command)(AVFilterContext *, const char *cmd, const char *arg, char *res, int res_len, int flags)
Make the filter instance process a command.
const char * name
Filter name.
enum AVSampleFormat sample_fmt
Equivalent to { sample_fmt, AV_SAMPLE_FMT_NONE } as samples_list.
int(* init_dict)(AVFilterContext *ctx, AVDictionary **options)
Should be set instead of init by the filters that want to pass a dictionary of AVOptions to nested co...
void(* uninit)(AVFilterContext *ctx)
Filter uninitialization function.
int(* query_func)(AVFilterContext *)
Query formats supported by the filter on its inputs and outputs.
int flags
A combination of AVFILTER_FLAG_*.
uint8_t formats_state
This field determines the state of the formats union.
union AVFilter::@1 formats
The state of the following union is determined by formats_state.
int(* preinit)(AVFilterContext *ctx)
Filter pre-initialization function.
enum AVSampleFormat * samples_list
Analogous to pixels, but delimited by AV_SAMPLE_FMT_NONE and restricted to filters that only have AVM...
int flags_internal
Additional flags for avfilter internal use only.
const AVClass * priv_class
A class for the private data, used to declare filter private AVOptions.
uint8_t nb_outputs
The number of entries in the list of outputs.
int priv_size
size of private data to allocate for the filter
int(* init)(AVFilterContext *ctx)
Filter initialization function.
const AVFilterPad * outputs
List of static outputs.
const AVFilterPad * inputs
List of static inputs.
enum AVPixelFormat pix_fmt
Equivalent to { pix_fmt, AV_PIX_FMT_NONE } as pixels_list.
enum AVPixelFormat * pixels_list
A pointer to an array of admissible pixel formats delimited by AV_PIX_FMT_NONE.
int(* activate)(AVFilterContext *ctx)
Filter activation function.
const char * description
A description of the filter.
Rational number (pair of numerator and denominator).