Commit de5ec088 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '862f33c1'

* commit '862f33c1':
  vf_scale: use the pixfmt descriptor API

Conflicts:
	libavfilter/vf_scale.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents a37f2cc5 862f33c1
...@@ -178,25 +178,31 @@ static int query_formats(AVFilterContext *ctx) ...@@ -178,25 +178,31 @@ static int query_formats(AVFilterContext *ctx)
int ret; int ret;
if (ctx->inputs[0]) { if (ctx->inputs[0]) {
const AVPixFmtDescriptor *desc = NULL;
formats = NULL; formats = NULL;
for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++) while ((desc = av_pix_fmt_desc_next(desc))) {
pix_fmt = av_pix_fmt_desc_get_id(desc);
if ((sws_isSupportedInput(pix_fmt) || if ((sws_isSupportedInput(pix_fmt) ||
sws_isSupportedEndiannessConversion(pix_fmt)) sws_isSupportedEndiannessConversion(pix_fmt))
&& (ret = ff_add_format(&formats, pix_fmt)) < 0) { && (ret = ff_add_format(&formats, pix_fmt)) < 0) {
ff_formats_unref(&formats); ff_formats_unref(&formats);
return ret; return ret;
} }
}
ff_formats_ref(formats, &ctx->inputs[0]->out_formats); ff_formats_ref(formats, &ctx->inputs[0]->out_formats);
} }
if (ctx->outputs[0]) { if (ctx->outputs[0]) {
const AVPixFmtDescriptor *desc = NULL;
formats = NULL; formats = NULL;
for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++) while ((desc = av_pix_fmt_desc_next(desc))) {
pix_fmt = av_pix_fmt_desc_get_id(desc);
if ((sws_isSupportedOutput(pix_fmt) || pix_fmt == AV_PIX_FMT_PAL8 || if ((sws_isSupportedOutput(pix_fmt) || pix_fmt == AV_PIX_FMT_PAL8 ||
sws_isSupportedEndiannessConversion(pix_fmt)) sws_isSupportedEndiannessConversion(pix_fmt))
&& (ret = ff_add_format(&formats, pix_fmt)) < 0) { && (ret = ff_add_format(&formats, pix_fmt)) < 0) {
ff_formats_unref(&formats); ff_formats_unref(&formats);
return ret; return ret;
} }
}
ff_formats_ref(formats, &ctx->outputs[0]->in_formats); ff_formats_ref(formats, &ctx->outputs[0]->in_formats);
} }
......
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