diff --git a/gst/gstbus.c b/gst/gstbus.c index 7951a3fd12..ab05af3dc2 100644 --- a/gst/gstbus.c +++ b/gst/gstbus.c @@ -99,7 +99,6 @@ enum static void gst_bus_dispose (GObject * object); -static GstObjectClass *parent_class = NULL; static guint gst_bus_signals[LAST_SIGNAL] = { 0 }; struct _GstBusPrivate @@ -112,6 +111,7 @@ struct _GstBusPrivate GPollFD pollfd; }; +#define gst_bus_parent_class parent_class G_DEFINE_TYPE (GstBus, gst_bus, GST_TYPE_OBJECT); static void @@ -146,8 +146,6 @@ gst_bus_class_init (GstBusClass * klass) { GObjectClass *gobject_class = (GObjectClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gobject_class->dispose = gst_bus_dispose; gobject_class->set_property = gst_bus_set_property; gobject_class->constructed = gst_bus_constructed; diff --git a/gst/gstclock.c b/gst/gstclock.c index b167238b71..d96745e418 100644 --- a/gst/gstclock.c +++ b/gst/gstclock.c @@ -177,8 +177,6 @@ static void gst_clock_get_property (GObject * object, guint prop_id, static void gst_clock_update_stats (GstClock * clock); -static GstObjectClass *parent_class = NULL; - /* static guint gst_clock_signals[LAST_SIGNAL] = { 0 }; */ static GstClockID @@ -649,6 +647,7 @@ gst_clock_id_unschedule (GstClockID id) /* * GstClock abstract base class implementation */ +#define gst_clock_parent_class parent_class G_DEFINE_TYPE (GstClock, gst_clock, GST_TYPE_OBJECT); static void @@ -656,8 +655,6 @@ gst_clock_class_init (GstClockClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - parent_class = g_type_class_peek_parent (klass); - #ifndef GST_DISABLE_TRACE _gst_clock_entry_trace = gst_alloc_trace_register (GST_CLOCK_ENTRY_TRACE_NAME); diff --git a/gst/gstindex.c b/gst/gstindex.c index d168eee6ce..351c25f758 100644 --- a/gst/gstindex.c +++ b/gst/gstindex.c @@ -100,7 +100,6 @@ static gboolean gst_index_gtype_resolver (GstIndex * index, GstObject * writer, gchar ** writer_string, gpointer data); static void gst_index_add_entry (GstIndex * index, GstIndexEntry * entry); -static GstObject *parent_class = NULL; static guint gst_index_signals[LAST_SIGNAL] = { 0 }; typedef struct @@ -155,6 +154,7 @@ gst_index_entry_get_type (void) "Generic indexing support"); \ } +#define gst_index_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstIndex, gst_index, GST_TYPE_OBJECT, _do_init); static void @@ -162,8 +162,6 @@ gst_index_class_init (GstIndexClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - parent_class = g_type_class_peek_parent (klass); - /** * GstIndex::entry-added * @gstindex: the object which received the signal. diff --git a/gst/gstindexfactory.c b/gst/gstindexfactory.c index 111a0ce989..dcd73eeda8 100644 --- a/gst/gstindexfactory.c +++ b/gst/gstindexfactory.c @@ -39,9 +39,9 @@ static void gst_index_factory_finalize (GObject * object); -static GstPluginFeatureClass *factory_parent_class = NULL; /* static guint gst_index_factory_signals[LAST_SIGNAL] = { 0 }; */ +#define gst_index_factory_parent_class parent_class G_DEFINE_TYPE (GstIndexFactory, gst_index_factory, GST_TYPE_PLUGIN_FEATURE); static void @@ -49,8 +49,6 @@ gst_index_factory_class_init (GstIndexFactoryClass * klass) { GObjectClass *gobject_class = (GObjectClass *) klass; - factory_parent_class = g_type_class_peek_parent (klass); - gobject_class->finalize = gst_index_factory_finalize; } @@ -66,7 +64,7 @@ gst_index_factory_finalize (GObject * object) g_free (factory->longdesc); - G_OBJECT_CLASS (factory_parent_class)->finalize (object); + G_OBJECT_CLASS (parent_class)->finalize (object); } diff --git a/gst/gstregistry.c b/gst/gstregistry.c index 345068ea71..6e1d5b4272 100644 --- a/gst/gstregistry.c +++ b/gst/gstregistry.c @@ -194,8 +194,8 @@ static GstPluginFeature *gst_registry_lookup_feature_locked (GstRegistry * static GstPlugin *gst_registry_lookup_bn_locked (GstRegistry * registry, const char *basename); +#define gst_registry_parent_class parent_class G_DEFINE_TYPE (GstRegistry, gst_registry, GST_TYPE_OBJECT); -static GstObjectClass *parent_class = NULL; static void gst_registry_class_init (GstRegistryClass * klass) @@ -204,7 +204,6 @@ gst_registry_class_init (GstRegistryClass * klass) gobject_class = (GObjectClass *) klass; - parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GstRegistryPrivate)); /** diff --git a/gst/gstsystemclock.c b/gst/gstsystemclock.c index b592813018..bc6ce30288 100644 --- a/gst/gstsystemclock.c +++ b/gst/gstsystemclock.c @@ -123,10 +123,9 @@ static void gst_system_clock_add_wakeup (GstSystemClock * sysclock); static GStaticMutex _gst_sysclock_mutex = G_STATIC_MUTEX_INIT; -static GstClockClass *parent_class = NULL; - /* static guint gst_system_clock_signals[LAST_SIGNAL] = { 0 }; */ +#define gst_system_clock_parent_class parent_class G_DEFINE_TYPE (GstSystemClock, gst_system_clock, GST_TYPE_CLOCK); static void @@ -138,8 +137,6 @@ gst_system_clock_class_init (GstSystemClockClass * klass) gobject_class = (GObjectClass *) klass; gstclock_class = (GstClockClass *) klass; - parent_class = g_type_class_peek_parent (klass); - g_type_class_add_private (klass, sizeof (GstSystemClockPrivate)); gobject_class->dispose = gst_system_clock_dispose; diff --git a/gst/gsttypefindfactory.c b/gst/gsttypefindfactory.c index 26cbfb57c4..be461cbefd 100644 --- a/gst/gsttypefindfactory.c +++ b/gst/gsttypefindfactory.c @@ -91,14 +91,13 @@ GST_DEBUG_CATEGORY (type_find_debug); static void gst_type_find_factory_dispose (GObject * object); -static GstPluginFeatureClass *parent_class = NULL; - #define _do_init \ { \ GST_DEBUG_CATEGORY_INIT (type_find_debug, "GST_TYPEFIND", \ GST_DEBUG_FG_GREEN, "typefinding subsystem"); \ } +#define gst_type_find_factory_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstTypeFindFactory, gst_type_find_factory, GST_TYPE_PLUGIN_FEATURE, _do_init); @@ -107,8 +106,6 @@ gst_type_find_factory_class_init (GstTypeFindFactoryClass * klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - parent_class = g_type_class_peek_parent (klass); - object_class->dispose = gst_type_find_factory_dispose; }