From 7da7494adcf63fc8e9dd9750adf2e96f7ef3973b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 18 Apr 2011 17:32:17 +0200 Subject: [PATCH] base: Use G_DEFINE_TYPE instead of GST_BOILERPLATE --- libs/gst/base/gstadapter.c | 14 ++++---------- libs/gst/base/gstcollectpads.c | 11 +++-------- libs/gst/base/gstpushsrc.c | 14 ++++---------- 3 files changed, 11 insertions(+), 28 deletions(-) diff --git a/libs/gst/base/gstadapter.c b/libs/gst/base/gstadapter.c index 446345f46c..6b4c661b43 100644 --- a/libs/gst/base/gstadapter.c +++ b/libs/gst/base/gstadapter.c @@ -136,20 +136,14 @@ struct _GstAdapterPrivate gsize csize; }; -#define _do_init(thing) \ +#define _do_init \ GST_DEBUG_CATEGORY_INIT (gst_adapter_debug, "adapter", 0, "object to splice and merge buffers to desired size") -GST_BOILERPLATE_FULL (GstAdapter, gst_adapter, GObject, G_TYPE_OBJECT, - _do_init); +#define gst_adapter_parent_class parent_class +G_DEFINE_TYPE_WITH_CODE (GstAdapter, gst_adapter, G_TYPE_OBJECT, _do_init); static void gst_adapter_dispose (GObject * object); static void gst_adapter_finalize (GObject * object); -static void -gst_adapter_base_init (gpointer g_class) -{ - /* nop */ -} - static void gst_adapter_class_init (GstAdapterClass * klass) { @@ -162,7 +156,7 @@ gst_adapter_class_init (GstAdapterClass * klass) } static void -gst_adapter_init (GstAdapter * adapter, GstAdapterClass * g_class) +gst_adapter_init (GstAdapter * adapter) { adapter->priv = GST_ADAPTER_GET_PRIVATE (adapter); adapter->assembled_data = g_malloc (DEFAULT_SIZE); diff --git a/libs/gst/base/gstcollectpads.c b/libs/gst/base/gstcollectpads.c index e0f25eab40..f39a1fbc8a 100644 --- a/libs/gst/base/gstcollectpads.c +++ b/libs/gst/base/gstcollectpads.c @@ -86,7 +86,8 @@ struct _GstCollectPadsPrivate gpointer clipfunc_user_data; }; -GST_BOILERPLATE (GstCollectPads, gst_collect_pads, GstObject, GST_TYPE_OBJECT); +#define gst_collect_pads_parent_class parent_class +G_DEFINE_TYPE (GstCollectPads, gst_collect_pads, GST_TYPE_OBJECT); static void gst_collect_pads_clear (GstCollectPads * pads, GstCollectData * data); @@ -97,12 +98,6 @@ static void ref_data (GstCollectData * data); static void unref_data (GstCollectData * data); static void gst_collect_pads_check_pads_unlocked (GstCollectPads * pads); -static void -gst_collect_pads_base_init (gpointer g_class) -{ - /* Do nothing here */ -} - static void gst_collect_pads_class_init (GstCollectPadsClass * klass) { @@ -117,7 +112,7 @@ gst_collect_pads_class_init (GstCollectPadsClass * klass) } static void -gst_collect_pads_init (GstCollectPads * pads, GstCollectPadsClass * g_class) +gst_collect_pads_init (GstCollectPads * pads) { pads->abidata.ABI.priv = GST_COLLECT_PADS_GET_PRIVATE (pads); diff --git a/libs/gst/base/gstpushsrc.c b/libs/gst/base/gstpushsrc.c index 4201e3ae22..19eb37f902 100644 --- a/libs/gst/base/gstpushsrc.c +++ b/libs/gst/base/gstpushsrc.c @@ -62,23 +62,17 @@ GST_DEBUG_CATEGORY_STATIC (gst_push_src_debug); #define GST_CAT_DEFAULT gst_push_src_debug -#define _do_init(type) \ +#define _do_init \ GST_DEBUG_CATEGORY_INIT (gst_push_src_debug, "pushsrc", 0, \ "pushsrc element"); -GST_BOILERPLATE_FULL (GstPushSrc, gst_push_src, GstBaseSrc, GST_TYPE_BASE_SRC, - _do_init); +#define gst_push_src_parent_class parent_class +G_DEFINE_TYPE_WITH_CODE (GstPushSrc, gst_push_src, GST_TYPE_BASE_SRC, _do_init); static gboolean gst_push_src_check_get_range (GstBaseSrc * src); static GstFlowReturn gst_push_src_create (GstBaseSrc * bsrc, guint64 offset, guint length, GstBuffer ** ret); -static void -gst_push_src_base_init (gpointer g_class) -{ - /* nop */ -} - static void gst_push_src_class_init (GstPushSrcClass * klass) { @@ -90,7 +84,7 @@ gst_push_src_class_init (GstPushSrcClass * klass) } static void -gst_push_src_init (GstPushSrc * pushsrc, GstPushSrcClass * klass) +gst_push_src_init (GstPushSrc * pushsrc) { /* nop */ }