From c17a8ce88a5b7033849d8b0d2b2e084f674d1497 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Wed, 27 Aug 2008 07:18:37 +0000 Subject: [PATCH] gst/gstobject.c: Due to popular request also include ObjectType in gst_object_get_path_string(). Makes gst-launch -v ... Original commit message from CVS: * gst/gstobject.c: Due to popular request also include ObjectType in gst_object_get_path_string(). Makes gst-launch -v bit more useful. --- ChangeLog | 6 ++++++ gst/gstobject.c | 15 +++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index becc964891..ab813d7e0f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-08-27 Stefan Kost + + * gst/gstobject.c: + Due to popular request also include ObjectType in + gst_object_get_path_string(). Makes gst-launch -v bit more useful. + 2008-08-26 David Schleef * gst/gstutils.c: Remove check in gst_pad_query_convert() that diff --git a/gst/gstobject.c b/gst/gstobject.c index a86a5b0162..1d410817c4 100644 --- a/gst/gstobject.c +++ b/gst/gstobject.c @@ -568,6 +568,7 @@ gst_object_default_deep_notify (GObject * object, GstObject * orig, g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec)); g_object_get_property (G_OBJECT (orig), pspec->name, &value); + /* FIXME: handle flags */ if (G_IS_PARAM_SPEC_ENUM (pspec)) { GEnumValue *enum_value; @@ -1062,6 +1063,7 @@ gst_object_get_path_string (GstObject * object) GSList *parents; void *parent; gchar *prevpath, *path; + const gchar *typename; gchar *component; gchar *separator; @@ -1090,16 +1092,25 @@ gst_object_get_path_string (GstObject * object) * decrease the refcounting on each element after we handled * it. */ for (parents = parentage; parents; parents = g_slist_next (parents)) { + if (G_IS_OBJECT (parents->data)) { + typename = G_OBJECT_TYPE_NAME (parents->data); + } else { + typename = NULL; + } if (GST_IS_OBJECT (parents->data)) { GstObject *item = GST_OBJECT_CAST (parents->data); GstObjectClass *oclass = GST_OBJECT_GET_CLASS (item); - component = gst_object_get_name (item); + component = g_strdup_printf ("%s:%s", typename, GST_OBJECT_NAME (item)); separator = oclass->path_string_separator; /* and unref now */ gst_object_unref (item); } else { - component = g_strdup_printf ("%p", parents->data); + if (typename) { + component = g_strdup_printf ("%s:%p", typename, parents->data); + } else { + component = g_strdup_printf ("%p", parents->data); + } separator = "/"; }