Commit e9d1c94e authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

blend: support BGRA blending

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 7871ce36
......@@ -268,9 +268,15 @@ public:
CPictureRGBX(const CPicture &cfg) : CPicture(cfg)
{
if (has_alpha) {
offset_r = 0;
offset_g = 1;
offset_b = 2;
if (fmt->i_chroma == VLC_CODEC_BGRA) {
offset_r = 2;
offset_g = 1;
offset_b = 0;
} else {
offset_r = 0;
offset_g = 1;
offset_b = 2;
}
offset_a = 3;
} else {
#ifdef WORDS_BIGENDIAN
......@@ -403,6 +409,7 @@ typedef CPictureYUVPacked<0, 3, 1> CPictureYVYU;
typedef CPictureYUVPacked<1, 2, 0> CPictureVYUY;
typedef CPictureRGBX<4, true> CPictureRGBA;
typedef CPictureRGBX<4, true> CPictureBGRA;
typedef CPictureRGBX<4, false> CPictureRGB32;
typedef CPictureRGBX<3, false> CPictureRGB24;
......@@ -565,6 +572,7 @@ static const struct {
RGB(VLC_CODEC_RGB24, CPictureRGB24, convertNone),
RGB(VLC_CODEC_RGB32, CPictureRGB32, convertNone),
RGB(VLC_CODEC_RGBA, CPictureRGBA, convertNone),
RGB(VLC_CODEC_BGRA, CPictureBGRA, convertNone),
YUV(VLC_CODEC_YV9, CPictureYV9, convertNone),
YUV(VLC_CODEC_I410, CPictureI410_8, convertNone),
......
......@@ -1433,12 +1433,14 @@ subpicture_t *spu_Render(spu_t *spu,
VLC_CODEC_YUVA,
VLC_CODEC_RGBA,
VLC_CODEC_ARGB,
VLC_CODEC_BGRA,
VLC_CODEC_YUVP,
0,
};
static const vlc_fourcc_t chroma_list_default_rgb[] = {
VLC_CODEC_RGBA,
VLC_CODEC_ARGB,
VLC_CODEC_BGRA,
VLC_CODEC_YUVA,
VLC_CODEC_YUVP,
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