From: <wi...@fr...> - 2005-06-28 09:17:27
|
CVS Root: /cvs/gstreamer Module: gstreamer Changes by: wingo Date: Tue Jun 28 2005 02:17:26 PDT Log message: 2005-06-28 Andy Wingo <wi...@po...> * gst/gstobject.c (gst_object_unref, gst_object_ref) (gst_object_sink): Take gpointer arguments, not GstObject -- avoids casts. Like GLib. Modified files: . : ChangeLog docs/gst/tmpl : gstobject.sgml gst : gstobject.c gstobject.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.1173&r2=1.1174 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/docs/gst/tmpl/gstobject.sgml.diff?r1=1.43&r2=1.44 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstobject.c.diff?r1=1.89&r2=1.90 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstobject.h.diff?r1=1.53&r2=1.54 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.1173 retrieving revision 1.1174 diff -u -d -r1.1173 -r1.1174 --- ChangeLog 28 Jun 2005 08:41:39 -0000 1.1173 +++ ChangeLog 28 Jun 2005 09:17:13 -0000 1.1174 @@ -1,5 +1,9 @@ 2005-06-28 Andy Wingo <wi...@po...> + * gst/gstobject.c (gst_object_unref, gst_object_ref) + (gst_object_sink): Take gpointer arguments, not GstObject -- + avoids casts. Like GLib. + * gst/gstghostpad.c (gst_proxy_pad_do_activate): Don't proxy activate. Index: gstobject.sgml RCS file: /cvs/gstreamer/gstreamer/docs/gst/tmpl/gstobject.sgml,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- gstobject.sgml 29 Mar 2005 10:55:38 -0000 1.43 +++ gstobject.sgml 28 Jun 2005 09:17:13 -0000 1.44 @@ -316,6 +316,7 @@ </para> @object: the object +<!-- # Unused Parameters # --> @Returns: Index: gstobject.c RCS file: /cvs/gstreamer/gstreamer/gst/gstobject.c,v retrieving revision 1.89 retrieving revision 1.90 diff -u -d -r1.89 -r1.90 --- gstobject.c 23 Jun 2005 15:04:48 -0000 1.89 +++ gstobject.c 28 Jun 2005 09:17:14 -0000 1.90 @@ -255,8 +255,8 @@ * * Returns: A pointer to the object */ -GstObject * -gst_object_ref (GstObject * object) +gpointer +gst_object_ref (gpointer object) { g_return_val_if_fail (GST_IS_OBJECT (object), NULL); @@ -274,7 +274,7 @@ #endif #ifdef REFCOUNT_HACK - g_atomic_int_inc (&object->refcount); + g_atomic_int_inc (&((GstObject *) object)->refcount); PATCH_REFCOUNT (object); #else /* FIXME, not MT safe because glib is not MT safe */ @@ -294,22 +294,16 @@ * The unref method should never be called with the LOCK held since * this might deadlock the dispose function. - * - * Returns: NULL, so that constructs like - * - * object = gst_object_unref (object); - * automatically clear the input object pointer. -gst_object_unref (GstObject * object) +void +gst_object_unref (gpointer object) - g_return_val_if_fail (GST_IS_OBJECT (object), NULL); + g_return_if_fail (GST_IS_OBJECT (object)); - g_return_val_if_fail (GST_OBJECT_REFCOUNT_VALUE (object) > 0, NULL); + g_return_if_fail (GST_OBJECT_REFCOUNT_VALUE (object) > 0); - g_return_val_if_fail (((GObject *) object)->ref_count > 0, NULL); + g_return_if_fail (((GObject *) object)->ref_count > 0); #ifdef DEBUG_REFCOUNT @@ -326,7 +320,8 @@ - if (G_UNLIKELY (g_atomic_int_dec_and_test (&object->refcount))) { + if (G_UNLIKELY (g_atomic_int_dec_and_test (&((GstObject *) object)-> + refcount))) { PATCH_REFCOUNT1 (object); g_object_unref (object); } else { @@ -336,8 +331,6 @@ g_object_unref (object); - - return NULL; } /** @@ -352,7 +345,7 @@ * MT safe. This function grabs and releases the object lock. void -gst_object_sink (GstObject * object) +gst_object_sink (gpointer object) g_return_if_fail (GST_IS_OBJECT (object)); Index: gstobject.h RCS file: /cvs/gstreamer/gstreamer/gst/gstobject.h,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- gstobject.h 23 Jun 2005 15:04:48 -0000 1.53 +++ gstobject.h 28 Jun 2005 09:17:14 -0000 1.54 @@ -144,9 +144,9 @@ GParamSpec *pspec, gchar **excluded_props); /* refcounting + life cycle */ -GstObject * gst_object_ref (GstObject *object); -GstObject * gst_object_unref (GstObject *object); -void gst_object_sink (GstObject *object); +gpointer gst_object_ref (gpointer object); +void gst_object_unref (gpointer object); +void gst_object_sink (gpointer object); /* replace object pointer */ void gst_object_replace (GstObject **oldobj, GstObject *newobj); |