In order to enable, in the future, dmabuf-based buffers, the vaapi base
plugin needs to check if downstream can import dmabuf buffers.
This patch checks if downstream can handle dmabuf, by introspecting the
shared GL context. If the GL context is EGL/GLES2 and have the extension
EGL_EXT_image_dma_buf_import, then dmabuf can be negotiated.
Original-patch-by: Julien Isorce <j.isorce@samsung.com>
display_type = GST_VAAPI_DISPLAY_TYPE_GLX;
break;
#endif
-#if USE_EGL
case GST_GL_PLATFORM_EGL:
+#if VA_CHECK_VERSION (0,36,0) && USE_GST_GL_HELPERS
+ plugin->srcpad_can_dmabuf =
+ (!(gst_gl_context_get_gl_api (gl_context) & GST_GL_API_GLES1)
+ && gst_gl_context_check_feature (gl_context,
+ "EGL_EXT_image_dma_buf_import"));
+#endif
+#if USE_EGL
display_type = GST_VAAPI_DISPLAY_TYPE_EGL;
break;
#endif
(GST_VAAPI_PLUGIN_BASE(plugin)->srcpad_caps)
#define GST_VAAPI_PLUGIN_BASE_SRC_PAD_INFO(plugin) \
(&GST_VAAPI_PLUGIN_BASE(plugin)->srcpad_info)
+#define GST_VAAPI_PLUGIN_BASE_SRC_PAD_CAN_DMABUF(plugin) \
+ (GST_VAAPI_PLUGIN_BASE(plugin)->srcpad_can_dmabuf)
#define GST_VAAPI_PLUGIN_BASE_DISPLAY(plugin) \
(GST_VAAPI_PLUGIN_BASE(plugin)->display)
GstCaps *allowed_raw_caps;
GstAllocator *sinkpad_allocator;
GstAllocator *srcpad_allocator;
+ gboolean srcpad_can_dmabuf;
};
struct _GstVaapiPluginBaseClass