From 655a3d125a31ec8953a6dcc3567087f4fbe4a84d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= Date: Mon, 20 Apr 2009 17:43:39 -0400 Subject: rtpmux: Use GST_BOILERPLATE --- gst/rtpmux/gstrtpmux.c | 50 +++++++++----------------------------------------- 1 file changed, 9 insertions(+), 41 deletions(-) (limited to 'gst/rtpmux/gstrtpmux.c') diff --git a/gst/rtpmux/gstrtpmux.c b/gst/rtpmux/gstrtpmux.c index 00782bbe..5cb86e18 100644 --- a/gst/rtpmux/gstrtpmux.c +++ b/gst/rtpmux/gstrtpmux.c @@ -81,10 +81,6 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink_%d", GST_STATIC_CAPS ("application/x-rtp") ); -static void gst_rtp_mux_base_init (gpointer g_class); -static void gst_rtp_mux_class_init (GstRTPMuxClass * klass); -static void gst_rtp_mux_init (GstRTPMux * rtp_mux); - static void gst_rtp_mux_finalize (GObject * object); static GstPad *gst_rtp_mux_request_new_pad (GstElement * element, @@ -102,34 +98,8 @@ static void gst_rtp_mux_set_property (GObject * object, guint prop_id, static void gst_rtp_mux_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -static gboolean gst_rtp_mux_src_event (GstPad * pad, GstEvent * event); - -static GstElementClass *parent_class = NULL; -GType -gst_rtp_mux_get_type (void) -{ - static GType rtp_mux_type = 0; - - if (!rtp_mux_type) { - static const GTypeInfo rtp_mux_info = { - sizeof (GstRTPMuxClass), - gst_rtp_mux_base_init, - NULL, - (GClassInitFunc) gst_rtp_mux_class_init, - NULL, - NULL, - sizeof (GstRTPMux), - 0, - (GInstanceInitFunc) gst_rtp_mux_init, - }; - - rtp_mux_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstRTPMux", - &rtp_mux_info, 0); - } - return rtp_mux_type; -} +GST_BOILERPLATE (GstRTPMux, gst_rtp_mux, GstElement, GST_TYPE_ELEMENT); static void gst_rtp_mux_base_init (gpointer g_class) @@ -153,8 +123,6 @@ gst_rtp_mux_class_init (GstRTPMuxClass * klass) gobject_class = (GObjectClass *) klass; gstelement_class = (GstElementClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gobject_class->finalize = gst_rtp_mux_finalize; gobject_class->get_property = gst_rtp_mux_get_property; gobject_class->set_property = gst_rtp_mux_set_property; @@ -225,20 +193,20 @@ gst_rtp_mux_src_event (GstPad * pad, GstEvent * event) } static void -gst_rtp_mux_init (GstRTPMux * rtp_mux) +gst_rtp_mux_init (GstRTPMux * object, GstRTPMuxClass * g_class) { - GstElementClass *klass = GST_ELEMENT_GET_CLASS (rtp_mux); + GstElementClass *klass = GST_ELEMENT_GET_CLASS (object); - rtp_mux->srcpad = + object->srcpad = gst_pad_new_from_template (gst_element_class_get_pad_template (klass, "src"), "src"); - gst_pad_set_event_function (rtp_mux->srcpad, + gst_pad_set_event_function (object->srcpad, GST_DEBUG_FUNCPTR (gst_rtp_mux_src_event)); - gst_element_add_pad (GST_ELEMENT (rtp_mux), rtp_mux->srcpad); + gst_element_add_pad (GST_ELEMENT (object), object->srcpad); - rtp_mux->ssrc = DEFAULT_SSRC; - rtp_mux->ts_offset = DEFAULT_TIMESTAMP_OFFSET; - rtp_mux->seqnum_offset = DEFAULT_SEQNUM_OFFSET; + object->ssrc = DEFAULT_SSRC; + object->ts_offset = DEFAULT_TIMESTAMP_OFFSET; + object->seqnum_offset = DEFAULT_SEQNUM_OFFSET; } static void -- cgit v1.2.1