From: Thomas V. S. <tho...@us...> - 2002-02-12 13:57:17
|
Update of /cvsroot/gstreamer/gstreamer/gst/elements In directory usw-pr-cvs1:/tmp/cvs-serv8822 Modified Files: gsttee.c gsttee.h Log Message: updating tee to use properties Index: gsttee.c =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/elements/gsttee.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- gsttee.c 5 Feb 2002 17:42:40 -0000 1.16 +++ gsttee.c 12 Feb 2002 13:57:14 -0000 1.17 @@ -43,6 +43,7 @@ ARG_0, ARG_SILENT, ARG_NUM_PADS, + ARG_LAST_MESSAGE, /* FILL ME */ }; @@ -107,7 +108,10 @@ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SILENT, g_param_spec_boolean ("silent", "silent", "silent", FALSE, G_PARAM_READWRITE)); - + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LAST_MESSAGE, + g_param_spec_string ("last_message", "last_message", "last_message", + NULL, G_PARAM_READABLE)); + gobject_class->set_property = GST_DEBUG_FUNCPTR(gst_tee_set_property); gobject_class->get_property = GST_DEBUG_FUNCPTR(gst_tee_get_property); @@ -153,6 +157,7 @@ gst_pad_set_connect_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_tee_sinkconnect)); tee->silent = FALSE; + tee->last_message = NULL; } /* helper compare function */ @@ -199,9 +204,16 @@ name = NULL; } } - gst_element_info (GST_ELEMENT (tee), "new pad %s", name); + /* FIXME: thomas: does tee also have to notify a new pad ? */ + if (!tee->silent) { + if (tee->last_message) g_free (tee->last_message); + tee->last_message = g_strdup_printf ("new pad %s", name); + g_object_notify (G_OBJECT (tee), "last_message"); + } + /* g_object_notify (G_OBJECT (element), "new pad"); */ srcpad = gst_pad_new_from_template (templ, name); + g_free (name); gst_element_add_pad (GST_ELEMENT (tee), srcpad); gst_pad_set_event_function (srcpad, gst_tee_event_handler); GST_PAD_ELEMENT_PRIVATE (srcpad) = NULL; @@ -245,6 +257,9 @@ case ARG_SILENT: tee->silent = g_value_get_boolean (value); break; + case ARG_LAST_MESSAGE: + g_value_set_string ((GValue *) value, tee->last_message); + break; default: break; } @@ -314,8 +329,10 @@ } if (!tee->silent) { - gst_element_info (GST_ELEMENT (tee), "chain ******* (%s:%s)t (%d bytes, %llu)", - GST_DEBUG_PAD_NAME (outpad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf)); + if (tee->last_message) g_free (tee->last_message); + tee->last_message = g_strdup_printf ("chain ******* (%s:%s)t (%d bytes, %llu) %p", + GST_DEBUG_PAD_NAME (outpad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf), buf); + g_object_notify (G_OBJECT (tee), "last_message"); } if (GST_PAD_IS_CONNECTED (outpad)) Index: gsttee.h =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/elements/gsttee.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- gsttee.h 25 Dec 2001 02:15:46 -0000 1.4 +++ gsttee.h 12 Feb 2002 13:57:14 -0000 1.5 @@ -53,6 +53,7 @@ GstPad *sinkpad; gboolean silent; + gchar *last_message; }; struct _GstTeeClass { |