[vlc-commits] vaapi: gl: check that the image can be derived
Thomas Guillem
git at videolan.org
Fri Oct 25 08:07:37 CEST 2019
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Oct 8 09:35:26 2019 +0200| [451a3eacb955bc95d757d30168e8429651887996] | committer: Steve Lhomme
vaapi: gl: check that the image can be derived
The check was done initially in the pf_pool callback.
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=451a3eacb955bc95d757d30168e8429651887996
---
modules/video_output/opengl/converter_vaapi.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/modules/video_output/opengl/converter_vaapi.c b/modules/video_output/opengl/converter_vaapi.c
index 36e3e974ec..2336e38a11 100644
--- a/modules/video_output/opengl/converter_vaapi.c
+++ b/modules/video_output/opengl/converter_vaapi.c
@@ -327,6 +327,28 @@ tc_va_check_interop_blacklist(opengl_tex_converter_t *tc, VADisplay *vadpy)
return VLC_SUCCESS;
}
+static int
+tc_va_check_derive_image(opengl_tex_converter_t *tc,
+ vlc_decoder_device *dec_device)
+{
+ vlc_object_t *o = VLC_OBJECT(tc->gl);
+ struct priv *priv = tc->priv;
+ VASurfaceID *va_surface_ids;
+
+ picture_pool_t *pool = vlc_vaapi_PoolNew(o, dec_device, priv->vadpy, 1,
+ &va_surface_ids, &tc->fmt, true);
+ if (!pool)
+ return VLC_EGENERIC;
+
+ VAImage va_image = { .image_id = VA_INVALID_ID };
+ int ret = vlc_vaapi_DeriveImage(o, priv->vadpy, va_surface_ids[0],
+ &va_image);
+
+ picture_pool_Release(pool);
+
+ return ret;
+}
+
static int
Open(vlc_object_t *obj)
{
@@ -393,6 +415,9 @@ Open(vlc_object_t *obj)
if (tc_va_check_interop_blacklist(tc, priv->vadpy))
goto error;
+ if (tc_va_check_derive_image(tc, dec_device))
+ goto error;
+
tc->fshader = opengl_fragment_shader_init(tc, GL_TEXTURE_2D, vlc_sw_chroma,
tc->fmt.space);
if (tc->fshader == 0)
More information about the vlc-commits
mailing list