22 #ifndef AVFILTER_AVFILTER_H 23 #define AVFILTER_AVFILTER_H 45 #include "libavutil/log.h" 46 #include "libavutil/samplefmt.h" 105 #define AVFILTER_FLAG_DYNAMIC_INPUTS (1 << 0) 111 #define AVFILTER_FLAG_DYNAMIC_OUTPUTS (1 << 1) 116 #define AVFILTER_FLAG_SLICE_THREADS (1 << 2) 125 #define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC (1 << 16) 133 #define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL (1 << 17) 138 #define AVFILTER_FLAG_SUPPORT_TIMELINE (AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL) 333 #define AVFILTER_THREAD_SLICE (1 << 0) 603 #ifndef FF_INTERNAL_FIELDS 610 char reserved[0xF000];
624 int frame_blocked_in;
636 int64_t status_in_pts;
666 #if FF_API_FILTER_GET_SET 691 #define AVFILTER_CMD_FLAG_ONE 1 692 #define AVFILTER_CMD_FLAG_FAST 2 714 void avfilter_register_all(
void);
727 int avfilter_register(
AVFilter *filter);
800 unsigned filt_srcpad_idx,
unsigned filt_dstpad_idx);
838 void *arg,
int *ret,
int nb_jobs);
847 attribute_deprecated
char *resample_lavr_opts;
907 int sink_links_count;
909 unsigned disable_auto_convert;
961 const char *
name,
const char *args,
void *opaque,
int64_t frame_count_in
Number of past frames sent through the link.
Definition: avfilter.h:583
void avfilter_graph_set_auto_convert(AVFilterGraph *graph, unsigned flags)
Enable or disable automatic format conversion inside the graph.
Definition: avfiltergraph.c:165
double * var_values
variable values for the enable expression
Definition: avfilter.h:384
int frame_wanted_out
True if a frame is currently wanted on the output of this filter.
Definition: avfilter.h:595
This structure describes decoded (raw) audio or video data.
Definition: frame.h:218
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.
Definition: avfiltergraph.c:1316
int thread_type
Type of multithreading allowed for filters in this graph.
Definition: avfilter.h:862
void avfilter_free(AVFilterContext *filter)
Free a filter context.
Definition: avfilter.c:760
AVFilterGraph * avfilter_graph_alloc(void)
Allocate a filter graph.
Definition: avfiltergraph.c:83
int max_samples
Maximum number of samples to filter at once.
Definition: avfilter.h:568
int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx)
Check validity and configure all the links and formats in the graph.
Definition: avfiltergraph.c:1266
void avfilter_inout_free(AVFilterInOut **inout)
Free the supplied list of AVFilterInOut and set *inout to NULL.
Definition: graphparser.c:203
struct AVFilterInOut * next
next input/input in the list, NULL if this is the last
Definition: avfilter.h:1014
Queue of AVFrame pointers.
Definition: framequeue.h:53
int h
agreed upon image height
Definition: avfilter.h:450
enum AVMediaType avfilter_pad_get_type(const AVFilterPad *pads, int pad_idx)
Get the type of an AVFilterPad.
Definition: avfilter.c:1039
Definition: internal.h:148
Libavfilter version macros.
int request_samples
Audio only, the destination filter sets this to a non-zero value to request that buffers with the giv...
Definition: avfilter.h:500
void avfilter_graph_free(AVFilterGraph **graph)
Free a graph, destroy its links, and set *graph to NULL.
Definition: avfiltergraph.c:120
AVBufferRef * hw_device_ctx
For filters which will create hardware frames, sets the device the filter should create them in...
Definition: avfilter.h:394
Convenience header that includes libavutil's core.
int(* activate)(AVFilterContext *ctx)
Filter activation function.
Definition: avfilter.h:327
AVFilterPad * dstpad
input pad on the dest filter
Definition: avfilter.h:444
all automatic conversions enabled
Definition: avfilter.h:975
int thread_type
Type of multithreading being allowed/used.
Definition: avfilter.h:373
void(* uninit)(AVFilterContext *ctx)
Filter uninitialization function.
Definition: avfilter.h:258
int is_disabled
the enabled state from the last expression evaluation
Definition: avfilter.h:385
Macro definitions for various function/variable attributes.
int nb_threads
Max number of threads allowed in this filter instance.
Definition: avfilter.h:401
char * scale_sws_opts
sws options to use for the auto-inserted scale filters
Definition: avfilter.h:845
struct AVFilterGraph * graph
filtergraph this filter belongs to
Definition: avfilter.h:355
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...
Definition: avfilter.h:246
int priv_size
size of private data to allocate for the filter
Definition: avfilter.h:284
AVFilterLink ** inputs
array of pointers to input links
Definition: avfilter.h:346
char * name
name of this filter instance
Definition: avfilter.h:343
avfilter_execute_func * execute
This callback may be set by the caller immediately after allocating the graph and before adding any f...
Definition: avfilter.h:895
int avfilter_link(AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad)
Link two filters together.
Definition: avfilter.c:135
AVFilterPad * output_pads
array of output pads
Definition: avfilter.h:349
const char * avfilter_license(void)
Return the libavfilter license.
Definition: avfilter.c:88
unsigned ready
Ready status of the filter.
Definition: avfilter.h:408
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.
Definition: avfilter.h:837
int flags
A combination of AVFILTER_FLAG_*.
Definition: avfilter.h:187
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.
Definition: avfiltergraph.c:142
int nb_threads
Maximum number of threads used by filters in this graph.
Definition: avfilter.h:869
int avfilter_config_links(AVFilterContext *filter)
Negotiate the media format, dimensions, etc of all inputs to a filter.
Definition: avfilter.c:277
AVFilterContext * avfilter_graph_get_filter(AVFilterGraph *graph, const char *name)
Get a filter instance identified by instance name from graph.
Definition: avfiltergraph.c:290
int(* preinit)(AVFilterContext *ctx)
Filter pre-initialization function.
Definition: avfilter.h:210
int avfilter_graph_parse2(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs)
Add a graph described by a string to a graph.
Definition: graphparser.c:407
int extra_hw_frames
Sets the number of extra hardware frames which the filter will allocate on its output links for use i...
Definition: avfilter.h:424
A filter pad used for either input or output.
Definition: internal.h:54
A link between two filters.
Definition: avfilter.h:439
AVFilterPad * input_pads
array of input pads
Definition: avfilter.h:345
unsigned flags
Link processing flags.
Definition: avfilter.h:578
int min_samples
Minimum number of samples to filter at once.
Definition: avfilter.h:562
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable; if left to 0/0, will be automatically copied from the first input of the source filter if it exists.
Definition: avfilter.h:542
int sample_rate
samples per second
Definition: avfilter.h:454
unsigned nb_outputs
number of output pads
Definition: avfilter.h:351
unsigned avfilter_version(void)
Return the LIBAVFILTER_VERSION_INT constant.
Definition: avfilter.c:77
int64_t current_pts_us
Current timestamp of the link, as defined by the most recent frame(s), in AV_TIME_BASE units...
Definition: avfilter.h:524
struct AVFilterInOut AVFilterInOut
A linked-list of the inputs/outputs of the filter chain.
void * priv
private data for use by the filter
Definition: avfilter.h:353
char * enable_str
enable expression string
Definition: avfilter.h:382
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link...
Definition: avfilter.h:465
AVFilterFormats * in_formats
Lists of formats and channel layouts supported by the input and output filters respectively.
Definition: avfilter.h:481
AVFilterLink ** sink_links
Private fields.
Definition: avfilter.h:906
reference-counted frame API
int w
agreed upon image width
Definition: avfilter.h:449
const AVFilter * avfilter_get_by_name(const char *name)
Get a filter definition matching the given name.
Definition: allfilters.c:428
attribute_deprecated void avfilter_link_set_closed(AVFilterLink *link, int closed)
Set the closed field of a link.
Definition: avfilter.c:235
AVBufferRef * hw_frames_ctx
For hwaccel pixel formats, this should be a reference to the AVHWFramesContext describing the frames...
Definition: avfilter.h:601
unsigned nb_inputs
number of input pads
Definition: avfilter.h:347
int(* init)(AVFilterContext *ctx)
Filter initialization function.
Definition: avfilter.h:233
Definition: internal.h:154
int flags_internal
Additional flags for avfilter internal use only.
Definition: avfilter.h:286
AVFilterContext * src
source filter
Definition: avfilter.h:440
int partial_buf_size
Size of the partial buffer to allocate.
Definition: avfilter.h:553
Definition: avfilter.h:840
int age_index
Index in the age array.
Definition: avfilter.h:529
AVFrame * partial_buf
Buffer partially filled with samples to achieve a fixed/minimum size.
Definition: avfilter.h:547
AVFilterContext * filter_ctx
filter context associated to this input/output
Definition: avfilter.h:1008
int format
agreed upon media format
Definition: avfilter.h:456
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...
Definition: avfilter.h:823
A list of supported channel layouts.
Definition: formats.h:85
int avfilter_init_str(AVFilterContext *ctx, const char *args)
Initialize a filter with the supplied parameters.
Definition: avfilter.c:924
const AVFilterPad * inputs
List of inputs, terminated by a zeroed element.
Definition: avfilter.h:164
struct AVFilter AVFilter
Filter definition.
const AVClass * avfilter_get_class(void)
Definition: avfilter.c:1620
A linked-list of the inputs/outputs of the filter chain.
Definition: avfilter.h:1003
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.
Definition: avfilter.c:240
const AVClass * priv_class
A class for the private data, used to declare filter private AVOptions.
Definition: avfilter.h:182
AVFilterFormats * in_samplerates
Lists of channel layouts and sample rates used for automatic negotiation.
Definition: avfilter.h:488
int(* process_command)(AVFilterContext *, const char *cmd, const char *arg, char *res, int res_len, int flags)
Make the filter instance process a command.
Definition: avfilter.h:306
int avfilter_graph_request_oldest(AVFilterGraph *graph)
Request a frame on the oldest sink link.
Definition: avfiltergraph.c:1396
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.
Definition: avfilter.c:557
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.
Definition: graphparser.c:475
Describe the class of an AVClass context structure.
Definition: log.h:67
Filter definition.
Definition: avfilter.h:144
int pad_idx
index of the filt_ctx pad to use for linking
Definition: avfilter.h:1011
Rational number (pair of numerator and denominator).
Definition: rational.h:58
const AVFilter * av_filter_iterate(void **opaque)
Iterate over all registered filters.
Definition: allfilters.c:417
int(* query_formats)(AVFilterContext *)
Query formats supported by the filter on its inputs and outputs.
Definition: avfilter.h:282
struct AVFilter * next
Used by the filter registration system.
Definition: avfilter.h:292
AVMediaType
Definition: avutil.h:199
refcounted data buffer API
const char * name
Filter name.
Definition: avfilter.h:148
const char * avfilter_configuration(void)
Return the libavfilter build-time configuration.
Definition: avfilter.c:83
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
Definition: avfilter.h:451
const char * avfilter_pad_get_name(const AVFilterPad *pads, int pad_idx)
Get the name of an AVFilterPad.
Definition: avfilter.c:1034
AVFilterLink ** outputs
array of pointers to output links
Definition: avfilter.h:350
Definition: internal.h:38
void * frame_pool
A pointer to a FFFramePool struct.
Definition: avfilter.h:588
char * name
unique name for this input/output in the list
Definition: avfilter.h:1005
int(* init_opaque)(AVFilterContext *ctx, void *opaque)
Filter initialization function, alternative to the init() callback.
Definition: avfilter.h:313
started, but incomplete
Definition: avfilter.h:505
int avfilter_init_dict(AVFilterContext *ctx, AVDictionary **options)
Initialize a filter with the supplied dictionary of options.
Definition: avfilter.c:887
struct AVFilterGraph * graph
Graph the filter belongs to.
Definition: avfilter.h:512
A reference to a data buffer.
Definition: buffer.h:81
void * opaque
Opaque user data.
Definition: avfilter.h:881
AVFilterInOut * avfilter_inout_alloc(void)
Allocate a single AVFilterInOut entry.
Definition: graphparser.c:198
Utilties for rational number calculation.
char * avfilter_graph_dump(AVFilterGraph *graph, const char *options)
Dump a graph into a human-readable string representation.
Definition: graphdump.c:154
uint64_t channel_layout
channel layout of current buffer (see libavutil/channel_layout.h)
Definition: avfilter.h:453
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.
Definition: avfiltergraph.c:1286
int channels
Number of channels.
Definition: avfilter.h:573
char * aresample_swr_opts
swr options to use for the auto-inserted aresample filters, Access ONLY through AVOptions ...
Definition: avfilter.h:897
const char * description
A description of the filter.
Definition: avfilter.h:155
AVFilterContext * avfilter_graph_alloc_filter(AVFilterGraph *graph, const AVFilter *filter, const char *name)
Create a new filter instance in a filter graph.
Definition: avfiltergraph.c:170
AVFilterContext * dst
dest filter
Definition: avfilter.h:443
void * enable
parsed expression (AVExpr*)
Definition: avfilter.h:383
const AVClass * av_class
needed for av_log() and filters common options
Definition: avfilter.h:339
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.
Definition: graphparser.c:538
An instance of a filter.
Definition: avfilter.h:338
int avfilter_pad_count(const AVFilterPad *pads)
Get the number of elements in a NULL-terminated array of AVFilterPads (e.g.
Definition: avfilter.c:578
AVFilterPad * srcpad
output pad on the source filter
Definition: avfilter.h:441
const AVFilterPad * outputs
List of outputs, terminated by a zeroed element.
Definition: avfilter.h:172
all automatic conversions disabled
Definition: avfilter.h:976
void avfilter_link_free(AVFilterLink **link)
Free the link in *link, and set its pointer to NULL.
Definition: avfilter.c:174
const AVFilter * filter
the AVFilter of which this is an instance
Definition: avfilter.h:341
int64_t current_pts
Current timestamp of the link, as defined by the most recent frame(s), in link time_base units...
Definition: avfilter.h:518