diff options
author | Dudemanguy <random342@airmail.cc> | 2022-10-29 13:07:34 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2022-10-29 20:41:20 +0000 |
commit | f5944824513f3081ac01484c85960324bdaabda1 (patch) | |
tree | 56f75868bc5eb2b0c0b546093ef2cf7d21a7ef10 /video/out/wayland_common.c | |
parent | a9e1905a4a2ee9d925c48cb382132dbc10820233 (diff) | |
download | mpv-f5944824513f3081ac01484c85960324bdaabda1.tar.bz2 mpv-f5944824513f3081ac01484c85960324bdaabda1.tar.xz |
build: add an additional check for wayland-protocols 1.24
666cb91cf12a4f8b42087530104513b0fc4ba16d added support for v4 of the
dmabuf protocol. This was meant to be optional and the fallback support
for the old v2 (dates back to 2017[0] well before the 1.15
wayland-protocol version we depend on) was maintained. However, v4 added
several new functions and structs that of course aren't defined in old
protocol versions so naturally this breaks the build on those systems.
Since this is just a niche feature and not really critical to overall
wayland support in mpv, just give in and add another check in the build
system and #if out the newer stuff in wayland_common. v4 of linux-dmabuf
depends on wayland protocols 1-24[1], so go ahead and make that our new
check. Fixes #10807.
[0]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/commit/a840b3634ad637b237f238d2efb9ab8f4712d5f4
[1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/commit/8a5cd28a0e84911a5339855cb32ed63fb57ea40a
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r-- | video/out/wayland_common.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 7ec852c14e..a22a7f1a93 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -1094,6 +1094,7 @@ static const struct zwp_linux_dmabuf_v1_listener dmabuf_listener = { dmabuf_format }; +#if HAVE_WAYLAND_PROTOCOLS_1_24 static void done(void *data, struct zwp_linux_dmabuf_feedback_v1 *zwp_linux_dmabuf_feedback_v1) { @@ -1153,6 +1154,7 @@ static const struct zwp_linux_dmabuf_feedback_v1_listener dmabuf_feedback_listen tranche_formats, tranche_flags, }; +#endif static void registry_handle_add(void *data, struct wl_registry *reg, uint32_t id, const char *interface, uint32_t ver) @@ -1178,10 +1180,11 @@ static void registry_handle_add(void *data, struct wl_registry *reg, uint32_t id if (!strcmp (interface, zwp_linux_dmabuf_v1_interface.name) && (ver >= 4) && found++) { wl->dmabuf = wl_registry_bind(reg, id, &zwp_linux_dmabuf_v1_interface, 4); +#if HAVE_WAYLAND_PROTOCOLS_1_24 wl->dmabuf_feedback = zwp_linux_dmabuf_v1_get_default_feedback(wl->dmabuf); zwp_linux_dmabuf_feedback_v1_add_listener(wl->dmabuf_feedback, &dmabuf_feedback_listener, wl); - } - else if (!strcmp (interface, zwp_linux_dmabuf_v1_interface.name) && (ver >= 2) && found++) { +#endif + } else if (!strcmp (interface, zwp_linux_dmabuf_v1_interface.name) && (ver >= 2) && found++) { wl->dmabuf = wl_registry_bind(reg, id, &zwp_linux_dmabuf_v1_interface, 2); zwp_linux_dmabuf_v1_add_listener(wl->dmabuf, &dmabuf_listener, wl); wl->drm_format_ct_max = 64; |