40 for (; (*graph)->filter_count > 0; (*graph)->filter_count--)
61 const char *
name,
const char *args,
void *opaque,
92 "Input pad \"%s\" for the filter \"%s\" of type \"%s\" not connected to any source\n",
101 "Output pad \"%s\" for the filter \"%s\" of type \"%s\" not connected to any destination\n",
142 int scaler_count = 0;
163 char scale_args[256];
165 snprintf(inst_name,
sizeof(inst_name),
"auto-inserted scaler %d",
167 av_strlcpy(scale_args,
"0:0",
sizeof(scale_args));
169 av_strlcat(scale_args,
":",
sizeof(scale_args));
173 inst_name, scale_args,
NULL, graph)) < 0)
179 if (((link = scale-> inputs[0]) &&
184 "Impossible to convert between the formats supported by the filter "
AVFilterContext ** filters
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
void avfilter_graph_free(AVFilterGraph **graph)
Free a graph, destroy its links, and set *graph to NULL.
void avfilter_free(AVFilterContext *filter)
Free a filter context.
int ff_avfilter_graph_config_formats(AVFilterGraph *graph, AVClass *log_ctx)
Configure the formats of all the links in the graph.
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 * av_realloc(void *ptr, size_t size)
Allocate or reallocate a block of memory.
int(* query_formats)(AVFilterContext *)
Queries formats supported by the filter and its pads, and sets the in_formats for links connected to ...
char * scale_sws_opts
sws options to use for the auto-inserted scale filters
int ff_avfilter_graph_config_links(AVFilterGraph *graph, AVClass *log_ctx)
Configure all the links of graphctx.
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
const char * name
Pad name.
AVFilterLink ** inputs
array of pointers to input links
char * name
name of this filter instance
AVFilterPad * output_pads
array of output pads
static void pick_format(AVFilterLink *link)
AVFilterContext * avfilter_graph_get_filter(AVFilterGraph *graph, char *name)
Get a filter instance with name name from graph.
int avfilter_config_links(AVFilterContext *filter)
Negotiate the media format, dimensions, etc of all inputs to a filter.
unsigned input_count
number of input pads
static void pick_formats(AVFilterGraph *graph)
int avfilter_default_query_formats(AVFilterContext *ctx)
Default handler for query_formats()
A link between two filters.
AVFilterPad * input_pads
array of input pads
int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque)
Initialize a filter.
int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx)
Check validity and configure all the links and formats in the graph.
AVFilter * avfilter_get_by_name(const char *name)
Get a filter definition matching the given name.
void av_log(void *avcl, int level, const char *fmt,...)
AVFilterFormats * in_formats
Lists of formats supported by the input and output filters respectively.
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
static void filter(MpegAudioContext *s, int ch, const short *samples, int incr)
unsigned output_count
number of output pads
AVFilterGraph * avfilter_graph_alloc(void)
Allocate a filter graph.
int ff_avfilter_graph_check_validity(AVFilterGraph *graph, AVClass *log_ctx)
Check for the validity of graph.
int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name)
Create a filter instance.
AVFilterContext * src
source filter
int format
agreed upon media format
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int avfilter_graph_create_filter(AVFilterContext **filt_ctx, AVFilter *filt, const char *name, const char *args, void *opaque, AVFilterGraph *graph_ctx)
Create and add a filter instance into an existing graph.
Describe the class of an AVClass context structure.
static struct PPFilter filters[]
const char * name
filter name
AVFilterFormats * avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b)
Return a format list which contains the intersection of the formats of a and b.
AVFilterLink ** outputs
array of pointers to output links
size_t av_strlcat(char *dst, const char *src, size_t size)
Append the string src to the string dst, but to a total length of no more than size - 1 bytes...
static const uint16_t scale[4]
static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
void avfilter_formats_unref(AVFilterFormats **ref)
If *ref is non-NULL, remove *ref as a reference to the format list it currently points to...
AVFilterContext * dst
dest filter
AVFilter * filter
the AVFilter of which this is an instance
int avfilter_graph_add_filter(AVFilterGraph *graph, AVFilterContext *filter)
Add an existing filter instance to a filter graph.
AVFilterFormats * out_formats