gst/gstvalue.c: Implement GstObject -> string transform so we print object names when serializing GValues containing ...

Original commit message from CVS:
* gst/gstvalue.c: (gst_value_transform_object_string),
(_gst_value_initialize):
Implement GstObject -> string transform so we print object names
when serializing GValues containing GstObjects.
This commit is contained in:
Wim Taymans 2007-02-28 16:57:49 +00:00
parent 05d6664b98
commit ebd9a6d04b
2 changed files with 22 additions and 0 deletions

View file

@ -1,3 +1,10 @@
2007-02-28 Wim Taymans <wim@fluendo.com>
* gst/gstvalue.c: (gst_value_transform_object_string),
(_gst_value_initialize):
Implement GstObject -> string transform so we print object names
when serializing GValues containing GstObjects.
2007-02-28 Wim Taymans <wim@fluendo.com> 2007-02-28 Wim Taymans <wim@fluendo.com>
* docs/gst/gstreamer-sections.txt: * docs/gst/gstreamer-sections.txt:

View file

@ -3834,6 +3834,19 @@ gst_value_transform_string_date (const GValue * src_value, GValue * dest_value)
gst_value_deserialize_date (dest_value, src_value->data[0].v_pointer); gst_value_deserialize_date (dest_value, src_value->data[0].v_pointer);
} }
static void
gst_value_transform_object_string (const GValue * src_value,
GValue * dest_value)
{
GstObject *obj;
gchar *str;
obj = g_value_get_object (src_value);
str = obj ? GST_OBJECT_NAME (obj) : "NULL";
dest_value->data[0].v_pointer = g_strdup (str);
}
static GTypeInfo _info = { static GTypeInfo _info = {
0, 0,
NULL, NULL,
@ -4158,6 +4171,8 @@ _gst_value_initialize (void)
gst_value_transform_date_string); gst_value_transform_date_string);
g_value_register_transform_func (G_TYPE_STRING, GST_TYPE_DATE, g_value_register_transform_func (G_TYPE_STRING, GST_TYPE_DATE,
gst_value_transform_string_date); gst_value_transform_string_date);
g_value_register_transform_func (GST_TYPE_OBJECT, G_TYPE_STRING,
gst_value_transform_object_string);
gst_value_register_intersect_func (G_TYPE_INT, GST_TYPE_INT_RANGE, gst_value_register_intersect_func (G_TYPE_INT, GST_TYPE_INT_RANGE,
gst_value_intersect_int_int_range); gst_value_intersect_int_int_range);