Commit 7a46400e authored by Thomas Guillem's avatar Thomas Guillem

hw: vaapi: add vlc_vaapi_IsChromaOpaque

parent fc1226e3
......@@ -56,7 +56,7 @@ vlc_vaapi_FilterHoldInstance(filter_t *filter, VADisplay *dpy)
if (!pic)
return NULL;
if (pic->format.i_chroma != VLC_CODEC_VAAPI_420)
if (!vlc_vaapi_IsChromaOpaque(pic->format.i_chroma))
{
picture_Release(pic);
return NULL;
......@@ -360,7 +360,7 @@ Open(filter_t * filter,
{
filter_sys_t * filter_sys;
if (filter->fmt_out.video.i_chroma != VLC_CODEC_VAAPI_420 ||
if (!vlc_vaapi_IsChromaOpaque(filter->fmt_out.video.i_chroma) ||
!video_format_IsSimilar(&filter->fmt_out.video, &filter->fmt_in.video))
return VLC_EGENERIC;
......
......@@ -638,7 +638,7 @@ vlc_vaapi_PicSysHoldInstance(picture_sys_t *sys, VADisplay *dpy)
}
#define ASSERT_VAAPI_CHROMA(pic) do { \
assert(pic->format.i_chroma == VLC_CODEC_VAAPI_420); \
assert(vlc_vaapi_IsChromaOpaque(pic->format.i_chroma)); \
} while(0)
void
......
......@@ -205,4 +205,10 @@ vlc_vaapi_PicGetSurface(picture_t *pic);
VADisplay
vlc_vaapi_PicGetDisplay(picture_t *pic);
static inline bool
vlc_vaapi_IsChromaOpaque(int i_vlc_chroma)
{
return i_vlc_chroma == VLC_CODEC_VAAPI_420;
}
#endif /* VLC_VAAPI_H */
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