memory:DMABuf usage with waylandsink

Nicolas Dufresne nicolas at ndufresne.ca
Tue Sep 5 13:04:40 UTC 2017


Le lundi 04 septembre 2017 à 17:28 +0900, Damian Hobson-Garcia a
écrit :
> Hello All,
> 
> I am working on a plugin for H/W that can output video buffers as
> dmabufs for display on a wayland compositor via waylandsink.
> It looks like the colour formats supported by the compositor are
> reported by waylandsink in 2 separate caps structures, one for SHM
> buffers and one for DMABUFs. The DMABUF structure sets the
> GST_CAPS_FEATURE_MEMORY_DMABUF caps feature while the SHM one doesn't.
> 
> According to the gstdmabuf.h header (plugins-base), though, this should
> only be set for non-mappable DMABUF, but since my DMABUFs *are*
> mappable, it seems like I shouldn't be setting this flag.  Without it,
> though only the formats supported for SHM buffers can be negotiated.  Of
> course, its easy enough to just lie and set the flag, but I'm wondering
> if there is a more correct solution.
> 
> In general, what should upstream plugins be doing to negotiate the
> DMABUF formats with waylandsink?  I've tried to find some examples in
> other plugins, but grep hasn't given me much to go on.

There is no solution to this problem other then using a caps feature.
This of course prevents software element like text overlay or other in-
place filter to work, you'll need a converter.

The solution that I have recommended is to implement a GL fallback for
SHM buffers, so that formats supported by DMABuf are also supported by
SHM. This also has the plus side that if you get DMABuf that aren't
compatible (e.g. wrong stride), you still save a copy by passing the
DMABuf FD as being SHM. For PC compositor, this is an evident choice as
the compositor will need to support software video decoders.

regards,
Nicolas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170905/703827d4/attachment.sig>


More information about the gstreamer-devel mailing list