29 int main(
int argc,
char **argv)
35 const char *filter_args =
NULL;
41 fprintf(stderr,
"Missing filter name as argument\n");
45 filter_name = argv[1];
47 filter_args = argv[2];
58 fprintf(stderr,
"Unrecognized filter with name '%s'\n", filter_name);
64 fprintf(stderr,
"Impossible to open filter with name '%s'\n",
69 fprintf(stderr,
"Impossible to init filter '%s' with arguments '%s'\n",
70 filter_name, filter_args);
75 for (i = 0; i < filter_ctx->
nb_inputs; i++) {
78 filter_ctx->
inputs[i] = link;
92 for (i = 0; i < filter_ctx->
nb_inputs; i++) {
95 printf(
"INPUT[%d] %s: %s\n",
101 for (i = 0; i < filter_ctx->
nb_outputs; i++) {
104 printf(
"OUTPUT[%d] %s: %s\n",
void avfilter_free(AVFilterContext *filter)
Free a filter context.
static const char * filter_name(void *p)
AVFilterGraph * avfilter_graph_alloc(void)
Allocate a filter graph.
Main libavfilter public API header.
memory handling functions
void av_log_set_level(int level)
Set the log level.
enum AVMediaType avfilter_pad_get_type(const AVFilterPad *pads, int pad_idx)
Get the type of an AVFilterPad.
void avfilter_graph_free(AVFilterGraph **graph)
Free a graph, destroy its links, and set *graph to NULL.
int(* query_formats)(AVFilterContext *)
Query formats supported by the filter on its inputs and outputs.
AVFilterLink ** inputs
array of pointers to input links
void avfilter_register_all(void)
Initialize the filter system.
A link between two filters.
unsigned nb_outputs
number of output pads
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
AVFilterFormats * in_formats
Lists of formats supported by the input and output filters respectively.
const AVFilter * avfilter_get_by_name(const char *name)
Get a filter definition matching the given name.
static void filter(MpegAudioContext *s, int ch, const short *samples, int incr)
unsigned nb_inputs
number of input pads
int avfilter_init_str(AVFilterContext *filter, const char *args)
Initialize a filter with the supplied parameters.
const AVFilterPad * inputs
List of inputs, terminated by a zeroed element.
const char * avfilter_pad_get_name(const AVFilterPad *pads, int pad_idx)
Get the name of an AVFilterPad.
AVFilterLink ** outputs
array of pointers to output links
enum AVMediaType type
filter media type
AVFilterContext * avfilter_graph_alloc_filter(AVFilterGraph *graph, const AVFilter *filter, const char *name)
Create a new filter instance in a filter graph.
int main(int argc, char **argv)
const AVFilterPad * outputs
List of outputs, terminated by a zeroed element.
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
const AVFilter * filter
the AVFilter of which this is an instance
AVFilterFormats * out_formats