vaapidecode: don't GLTextureUpload if dmabuf
authorVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Sun, 16 Oct 2016 00:04:09 +0000 (01:04 +0100)
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Fri, 3 Feb 2017 16:11:56 +0000 (17:11 +0100)
Do not add the meta:GstVideoGLTextureUploadMeta feature if the render
element can handle dmabuf-based buffers, avoiding its negotiation.

gst/vaapi/gstvaapidecode.c

index 1d84a8f..80993d5 100644 (file)
@@ -213,15 +213,18 @@ gst_vaapidecode_ensure_allowed_srcpad_caps (GstVaapiDecode * decode)
     return FALSE;
 
   /* Create VA caps */
-  out_caps = gst_caps_from_string (GST_VAAPI_MAKE_SURFACE_CAPS
-#if (USE_GLX || USE_EGL)
-      ";" GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS
-#endif
-      );
+  out_caps = gst_caps_from_string (GST_VAAPI_MAKE_SURFACE_CAPS);
   if (!out_caps) {
     GST_WARNING_OBJECT (decode, "failed to create VA/GL source caps");
     return FALSE;
   }
+#if (USE_GLX || USE_EGL)
+  if (!GST_VAAPI_PLUGIN_BASE_SRC_PAD_CAN_DMABUF (decode)) {
+    out_caps = gst_caps_make_writable (out_caps);
+    gst_caps_append (out_caps,
+        gst_caps_from_string (GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS));
+  }
+#endif
 
   raw_caps = gst_vaapi_plugin_base_get_allowed_raw_caps
       (GST_VAAPI_PLUGIN_BASE (decode));