From 3531dfa35eec482098c17f3124b8d36ad33029c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Tue, 5 Apr 2016 13:07:14 +0200 Subject: [PATCH] vaapidecode: caps negotiation checks Check that GLUploadTexture is not negotatiated if gstreamer-vaapi is not compiled with GL support. --- gst/vaapi/gstvaapidecode.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index 5d73ae6eff..a9603babc8 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -262,6 +262,12 @@ gst_vaapidecode_update_src_caps (GstVaapiDecode * decode) if (feature == GST_VAAPI_CAPS_FEATURE_NOT_NEGOTIATED) return FALSE; +#if (!USE_GLX && !USE_EGL) + /* This is a very pathological situation. Should not happen. */ + if (feature == GST_VAAPI_CAPS_FEATURE_GL_TEXTURE_UPLOAD_META) + return FALSE; +#endif + if ((feature == GST_VAAPI_CAPS_FEATURE_SYSTEM_MEMORY || feature == GST_VAAPI_CAPS_FEATURE_VAAPI_SURFACE) && format != GST_VIDEO_INFO_FORMAT (&decode->decoded_info)) { @@ -271,13 +277,11 @@ gst_vaapidecode_update_src_caps (GstVaapiDecode * decode) } switch (feature) { -#if (USE_GLX || USE_EGL) case GST_VAAPI_CAPS_FEATURE_GL_TEXTURE_UPLOAD_META: features = gst_caps_features_new (GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META, NULL); break; -#endif case GST_VAAPI_CAPS_FEATURE_VAAPI_SURFACE: features = gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE, NULL);