From cc2d216e888fae2529d5312a8454a2f12ab2167a Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Thu, 23 Jun 2005 15:04:48 +0000 Subject: [PATCH] gst/gstobject.h (GST_CLASS_LOCK, GST_CLASS_TRYLOCK) (GST_CLASS_UNLOCK, GST_CLASS_GET_LOCK, GstObjectClass) Original commit message from CVS: 2005-06-23 Andy Wingo * gst/gstobject.h (GST_CLASS_LOCK, GST_CLASS_TRYLOCK) (GST_CLASS_UNLOCK, GST_CLASS_GET_LOCK, GstObjectClass) * gst/gstobject.c (gst_object_class_init): Make the class lock recursive. Wim won't let me drop deep_notify. Decodebin works again, whoopdy doo. --- ChangeLog | 6 ++++++ gst/gstobject.c | 3 ++- gst/gstobject.h | 8 ++++---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 358f0cdfe2..84bd6df074 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2005-06-23 Andy Wingo + * gst/gstobject.h (GST_CLASS_LOCK, GST_CLASS_TRYLOCK) + (GST_CLASS_UNLOCK, GST_CLASS_GET_LOCK, GstObjectClass) + * gst/gstobject.c (gst_object_class_init): Make the class lock + recursive. Wim won't let me drop deep_notify. Decodebin works + again, whoopdy doo. + * gst/gstghostpad.c (on_int_notify): Catches notify::caps on the internal pad, and hacks accordingly. Doesn't do it on the target pad because we change its caps. Probably catches all cases of diff --git a/gst/gstobject.c b/gst/gstobject.c index c80decd9c6..d0f73c28c7 100644 --- a/gst/gstobject.c +++ b/gst/gstobject.c @@ -187,7 +187,8 @@ gst_object_class_init (GstObjectClass * klass) G_TYPE_PARAM); klass->path_string_separator = "/"; - klass->lock = g_mutex_new (); + klass->lock = g_new0 (GStaticRecMutex, 1); + g_static_rec_mutex_init (klass->lock); klass->signal_object = g_object_new (gst_signal_object_get_type (), NULL); diff --git a/gst/gstobject.h b/gst/gstobject.h index 3a6e15a6a2..b60f83f0b5 100644 --- a/gst/gstobject.h +++ b/gst/gstobject.h @@ -98,9 +98,9 @@ struct _GstObject { gpointer _gst_reserved[GST_PADDING]; }; -#define GST_CLASS_LOCK(obj) (g_mutex_lock(GST_OBJECT_CLASS_CAST(obj)->lock)) -#define GST_CLASS_TRYLOCK(obj) (g_mutex_trylock(GST_OBJECT_CLASS_CAST(obj)->lock)) -#define GST_CLASS_UNLOCK(obj) (g_mutex_unlock(GST_OBJECT_CLASS_CAST(obj)->lock)) +#define GST_CLASS_LOCK(obj) (g_static_rec_mutex_lock(GST_OBJECT_CLASS_CAST(obj)->lock)) +#define GST_CLASS_TRYLOCK(obj) (g_static_rec_mutex_trylock(GST_OBJECT_CLASS_CAST(obj)->lock)) +#define GST_CLASS_UNLOCK(obj) (g_static_rec_mutex_unlock(GST_OBJECT_CLASS_CAST(obj)->lock)) #define GST_CLASS_GET_LOCK(obj) (GST_OBJECT_CLASS_CAST(obj)->lock) /* signal_object is used to signal to the whole class */ @@ -110,7 +110,7 @@ struct _GstObjectClass { gchar *path_string_separator; GObject *signal_object; - GMutex *lock; + GStaticRecMutex *lock; /* signals */ void (*parent_set) (GstObject *object, GstObject *parent);