tools: gst-device-monitor: print uint properties in both decimal and hex
authorTim-Philipp Müller <tim@centricular.com>
Tue, 29 Dec 2015 11:29:31 +0000 (11:29 +0000)
committerTim-Philipp Müller <tim@centricular.com>
Tue, 29 Dec 2015 11:29:31 +0000 (11:29 +0000)
Some values are easier to read and make sense of in hex.

https://bugzilla.gnome.org//show_bug.cgi?id=759780

tools/gst-device-monitor.c

index 8af8f6d..83ff8f0 100644 (file)
@@ -48,7 +48,12 @@ print_structure_field (GQuark field_id, const GValue * value,
 {
   gchar *val;
 
-  val = gst_value_serialize (value);
+  if (G_VALUE_HOLDS_UINT (value)) {
+    val = g_strdup_printf ("%u (0x%08x)", g_value_get_uint (value),
+        g_value_get_uint (value));
+  } else {
+    val = gst_value_serialize (value);
+  }
 
   if (val != NULL)
     g_print ("\n\t\t%s = %s", g_quark_to_string (field_id), val);