diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c index f2929db818..8c23110984 100644 --- a/gst/vaapi/gstvaapipluginbase.c +++ b/gst/vaapi/gstvaapipluginbase.c @@ -1103,8 +1103,14 @@ gst_vaapi_plugin_base_set_gl_context (GstVaapiPluginBase * plugin, 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 diff --git a/gst/vaapi/gstvaapipluginbase.h b/gst/vaapi/gstvaapipluginbase.h index e1db5e72f4..bfeeb1078e 100644 --- a/gst/vaapi/gstvaapipluginbase.h +++ b/gst/vaapi/gstvaapipluginbase.h @@ -87,6 +87,8 @@ typedef struct _GstVaapiPluginBaseClass GstVaapiPluginBaseClass; (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) @@ -146,6 +148,7 @@ struct _GstVaapiPluginBase GstCaps *allowed_raw_caps; GstAllocator *sinkpad_allocator; GstAllocator *srcpad_allocator; + gboolean srcpad_can_dmabuf; }; struct _GstVaapiPluginBaseClass