From 87466e4d7c8607ed392cbe41d2fe7ac0a2eab260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= Date: Fri, 12 Sep 2014 22:49:38 +0300 Subject: [PATCH] wl/shm: print supported buffer formats to log --- modules/video_output/wl/shm.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/modules/video_output/wl/shm.c b/modules/video_output/wl/shm.c index c16bfe5d76..e6ec4a483b 100644 --- a/modules/video_output/wl/shm.c +++ b/modules/video_output/wl/shm.c @@ -314,6 +314,25 @@ static int Control(vout_display_t *vd, int query, va_list ap) return VLC_SUCCESS; } +static void shm_format_cb(void *data, struct wl_shm *shm, uint32_t format) +{ + vout_display_t *vd = data; + char str[4]; + + memcpy(str, &format, sizeof (str)); + + if (format >= 0x20202020) + msg_Dbg(vd, "format %.4s (0x%08"PRIx32")", str, format); + else + msg_Dbg(vd, "format %4"PRIu32" (0x%08"PRIx32")", format, format); + (void) shm; +} + +static const struct wl_shm_listener shm_cbs = +{ + shm_format_cb, +}; + static void registry_global_cb(void *data, struct wl_registry *registry, uint32_t name, const char *iface, uint32_t vers) { @@ -394,6 +413,9 @@ static int Open(vlc_object_t *obj) if (sys->shm == NULL) goto error; + wl_shm_add_listener(sys->shm, &shm_cbs, vd); + wl_display_roundtrip_queue(display, sys->eventq); + /* Determine our pixel format */ video_format_t fmt_pic; -- GitLab