Skip to content

Commit 292b9a8

Browse files
committed
Until I find a better method of detecting pix_fmt's that have an alpha channel, I'm going with a simple list. Not sure if this will work well with older versions of FFmpeg though, as these items change over time. Waiting to see how build servers handle it.
1 parent 2563c3c commit 292b9a8

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/FFmpegUtilities.h

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,25 @@
129129
// Does ffmpeg pixel format contain an alpha channel?
130130
inline static const bool ffmpeg_has_alpha(PixelFormat pix_fmt)
131131
{
132-
if (pix_fmt == AV_PIX_FMT_ARGB || pix_fmt == AV_PIX_FMT_RGBA || pix_fmt == AV_PIX_FMT_ABGR || pix_fmt == AV_PIX_FMT_BGRA || pix_fmt == AV_PIX_FMT_YUVA420P) {
132+
if (pix_fmt == AV_PIX_FMT_ARGB ||
133+
pix_fmt == AV_PIX_FMT_RGBA ||
134+
pix_fmt == AV_PIX_FMT_ABGR ||
135+
pix_fmt == AV_PIX_FMT_BGRA ||
136+
pix_fmt == AV_PIX_FMT_YUVA420P ||
137+
pix_fmt == AV_PIX_FMT_YA16LE ||
138+
pix_fmt == AV_PIX_FMT_YA16BE ||
139+
pix_fmt == AV_PIX_FMT_YA8 ||
140+
pix_fmt == AV_PIX_FMT_GBRAP ||
141+
pix_fmt == AV_PIX_FMT_GBRAP10BE ||
142+
pix_fmt == AV_PIX_FMT_GBRAP10LE ||
143+
pix_fmt == AV_PIX_FMT_GBRAP12BE ||
144+
pix_fmt == AV_PIX_FMT_GBRAP12LE ||
145+
pix_fmt == AV_PIX_FMT_GBRAP16BE ||
146+
pix_fmt == AV_PIX_FMT_GBRAP16LE ||
147+
pix_fmt == AV_PIX_FMT_GBRPF32BE ||
148+
pix_fmt == AV_PIX_FMT_GBRPF32LE ||
149+
pix_fmt == AV_PIX_FMT_GBRAPF32BE ||
150+
pix_fmt == AV_PIX_FMT_GBRAPF32LE) {
133151
return true;
134152
} else {
135153
return false;

0 commit comments

Comments
 (0)