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.
This commit is contained in:
Philipp Zabel 2020-03-06 00:03:49 +01:00
parent 0200175d97
commit 40773e9c91

View file

@ -633,6 +633,11 @@ _dma_buf_upload_accept (gpointer impl, GstBuffer * buffer, GstCaps * in_caps,
"EGL_KHR_image_base")) "EGL_KHR_image_base"))
return FALSE; 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 */ /* This will eliminate most non-dmabuf out there */
if (!gst_is_dmabuf_memory (gst_buffer_peek_memory (buffer, 0))) if (!gst_is_dmabuf_memory (gst_buffer_peek_memory (buffer, 0)))
return FALSE; return FALSE;