avfilter/vf_fade: Force alpha pixel format if alpha is set to 1
Fixes Ticket4321 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -115,12 +115,30 @@ static int query_formats(AVFilterContext *ctx)
|
|||||||
AV_PIX_FMT_RGBA, AV_PIX_FMT_BGRA,
|
AV_PIX_FMT_RGBA, AV_PIX_FMT_BGRA,
|
||||||
AV_PIX_FMT_NONE
|
AV_PIX_FMT_NONE
|
||||||
};
|
};
|
||||||
|
static const enum AVPixelFormat pix_fmts_alpha[] = {
|
||||||
|
AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
|
||||||
|
AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR,
|
||||||
|
AV_PIX_FMT_RGBA, AV_PIX_FMT_BGRA,
|
||||||
|
AV_PIX_FMT_NONE
|
||||||
|
};
|
||||||
|
static const enum AVPixelFormat pix_fmts_rgba[] = {
|
||||||
|
AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR,
|
||||||
|
AV_PIX_FMT_RGBA, AV_PIX_FMT_BGRA,
|
||||||
|
AV_PIX_FMT_NONE
|
||||||
|
};
|
||||||
AVFilterFormats *fmts_list;
|
AVFilterFormats *fmts_list;
|
||||||
|
|
||||||
|
if (s->alpha) {
|
||||||
|
if (s->black_fade)
|
||||||
|
fmts_list = ff_make_format_list(pix_fmts_alpha);
|
||||||
|
else
|
||||||
|
fmts_list = ff_make_format_list(pix_fmts_rgba);
|
||||||
|
} else {
|
||||||
if (s->black_fade)
|
if (s->black_fade)
|
||||||
fmts_list = ff_make_format_list(pix_fmts);
|
fmts_list = ff_make_format_list(pix_fmts);
|
||||||
else
|
else
|
||||||
fmts_list = ff_make_format_list(pix_fmts_rgb);
|
fmts_list = ff_make_format_list(pix_fmts_rgb);
|
||||||
|
}
|
||||||
if (!fmts_list)
|
if (!fmts_list)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
return ff_set_common_formats(ctx, fmts_list);
|
return ff_set_common_formats(ctx, fmts_list);
|
||||||
|
Reference in New Issue
Block a user