35 #define PRINT_FMTS(inout, outin, INOUT) \
36 for (i = 0; i < filter_ctx->nb_##inout##puts; i++) { \
37 if (filter_ctx->inout##puts[i]->type == AVMEDIA_TYPE_VIDEO) { \
38 AVFilterFormats *fmts = \
39 filter_ctx->inout##puts[i]->outin##_formats; \
40 for (j = 0; j < fmts->nb_formats; j++) \
41 if(av_get_pix_fmt_name(fmts->formats[j])) \
42 printf(#INOUT "PUT[%d] %s: fmt:%s\n", \
43 i, avfilter_pad_get_name(filter_ctx->inout##put_pads, i), \
44 av_get_pix_fmt_name(fmts->formats[j])); \
45 } else if (filter_ctx->inout##puts[i]->type == AVMEDIA_TYPE_AUDIO) { \
46 AVFilterFormats *fmts; \
47 AVFilterChannelLayouts *layouts; \
49 fmts = filter_ctx->inout##puts[i]->outin##_formats; \
50 for (j = 0; j < fmts->nb_formats; j++) \
51 printf(#INOUT "PUT[%d] %s: fmt:%s\n", \
52 i, avfilter_pad_get_name(filter_ctx->inout##put_pads, i), \
53 av_get_sample_fmt_name(fmts->formats[j])); \
55 layouts = filter_ctx->inout##puts[i]->outin##_channel_layouts; \
56 for (j = 0; j < layouts->nb_channel_layouts; j++) { \
58 av_get_channel_layout_string(buf, sizeof(buf), -1, \
59 layouts->channel_layouts[j]); \
60 printf(#INOUT "PUT[%d] %s: chlayout:%s\n", \
61 i, avfilter_pad_get_name(filter_ctx->inout##put_pads, i), buf); \
70 int main(
int argc,
char **argv)
75 const char *filter_name;
76 const char *filter_args = NULL;
82 fprintf(stderr,
"Missing filter name as argument\n");
86 filter_name = argv[1];
88 filter_args = argv[2];
99 fprintf(stderr,
"Unrecognized filter with name '%s'\n", filter_name);
105 fprintf(stderr,
"Impossible to open filter with name '%s'\n",
110 fprintf(stderr,
"Impossible to init filter '%s' with arguments '%s'\n",
111 filter_name, filter_args);
116 for (i = 0; i < filter_ctx->
nb_inputs; i++) {
119 filter_ctx->
inputs[i] = link;
121 for (i = 0; i < filter_ctx->
nb_outputs; i++) {