rtpmux: Use GST_BOILERPLATE

This commit is contained in:
Olivier Crête 2009-04-20 17:43:39 -04:00 committed by Tim-Philipp Müller
parent abe57be248
commit 4b958f6d8d
2 changed files with 12 additions and 68 deletions

View file

@ -87,8 +87,6 @@ enum
static guint gst_rtpdtmfmux_signals[LAST_SIGNAL] = { 0 };
static void gst_rtp_dtmf_mux_base_init (gpointer g_class);
static void gst_rtp_dtmf_mux_class_init (GstRTPDTMFMuxClass * klass);
static void gst_rtp_dtmf_mux_dispose (GObject * object);
static void gst_rtp_mux_release_pad (GstElement * element, GstPad * pad);
@ -96,31 +94,11 @@ static void gst_rtp_mux_release_pad (GstElement * element, GstPad * pad);
static gboolean gst_rtp_dtmf_mux_sink_event (GstPad * pad, GstEvent * event);
static GstFlowReturn gst_rtp_dtmf_mux_chain (GstPad * pad, GstBuffer * buffer);
static GstRTPMuxClass *parent_class = NULL;
GST_BOILERPLATE (GstRTPDTMFMux, gst_rtp_dtmf_mux, GstRTPMux, GST_TYPE_RTP_MUX);
GType
gst_rtp_dtmf_mux_get_type (void)
static void
gst_rtp_dtmf_mux_init (GstRTPDTMFMux * object, GstRTPDTMFMuxClass * g_class)
{
static GType mux_type = 0;
if (!mux_type) {
static const GTypeInfo mux_info = {
sizeof (GstRTPDTMFMuxClass),
gst_rtp_dtmf_mux_base_init,
NULL,
(GClassInitFunc) gst_rtp_dtmf_mux_class_init,
NULL,
NULL,
sizeof (GstRTPDTMFMux),
0,
(GInstanceInitFunc) NULL,
};
mux_type =
g_type_register_static (GST_TYPE_RTP_MUX, "GstRTPDTMFMux",
&mux_info, 0);
}
return mux_type;
}
static void
@ -142,8 +120,6 @@ gst_rtp_dtmf_mux_class_init (GstRTPDTMFMuxClass * klass)
gstelement_class = (GstElementClass *) klass;
gstrtpmux_class = (GstRTPMuxClass *) klass;
parent_class = g_type_class_peek_parent (klass);
gst_rtpdtmfmux_signals[SIGNAL_LOCKING_STREAM] =
g_signal_new ("locking", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstRTPDTMFMuxClass, locking), NULL, NULL,

View file

@ -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