GNOME Bugzilla – Bug 786175
glupload/glsink: Missing draining support
Last modified: 2018-11-03 11:59:09 UTC
V4L2 in it's archaism requires that all buffers produced are returned before the driver can re-allocate buffers (renegotiate the frame size). This problem is solved by draining (returning back) all buffers when an allocation or drain query passes buy. This has been implemented properly in kmssink. The following pipeline currently fails on the first renegotiation: gst-launch-1.0 v4l2src io-mode=dmabuf ! glimagesink This work is not trivial and may require few iteration. My plan is to move the EGLImage cache inside the glupload object (needed anyway as the current cache with qdata is not thread safe). This will also clearing the cache when an allocation query, or a drain query is received. That will help, but won't be sufficient, as the glupload element simply attach the imported buffer to a new buffer (it's half pass-through). We'll need to make sure that it runs in return a downstream allocation query. glvideoconvert would need to do the same when running asynchronously (sync fence) and finally the sinks themself need to copy their render buffer for potential redraws during the process. I think all this should be condition (e.g. sink can check if the render buffer has a parent buffer).
Title should be "Incomplete drain support for the 'import dmabuf into EGLImage' path". For others cases like EGLimage from texture I believe the following is enough: https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/ext/gl/gstglimagesink.c#n1086 (ex: omxh264dec ! glimagesink)
(In reply to Julien Isorce from comment #1) > Title should be "Incomplete drain support for the 'import dmabuf into > EGLImage' path". > > For others cases like EGLimage from texture I believe the following is > enough: > https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/ext/gl/ > gstglimagesink.c#n1086 (ex: omxh264dec ! glimagesink) -base now, and it's using the wrong trigger. Using drain query is discourage and also much slower then allocation query.
I forgot, also this code only works if you have glimagesink, you need support for draining everywhere buffers are kept.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/376.