Unified · Split
| @@ -124,19 +124,16 @@ static av_cold int init(AVFilterContext *ctx) · 123 unmodified lines | ||
| 124 | 124 | |
| 125 | 125 | static int query_formats(AVFilterContext *ctx) |
| 126 | 126 | { |
| 127 | − AVFilterFormats *pix_fmts = NULL; | |
| 128 | − int fmt, ret; | |
| 129 | − | |
| 130 | − for (fmt = 0; av_pix_fmt_desc_get(fmt); fmt++) { | |
| 131 | − const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt); | |
| 132 | − if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL || | |
| 133 | − desc->flags & AV_PIX_FMT_FLAG_PAL || | |
| 134 | − desc->flags & AV_PIX_FMT_FLAG_BITSTREAM) && | |
| 135 | − (ret = ff_add_format(&pix_fmts, fmt)) < 0) | |
| 136 | − return ret; | |
| 137 | − } | |
| 127 | + AVFilterFormats *formats = NULL; | |
| 128 | + int ret; | |
| 138 | 129 | |
| 139 | − return ff_set_common_formats(ctx, pix_fmts); | |
| 130 | + ret = ff_formats_pixdesc_filter(&formats, 0, | |
| 131 | + AV_PIX_FMT_FLAG_BITSTREAM | | |
| 132 | + AV_PIX_FMT_FLAG_PAL | | |
| 133 | + AV_PIX_FMT_FLAG_HWACCEL); | |
| 134 | + if (ret < 0) | |
| 135 | + return ret; | |
| 136 | + return ff_set_common_formats(ctx, formats); | |
| 140 | 137 | } |
| 141 | 138 | |
| 142 | 139 | static int config_input(AVFilterLink *inlink) |