33 #define PRINT_FMTS(inout, outin, INOUT) \
34 for (i = 0; i < filter_ctx->inout##put_count; i++) { \
35 if (filter_ctx->inout##puts[i]->type == AVMEDIA_TYPE_VIDEO) { \
36 AVFilterFormats *fmts = \
37 filter_ctx->inout##puts[i]->outin##_formats; \
38 for (j = 0; j < fmts->nb_formats; j++) \
39 if(av_get_pix_fmt_name(fmts->formats[j])) \
40 printf(#INOUT "PUT[%d] %s: fmt:%s\n", \
41 i, filter_ctx->filter->inout##puts[i].name, \
42 av_get_pix_fmt_name(fmts->formats[j])); \
43 } else if (filter_ctx->inout##puts[i]->type == AVMEDIA_TYPE_AUDIO) { \
44 AVFilterFormats *fmts; \
45 AVFilterChannelLayouts *layouts; \
47 fmts = filter_ctx->inout##puts[i]->outin##_formats; \
48 for (j = 0; j < fmts->nb_formats; j++) \
49 printf(#INOUT "PUT[%d] %s: fmt:%s\n", \
50 i, filter_ctx->filter->inout##puts[i].name, \
51 av_get_sample_fmt_name(fmts->formats[j])); \
53 layouts = filter_ctx->inout##puts[i]->outin##_channel_layouts; \
54 for (j = 0; j < layouts->nb_channel_layouts; j++) { \
56 av_get_channel_layout_string(buf, sizeof(buf), -1, \
57 layouts->channel_layouts[j]); \
58 printf(#INOUT "PUT[%d] %s: chlayout:%s\n", \
59 i, filter_ctx->filter->inout##puts[i].name, buf); \
68 int main(
int argc,
char **argv)
72 const char *filter_name;
73 const char *filter_args = NULL;
79 fprintf(stderr,
"Missing filter name as argument\n");
83 filter_name = argv[1];
85 filter_args = argv[2];
91 fprintf(stderr,
"Unrecognized filter with name '%s'\n", filter_name);
95 if (avfilter_open(&filter_ctx, filter, NULL) < 0) {
96 fprintf(stderr,
"Impossible to open filter with name '%s'\n",
101 fprintf(stderr,
"Impossible to init filter '%s' with arguments '%s'\n",
102 filter_name, filter_args);
107 for (i = 0; i < filter_ctx->input_count; i++) {
110 filter_ctx->
inputs[i] = link;
112 for (i = 0; i < filter_ctx->output_count; i++) {