[Bug 743345] glupload: Add support for dmabuf

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Tue Sep 29 06:20:10 PDT 2015


https://bugzilla.gnome.org/show_bug.cgi?id=743345

--- Comment #32 from Lubosz Sarnecki <lubosz at gmail.com> ---
I rebased the patches to current master.

https://git.collabora.com/cgit/user/lubosz/gst-plugins-bad.git/log/?h=dmabuf

1. Use gst_gl_memory_wrapped_texture

The first patch is not needed anymore. I am now using
gst_gl_memory_wrapped_texture that supports different texture targets, as
Julien suggested.
https://git.collabora.com/cgit/user/lubosz/gst-plugins-bad.git/commit/?h=dmabuf&id=c21db3b334fb2df3286329a8b050118859567ab9

2. Do not _gst_mem_copy dmabuf

Also _gst_mem_copy produces GL errors with GL_TEXTURE_EXTERNAL_OES. They occur
during initialization and a window resize event that causes renegotation of the
pipeline. 

Bypassing _gl_mem_copy_thread for GL_TEXTURE_EXTERNAL_OES fixes this
https://git.collabora.com/cgit/user/lubosz/gst-plugins-bad.git/commit/?h=dmabuf&id=5d2ca69b35fdaece6acbcc709cbd68a4ad6cd42f

3. supported formats with dmabuf caps features

It is possible to negotiate a pipeline with dmabuf caps features, when using
the inteldmabuf upload element. v4l2src needs a patch to expose dmabuf caps
features.
This patch allows multiple color formats with dmabuf caps features:
https://git.collabora.com/cgit/user/lubosz/gst-plugins-bad.git/commit/?h=dmabuf&id=40db525528d9acf6ca6027041507388414ba8ff1

4. Multiplane formats and conversion

We should not expect the driver to do the color conversion, some drivers might
actually do this, which also is dependent of the hardware implementation.
Mesa for example does not intent to do this. For example, in the Intel driver
multi planar dmabufs result in __DRI_IMAGE_ERROR_BAD_MATCH, which is exposed as
EGL error.

http://cgit.freedesktop.org/mesa/mesa/tree/src/mesa/drivers/dri/i965/intel_screen.c#n736

So I guess for multi planar formats glcolorconvert needs to be used with an EGL
texture per plane. Not sure on which GL implementations samplerExternalOES
needs to be used, that would require templating of the texture sampler
definition in glconvert's shaders. Currently glconvert is bypassed for dmabuf
pipelines.
I have an experimental patch on an old gst-bad branch which did color
conversion in glsl:
https://git.collabora.com/cgit/user/lubosz/gst-plugins-bad.git/commit/?h=dmabuf-colorconvert&id=70caaadb3c9893d3ab641b295ab601f289bc9dcf

Here is a recent piglit example by Intel where NV12 conversion is set up with
a texture sampler per plane in a shader:
http://cgit.freedesktop.org/piglit/tree/tests/spec/ext_image_dma_buf_import/transcode-nv12-as-r8-gr88.c

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list