Commit 4bc0dbfc authored by Michael Niedermayer's avatar Michael Niedermayer

avfilter/vf_boxblur: generate supported pixfmt list instead of hardcoding

This adds support for several more >8bit planar formats
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent f7da4b1c
...@@ -117,20 +117,18 @@ static av_cold void uninit(AVFilterContext *ctx) ...@@ -117,20 +117,18 @@ static av_cold void uninit(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx)
{ {
static const enum AVPixelFormat pix_fmts[] = { AVFilterFormats *formats = NULL;
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, int fmt;
AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUVA420P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_GRAY8, for (fmt = 0; av_pix_fmt_desc_get(fmt); fmt++) {
AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P, const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt);
AV_PIX_FMT_YUVJ440P, if (!(desc->flags & (AV_PIX_FMT_FLAG_HWACCEL | AV_PIX_FMT_FLAG_BITSTREAM | AV_PIX_FMT_FLAG_PAL)) &&
AV_PIX_FMT_GBRP, (desc->flags & AV_PIX_FMT_FLAG_PLANAR || desc->nb_components == 1) &&
AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV420P10, !(desc->flags & AV_PIX_FMT_FLAG_BE) == !HAVE_BIGENDIAN)
AV_PIX_FMT_YUVA420P10, ff_add_format(&formats, fmt);
AV_PIX_FMT_GBRP10, }
AV_PIX_FMT_NONE
}; ff_set_common_formats(ctx, formats);
ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment