Commit 88d0393a authored by Jean-Paul Saman's avatar Jean-Paul Saman

VAAPI spu: as of libva API version 0.33.0 chroma keying and alpha are supported.

parent c2eac703
...@@ -266,6 +266,7 @@ out_warning: ...@@ -266,6 +266,7 @@ out_warning:
return VLC_EGENERIC; return VLC_EGENERIC;
} }
#if !VA_CHECK_VERSION(0,33,0)
static inline void vaapi_fixup_alpha(uint8_t *p_pixel, size_t i_size) static inline void vaapi_fixup_alpha(uint8_t *p_pixel, size_t i_size)
{ {
for (size_t p = 0; p < i_size; p += 4) for (size_t p = 0; p < i_size; p += 4)
...@@ -285,6 +286,7 @@ static inline void vaapi_fixup_alpha(uint8_t *p_pixel, size_t i_size) ...@@ -285,6 +286,7 @@ static inline void vaapi_fixup_alpha(uint8_t *p_pixel, size_t i_size)
} }
} }
} }
#endif
static int CopyRGBAToVAImage(vlc_object_t *obj, VADisplay p_display, static int CopyRGBAToVAImage(vlc_object_t *obj, VADisplay p_display,
picture_t *pic, VAImage *image, VAImageFormat *fmt, picture_t *pic, VAImage *image, VAImageFormat *fmt,
...@@ -292,6 +294,9 @@ static int CopyRGBAToVAImage(vlc_object_t *obj, VADisplay p_display, ...@@ -292,6 +294,9 @@ static int CopyRGBAToVAImage(vlc_object_t *obj, VADisplay p_display,
{ {
assert(image); assert(image);
assert(pic->format.i_chroma == VLC_CODEC_RGBA); assert(pic->format.i_chroma == VLC_CODEC_RGBA);
#if VA_CHECK_VERSION(0,33,0)
VLC_UNUSED(fixup_alpha);
#endif
/* Only supports RGBA images */ /* Only supports RGBA images */
if (!image || !fmt || if (!image || !fmt ||
...@@ -368,6 +373,7 @@ static int CopyRGBAToVAImage(vlc_object_t *obj, VADisplay p_display, ...@@ -368,6 +373,7 @@ static int CopyRGBAToVAImage(vlc_object_t *obj, VADisplay p_display,
bytes_copied += i_size; bytes_copied += i_size;
assert(bytes_copied <= image->data_size); assert(bytes_copied <= image->data_size);
#if !VA_CHECK_VERSION(0,33,0)
/* FIXME: Remove this code when VDPAU and XvBA backends for /* FIXME: Remove this code when VDPAU and XvBA backends for
* VAAPI properly support alpha or chroma keying in subpictures. */ * VAAPI properly support alpha or chroma keying in subpictures. */
if (fixup_alpha) if (fixup_alpha)
...@@ -375,6 +381,7 @@ static int CopyRGBAToVAImage(vlc_object_t *obj, VADisplay p_display, ...@@ -375,6 +381,7 @@ static int CopyRGBAToVAImage(vlc_object_t *obj, VADisplay p_display,
uint8_t *p_pixel = p_out + (i_line * image->pitches[0]); uint8_t *p_pixel = p_out + (i_line * image->pitches[0]);
vaapi_fixup_alpha(p_pixel, i_size); vaapi_fixup_alpha(p_pixel, i_size);
} }
#endif
} }
} }
......
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