rtp: Use G_DEFINE_TYPE instead of GST_BOILERPLATE

This commit is contained in:
Sebastian Dröge 2011-04-18 18:29:35 +02:00
parent 0759ce8533
commit 5d4fd722f0
2 changed files with 32 additions and 14 deletions

View file

@ -161,13 +161,9 @@ static GstStateChangeReturn gst_base_rtp_payload_audio_change_state (GstElement
static gboolean gst_base_rtp_payload_audio_handle_event (GstPad * pad,
GstEvent * event);
GST_BOILERPLATE (GstBaseRTPAudioPayload, gst_base_rtp_audio_payload,
GstBaseRTPPayload, GST_TYPE_BASE_RTP_PAYLOAD);
static void
gst_base_rtp_audio_payload_base_init (gpointer klass)
{
}
#define gst_base_rtp_audio_payload_parent_class parent_class
G_DEFINE_TYPE (GstBaseRTPAudioPayload, gst_base_rtp_audio_payload,
GST_TYPE_BASE_RTP_PAYLOAD);
static void
gst_base_rtp_audio_payload_class_init (GstBaseRTPAudioPayloadClass * klass)
@ -204,8 +200,7 @@ gst_base_rtp_audio_payload_class_init (GstBaseRTPAudioPayloadClass * klass)
}
static void
gst_base_rtp_audio_payload_init (GstBaseRTPAudioPayload * payload,
GstBaseRTPAudioPayloadClass * klass)
gst_base_rtp_audio_payload_init (GstBaseRTPAudioPayload * payload)
{
payload->priv = GST_BASE_RTP_AUDIO_PAYLOAD_GET_PRIVATE (payload);

View file

@ -100,14 +100,37 @@ static gboolean gst_base_rtp_depayload_packet_lost (GstBaseRTPDepayload *
static gboolean gst_base_rtp_depayload_handle_event (GstBaseRTPDepayload *
filter, GstEvent * event);
GST_BOILERPLATE (GstBaseRTPDepayload, gst_base_rtp_depayload, GstElement,
GST_TYPE_ELEMENT);
static GstElementClass *parent_class = NULL;
static void gst_base_rtp_depayload_class_init (GstBaseRTPDepayloadClass *
klass);
static void gst_base_rtp_depayload_init (GstBaseRTPDepayload * basertppayload,
GstBaseRTPDepayloadClass * klass);
static void
gst_base_rtp_depayload_base_init (gpointer klass)
GType
gst_base_rtp_depayload_get_type (void)
{
/*GstElementClass *element_class = GST_ELEMENT_CLASS (klass); */
static GType base_rtp_depayload_type = 0;
if (g_once_init_enter ((gsize *) & base_rtp_depayload_type)) {
static const GTypeInfo base_rtp_depayload_info = {
sizeof (GstBaseRTPDepayloadClass),
NULL,
NULL,
(GClassInitFunc) gst_base_rtp_depayload_class_init,
NULL,
NULL,
sizeof (GstBaseRTPDepayload),
0,
(GInstanceInitFunc) gst_base_rtp_depayload_init,
};
g_once_init_leave ((gsize *) & base_rtp_depayload_type,
g_type_register_static (GST_TYPE_ELEMENT, "GstBaseRTPDepayload",
&base_rtp_depayload_info, G_TYPE_FLAG_ABSTRACT));
}
return base_rtp_depayload_type;
}
static void
gst_base_rtp_depayload_class_init (GstBaseRTPDepayloadClass * klass)