33 #define PRINT_FMTS(inout, outin, INOUT) \
34 for (i = 0; i < filter_ctx->nb_##inout##puts; 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->inout##put_pads[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->inout##put_pads[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->inout##put_pads[i].name, buf); \
68 int main(
int argc,
char **argv)
73 const char *filter_name;
74 const char *filter_args = NULL;
80 fprintf(stderr,
"Missing filter name as argument\n");
84 filter_name = argv[1];
86 filter_args = argv[2];
97 fprintf(stderr,
"Unrecognized filter with name '%s'\n", filter_name);
103 fprintf(stderr,
"Impossible to open filter with name '%s'\n",
108 fprintf(stderr,
"Impossible to init filter '%s' with arguments '%s'\n",
109 filter_name, filter_args);
114 for (i = 0; i < filter_ctx->
nb_inputs; i++) {
117 filter_ctx->
inputs[i] = link;
119 for (i = 0; i < filter_ctx->
nb_outputs; i++) {