debugging: make GST_PTR_FORMAT work for queries as well

This commit is contained in:
Tim-Philipp Müller 2009-03-20 00:42:51 +00:00
parent 0492ca71f5
commit b62bfc573a

View file

@ -530,6 +530,22 @@ gst_debug_print_object (gpointer ptr)
g_free (s);
return ret;
}
if (GST_IS_QUERY (object)) {
GstQuery *query = GST_QUERY_CAST (object);
if (query->structure) {
return gst_structure_to_string (query->structure);
} else {
const gchar *query_type_name;
query_type_name = gst_query_type_get_name (query->type);
if (G_LIKELY (query_type_name != NULL)) {
return g_strdup_printf ("%s query", query_type_name);
} else {
return g_strdup_printf ("query of unknown type %d", query->type);
}
}
}
return g_strdup_printf ("%p", ptr);
}