tools: gst-device-monitor: print uint properties in both decimal and hex

Some values are easier to read and make sense of in hex.

https://bugzilla.gnome.org//show_bug.cgi?id=759780
This commit is contained in:
Tim-Philipp Müller 2015-12-29 11:29:31 +00:00
parent e61f5b2138
commit f2ecf85103

View 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);