From 40773e9c91651300aefd4e89da8766d7d05d23d7 Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Fri, 6 Mar 2020 00:03:49 +0100 Subject: [PATCH] glupload: dmabuf: only accept uploads to external-oes if supported by the context This keeps the DirectDmabufExternal uploader from accepting buffers if texture-target=external-oes is not supported by the GL context. --- gst-libs/gst/gl/gstglupload.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c index d64f08d8b5..1a7f8bad28 100644 --- a/gst-libs/gst/gl/gstglupload.c +++ b/gst-libs/gst/gl/gstglupload.c @@ -633,6 +633,11 @@ _dma_buf_upload_accept (gpointer impl, GstBuffer * buffer, GstCaps * in_caps, "EGL_KHR_image_base")) return FALSE; + if (dmabuf->target == GST_GL_TEXTURE_TARGET_EXTERNAL_OES && + !gst_gl_context_check_feature (dmabuf->upload->context, + "GL_OES_EGL_image_external")) + return FALSE; + /* This will eliminate most non-dmabuf out there */ if (!gst_is_dmabuf_memory (gst_buffer_peek_memory (buffer, 0))) return FALSE;