libs: window: wayland: use dmabuf protocol if available
authorMichael Olbrich <m.olbrich@pengutronix.de>
Wed, 22 Jul 2020 08:01:41 +0000 (10:01 +0200)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 27 Jul 2020 15:02:19 +0000 (15:02 +0000)
commitafe49e9fdb3b071e693c1cbf268510b89d1cea2e
treec090ba7912ccc8d29ed699337452dd5ef24b7177
parent72d32a91d25e2b6ca5e2508f8a46c0dca25d172f
libs: window: wayland: use dmabuf protocol if available

Currently vaGetSurfaceBufferWl() is used to create wayland buffers.
Unfortunately this is not implemented by the 'media-driver' and Mesa VA-API
drivers. And the implementation provided by 'intel-vaapi-driver' is not
compatible with a Wayland server that uses the iris Mesa driver.

So create the Wayland buffers manually with the zwp_linux_dmabuf_v1 wayland
protocol. Formats and modifiers supported by the Wayland server are taken
into account. If necessary, VPP is enabled to convert the buffer into a
supported format.

Fall back to vaGetSurfaceBufferWl() if creating buffers via dambuf protocol
fails.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/346>
gst-libs/gst/vaapi/gstvaapiwindow_wayland.c