diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2011-04-19 11:35:53 +0200 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2012-09-11 01:54:34 +0100 |
commit | 878caef597db15cdaa8ba086a8fff732854e3272 (patch) | |
tree | e36a92de71b230914604eea8f3bc5bff650a091d /gst | |
parent | d33dd31fc71b146d468fcf3dddd960f70ef92ab9 (diff) | |
download | gstreamer-plugins-bad-878caef597db15cdaa8ba086a8fff732854e3272.tar.gz |
gst: Use G_DEFINE_TYPE instead of GST_BOILERPLATE
Diffstat (limited to 'gst')
-rw-r--r-- | gst/gdp/gstgdpdepay.c | 32 | ||||
-rw-r--r-- | gst/gdp/gstgdppay.c | 35 |
2 files changed, 27 insertions, 40 deletions
diff --git a/gst/gdp/gstgdpdepay.c b/gst/gdp/gstgdpdepay.c index 28a8564c3..fd16a3846 100644 --- a/gst/gdp/gstgdpdepay.c +++ b/gst/gdp/gstgdpdepay.c @@ -62,11 +62,11 @@ GST_STATIC_PAD_TEMPLATE ("src", GST_DEBUG_CATEGORY_STATIC (gst_gdp_depay_debug); #define GST_CAT_DEFAULT gst_gdp_depay_debug -#define _do_init(x) \ +#define _do_init \ GST_DEBUG_CATEGORY_INIT (gst_gdp_depay_debug, "gdpdepay", 0, \ "GDP depayloader"); - -GST_BOILERPLATE_FULL (GstGDPDepay, gst_gdp_depay, GstElement, +#define gst_gdp_depay_parent_class parent_class +G_DEFINE_TYPE_WITH_CODE (GstGDPDepay, gst_gdp_depay, GST_TYPE_ELEMENT, _do_init); static gboolean gst_gdp_depay_sink_event (GstPad * pad, GstEvent * event); @@ -80,29 +80,23 @@ static GstStateChangeReturn gst_gdp_depay_change_state (GstElement * static void gst_gdp_depay_finalize (GObject * object); static void -gst_gdp_depay_base_init (gpointer g_class) +gst_gdp_depay_class_init (GstGDPDepayClass * klass) { - GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); + GObjectClass *gobject_class; + GstElementClass *gstelement_class; - gst_element_class_set_details_simple (element_class, + gobject_class = (GObjectClass *) klass; + gstelement_class = (GstElementClass *) klass; + + gst_element_class_set_details_simple (gstelement_class, "GDP Depayloader", "GDP/Depayloader", "Depayloads GStreamer Data Protocol buffers", "Thomas Vander Stichele <thomas at apestaart dot org>"); - gst_element_class_add_pad_template (element_class, + gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&gdp_depay_sink_template)); - gst_element_class_add_pad_template (element_class, + gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&gdp_depay_src_template)); -} - -static void -gst_gdp_depay_class_init (GstGDPDepayClass * klass) -{ - GObjectClass *gobject_class; - GstElementClass *gstelement_class; - - gobject_class = (GObjectClass *) klass; - gstelement_class = (GstElementClass *) klass; gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_gdp_depay_change_state); @@ -110,7 +104,7 @@ gst_gdp_depay_class_init (GstGDPDepayClass * klass) } static void -gst_gdp_depay_init (GstGDPDepay * gdpdepay, GstGDPDepayClass * g_class) +gst_gdp_depay_init (GstGDPDepay * gdpdepay) { gdpdepay->sinkpad = gst_pad_new_from_static_template (&gdp_depay_sink_template, "sink"); diff --git a/gst/gdp/gstgdppay.c b/gst/gdp/gstgdppay.c index 994f56fff..27743490a 100644 --- a/gst/gdp/gstgdppay.c +++ b/gst/gdp/gstgdppay.c @@ -67,12 +67,11 @@ enum PROP_VERSION, }; -#define _do_init(x) \ +#define _do_init \ GST_DEBUG_CATEGORY_INIT (gst_gdp_pay_debug, "gdppay", 0, \ "GDP payloader"); - -GST_BOILERPLATE_FULL (GstGDPPay, gst_gdp_pay, GstElement, - GST_TYPE_ELEMENT, _do_init); +#define gst_gdp_pay_parent_class parent_class +G_DEFINE_TYPE_WITH_CODE (GstGDPPay, gst_gdp_pay, GST_TYPE_ELEMENT, _do_init); static void gst_gdp_pay_reset (GstGDPPay * this); @@ -91,22 +90,6 @@ static void gst_gdp_pay_get_property (GObject * object, guint prop_id, static void gst_gdp_pay_finalize (GObject * gobject); static void -gst_gdp_pay_base_init (gpointer g_class) -{ - GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); - - gst_element_class_set_details_simple (element_class, - "GDP Payloader", "GDP/Payloader", - "Payloads GStreamer Data Protocol buffers", - "Thomas Vander Stichele <thomas at apestaart dot org>"); - - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&gdp_pay_sink_template)); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&gdp_pay_src_template)); -} - -static void gst_gdp_pay_class_init (GstGDPPayClass * klass) { GObjectClass *gobject_class; @@ -133,11 +116,21 @@ gst_gdp_pay_class_init (GstGDPPayClass * klass) GST_TYPE_DP_VERSION, DEFAULT_VERSION, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + gst_element_class_set_details_simple (gstelement_class, + "GDP Payloader", "GDP/Payloader", + "Payloads GStreamer Data Protocol buffers", + "Thomas Vander Stichele <thomas at apestaart dot org>"); + + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&gdp_pay_sink_template)); + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&gdp_pay_src_template)); + gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_gdp_pay_change_state); } static void -gst_gdp_pay_init (GstGDPPay * gdppay, GstGDPPayClass * g_class) +gst_gdp_pay_init (GstGDPPay * gdppay) { gdppay->sinkpad = gst_pad_new_from_static_template (&gdp_pay_sink_template, "sink"); |