[vlc-commits] wl/shm: print supported buffer formats to log

Rémi Denis-Courmont git at videolan.org
Fri Sep 12 21:50:08 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Sep 12 22:49:38 2014 +0300| [87466e4d7c8607ed392cbe41d2fe7ac0a2eab260] | committer: Rémi Denis-Courmont

wl/shm: print supported buffer formats to log

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=87466e4d7c8607ed392cbe41d2fe7ac0a2eab260
---

 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 c16bfe5..e6ec4a4 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;
 



More information about the vlc-commits mailing list