From 4a56c82f0c55ce9689321e56599742e1fb3e119e Mon Sep 17 00:00:00 2001 From: Colin Kinloch Date: Thu, 9 Jan 2025 17:23:41 +0000 Subject: [PATCH] wayland: Print table split when DMABuf format changes The `zwp_linux_dmabuf_v1` doesn't specify an order for modifier events to be sent. In my case the linear format was sent last resulting in the first item in each row being the previous format. Part-of: --- .../gst-plugins-bad/gst-libs/gst/wayland/gstwldisplay.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/wayland/gstwldisplay.c b/subprojects/gst-plugins-bad/gst-libs/gst/wayland/gstwldisplay.c index 8ae698c0ff..f3fe548b0a 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/wayland/gstwldisplay.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/wayland/gstwldisplay.c @@ -204,7 +204,7 @@ dmabuf_modifier (void *data, struct zwp_linux_dmabuf_v1 *zwp_linux_dmabuf, { GstWlDisplay *self = data; guint64 modifier = (guint64) modifier_hi << 32 | modifier_lo; - static gboolean table_header = TRUE; + static uint32_t last_format = 0; GstWlDisplayPrivate *priv = gst_wl_display_get_instance_private (self); @@ -220,14 +220,15 @@ dmabuf_modifier (void *data, struct zwp_linux_dmabuf_v1 *zwp_linux_dmabuf, if (fourcc == DRM_FORMAT_INVALID || modifier == DRM_FORMAT_MOD_INVALID) return; - if (table_header == TRUE) { + if (last_format == 0) { GST_INFO ("===== All DMA Formats With Modifiers ====="); GST_INFO ("| Gst Format | DRM Format |"); - table_header = FALSE; } - if (modifier == 0) + if (last_format != format) { GST_INFO ("|-----------------------------------------"); + last_format = format; + } GST_INFO ("| %-12s | %-23s |", (modifier == 0) ? gst_video_format_to_string (gst_format) : "",