diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-12-23 13:09:54 +0100 |
---|---|---|
committer | Wim Taymans <wim@metal.(none)> | 2009-12-23 13:09:54 +0100 |
commit | 9f098b352b2bdf275df712b0a935af8bb79edfcb (patch) | |
tree | 522e64f1461340ee1ccf5061b42ab0b07f3894d7 | |
parent | 2ee7f58416375496c6738119465240f57c0ff9d6 (diff) |
rtp: use boilerplate
35 files changed, 46 insertions, 365 deletions
diff --git a/gst/rtp/gstasteriskh263.c b/gst/rtp/gstasteriskh263.c index 9a92d2127..d98c55623 100644 --- a/gst/rtp/gstasteriskh263.c +++ b/gst/rtp/gstasteriskh263.c @@ -71,9 +71,6 @@ GST_STATIC_PAD_TEMPLATE ("sink", "clock-rate = (int) 90000, " "encoding-name = (string) \"H263-1998\"") ); -static void gst_asteriskh263_class_init (GstAsteriskh263Class * klass); -static void gst_asteriskh263_base_init (GstAsteriskh263Class * klass); -static void gst_asteriskh263_init (GstAsteriskh263 * asteriskh263); static void gst_asteriskh263_finalize (GObject * object); static GstFlowReturn gst_asteriskh263_chain (GstPad * pad, GstBuffer * buffer); @@ -81,35 +78,11 @@ static GstFlowReturn gst_asteriskh263_chain (GstPad * pad, GstBuffer * buffer); static GstStateChangeReturn gst_asteriskh263_change_state (GstElement * element, GstStateChange transition); -static GstElementClass *parent_class = NULL; - -static GType -gst_asteriskh263_get_type (void) -{ - static GType asteriskh263_type = 0; - - if (!asteriskh263_type) { - static const GTypeInfo asteriskh263_info = { - sizeof (GstAsteriskh263Class), - (GBaseInitFunc) gst_asteriskh263_base_init, - NULL, - (GClassInitFunc) gst_asteriskh263_class_init, - NULL, - NULL, - sizeof (GstAsteriskh263), - 0, - (GInstanceInitFunc) gst_asteriskh263_init, - }; - - asteriskh263_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstAsteriskh263", - &asteriskh263_info, 0); - } - return asteriskh263_type; -} +GST_BOILERPLATE (GstAsteriskh263, gst_asteriskh263, GstElement, + GST_TYPE_ELEMENT); static void -gst_asteriskh263_base_init (GstAsteriskh263Class * klass) +gst_asteriskh263_base_init (gpointer klass) { GstElementClass *element_class = GST_ELEMENT_CLASS (klass); @@ -130,15 +103,14 @@ gst_asteriskh263_class_init (GstAsteriskh263Class * klass) gobject_class = (GObjectClass *) klass; gstelement_class = (GstElementClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gobject_class->finalize = gst_asteriskh263_finalize; gstelement_class->change_state = gst_asteriskh263_change_state; } static void -gst_asteriskh263_init (GstAsteriskh263 * asteriskh263) +gst_asteriskh263_init (GstAsteriskh263 * asteriskh263, + GstAsteriskh263Class * klass) { asteriskh263->srcpad = gst_pad_new_from_static_template (&gst_asteriskh263_src_template, "src"); diff --git a/gst/rtp/gstrtpL16depay.c b/gst/rtp/gstrtpL16depay.c index 914d6e27c..ceb966d33 100644 --- a/gst/rtp/gstrtpL16depay.c +++ b/gst/rtp/gstrtpL16depay.c @@ -102,8 +102,6 @@ gst_rtp_L16_depay_class_init (GstRtpL16DepayClass * klass) gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gstbasertpdepayload_class->set_caps = gst_rtp_L16_depay_setcaps; gstbasertpdepayload_class->process = gst_rtp_L16_depay_process; diff --git a/gst/rtp/gstrtpac3depay.c b/gst/rtp/gstrtpac3depay.c index 90aa83280..2e1a58d76 100644 --- a/gst/rtp/gstrtpac3depay.c +++ b/gst/rtp/gstrtpac3depay.c @@ -82,8 +82,6 @@ gst_rtp_ac3_depay_class_init (GstRtpAC3DepayClass * klass) gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gstbasertpdepayload_class->set_caps = gst_rtp_ac3_depay_setcaps; gstbasertpdepayload_class->process = gst_rtp_ac3_depay_process; diff --git a/gst/rtp/gstrtpamrdepay.c b/gst/rtp/gstrtpamrdepay.c index 933b943de..ab217d9d2 100644 --- a/gst/rtp/gstrtpamrdepay.c +++ b/gst/rtp/gstrtpamrdepay.c @@ -141,8 +141,6 @@ gst_rtp_amr_depay_class_init (GstRtpAMRDepayClass * klass) gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gstbasertpdepayload_class->process = gst_rtp_amr_depay_process; gstbasertpdepayload_class->set_caps = gst_rtp_amr_depay_setcaps; diff --git a/gst/rtp/gstrtpamrpay.c b/gst/rtp/gstrtpamrpay.c index 28fbe21ee..ba863af68 100644 --- a/gst/rtp/gstrtpamrpay.c +++ b/gst/rtp/gstrtpamrpay.c @@ -120,8 +120,6 @@ gst_rtp_amr_pay_class_init (GstRtpAMRPayClass * klass) gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gstbasertppayload_class->set_caps = gst_rtp_amr_pay_setcaps; gstbasertppayload_class->handle_buffer = gst_rtp_amr_pay_handle_buffer; diff --git a/gst/rtp/gstrtpbvpay.c b/gst/rtp/gstrtpbvpay.c index 274d8d891..1d41f64a2 100644 --- a/gst/rtp/gstrtpbvpay.c +++ b/gst/rtp/gstrtpbvpay.c @@ -88,8 +88,6 @@ gst_rtpbvpay_class_init (GstRTPBVPayClass * klass) gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass; - parent_class = g_type_class_ref (GST_TYPE_BASE_RTP_PAYLOAD); - gstbasertppayload_class->set_caps = gst_rtpbvpay_sink_setcaps; gstbasertppayload_class->get_caps = gst_rtpbvpay_sink_getcaps; diff --git a/gst/rtp/gstrtpdepay.c b/gst/rtp/gstrtpdepay.c index 23e600066..22e94fb9f 100644 --- a/gst/rtp/gstrtpdepay.c +++ b/gst/rtp/gstrtpdepay.c @@ -58,44 +58,15 @@ GST_STATIC_PAD_TEMPLATE ("sinkrtcp", GST_STATIC_CAPS ("application/x-rtcp") ); -static void gst_rtp_depay_class_init (GstRTPDepayClass * klass); -static void gst_rtp_depay_init (GstRTPDepay * rtpdepay); - static GstCaps *gst_rtp_depay_getcaps (GstPad * pad); static GstFlowReturn gst_rtp_depay_chain_rtp (GstPad * pad, GstBuffer * buffer); static GstFlowReturn gst_rtp_depay_chain_rtcp (GstPad * pad, GstBuffer * buffer); -static GstElementClass *parent_class = NULL; - -/*static guint gst_rtp_depay_signals[LAST_SIGNAL] = { 0 };*/ - -GType -gst_rtp_depay_get_type (void) -{ - static GType rtpdepay_type = 0; - - if (!rtpdepay_type) { - static const GTypeInfo rtpdepay_info = { - sizeof (GstRTPDepayClass), NULL, - NULL, - (GClassInitFunc) gst_rtp_depay_class_init, - NULL, - NULL, - sizeof (GstRTPDepay), - 0, - (GInstanceInitFunc) gst_rtp_depay_init, - }; - - rtpdepay_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstRTPDepay", &rtpdepay_info, - 0); - } - return rtpdepay_type; -} +GST_BOILERPLATE (GstRTPDepay, gst_rtp_depay, GstElement, GST_TYPE_ELEMENT); static void -gst_rtp_depay_class_init (GstRTPDepayClass * klass) +gst_rtp_depay_base_init (gpointer klass) { GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); @@ -108,14 +79,16 @@ gst_rtp_depay_class_init (GstRTPDepayClass * klass) gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&gst_rtp_depay_sink_rtcp_template)); gst_element_class_set_details (gstelement_class, &rtpdepay_details); +} - parent_class = g_type_class_peek_parent (klass); - +static void +gst_rtp_depay_class_init (GstRTPDepayClass * klass) +{ GST_DEBUG_CATEGORY_INIT (rtpdepay_debug, "rtpdepay", 0, "RTP decoder"); } static void -gst_rtp_depay_init (GstRTPDepay * rtpdepay) +gst_rtp_depay_init (GstRTPDepay * rtpdepay, GstRTPDepayClass * klass) { /* the input rtp pad */ rtpdepay->sink_rtp = diff --git a/gst/rtp/gstrtpg729depay.c b/gst/rtp/gstrtpg729depay.c index 43f2bc890..50b6381f4 100644 --- a/gst/rtp/gstrtpg729depay.c +++ b/gst/rtp/gstrtpg729depay.c @@ -109,8 +109,6 @@ gst_rtp_g729_depay_class_init (GstRtpG729DepayClass * klass) gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gstbasertpdepayload_class->process = gst_rtp_g729_depay_process; gstbasertpdepayload_class->set_caps = gst_rtp_g729_depay_setcaps; } diff --git a/gst/rtp/gstrtpgsmdepay.c b/gst/rtp/gstrtpgsmdepay.c index 21ccf1fb1..f5983162c 100644 --- a/gst/rtp/gstrtpgsmdepay.c +++ b/gst/rtp/gstrtpgsmdepay.c @@ -92,8 +92,6 @@ gst_rtp_gsm_depay_class_init (GstRTPGSMDepayClass * klass) gstbasertp_depayload_class = (GstBaseRTPDepayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gstbasertp_depayload_class->process = gst_rtp_gsm_depay_process; gstbasertp_depayload_class->set_caps = gst_rtp_gsm_depay_setcaps; diff --git a/gst/rtp/gstrtpgsmpay.c b/gst/rtp/gstrtpgsmpay.c index 6f0b85a8d..21242bf74 100644 --- a/gst/rtp/gstrtpgsmpay.c +++ b/gst/rtp/gstrtpgsmpay.c @@ -86,8 +86,6 @@ gst_rtp_gsm_pay_class_init (GstRTPGSMPayClass * klass) gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gstbasertppayload_class->set_caps = gst_rtp_gsm_pay_setcaps; gstbasertppayload_class->handle_buffer = gst_rtp_gsm_pay_handle_buffer; diff --git a/gst/rtp/gstrtph263depay.c b/gst/rtp/gstrtph263depay.c index 793a06f5d..92e4a7626 100644 --- a/gst/rtp/gstrtph263depay.c +++ b/gst/rtp/gstrtph263depay.c @@ -106,8 +106,6 @@ gst_rtp_h263_depay_class_init (GstRtpH263DepayClass * klass) gstelement_class = (GstElementClass *) klass; gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gstbasertpdepayload_class->process = gst_rtp_h263_depay_process; gstbasertpdepayload_class->set_caps = gst_rtp_h263_depay_setcaps; diff --git a/gst/rtp/gstrtph263pay.c b/gst/rtp/gstrtph263pay.c index 2394b0fbc..8efc07ae0 100644 --- a/gst/rtp/gstrtph263pay.c +++ b/gst/rtp/gstrtph263pay.c @@ -375,9 +375,6 @@ static GstStaticPadTemplate gst_rtp_h263_pay_src_template = "clock-rate = (int) 90000, " "encoding-name = (string) \"H263\"") ); -static void gst_rtp_h263_pay_class_init (GstRtpH263PayClass * klass); -static void gst_rtp_h263_pay_base_init (GstRtpH263PayClass * klass); -static void gst_rtp_h263_pay_init (GstRtpH263Pay * rtph263pay); static void gst_rtp_h263_pay_finalize (GObject * object); static gboolean gst_rtp_h263_pay_setcaps (GstBaseRTPPayload * payload, @@ -406,35 +403,10 @@ static void gst_rtp_h263_pay_context_destroy (GstRtpH263PayContext * context, guint ind); static void gst_rtp_h263_pay_package_destroy (GstRtpH263PayPackage * pack); -static GstBaseRTPPayloadClass *parent_class = NULL; +GST_BOILERPLATE (GstRtpH263Pay, gst_rtp_h263_pay, GstBaseRTPPayload, + GST_TYPE_BASE_RTP_PAYLOAD) -static GType -gst_rtp_h263_pay_get_type (void) -{ - static GType rtph263pay_type = 0; - - if (!rtph263pay_type) { - static const GTypeInfo rtph263pay_info = { - sizeof (GstRtpH263PayClass), - (GBaseInitFunc) gst_rtp_h263_pay_base_init, - NULL, - (GClassInitFunc) gst_rtp_h263_pay_class_init, - NULL, - NULL, - sizeof (GstRtpH263Pay), - 0, - (GInstanceInitFunc) gst_rtp_h263_pay_init, - }; - - rtph263pay_type = - g_type_register_static (GST_TYPE_BASE_RTP_PAYLOAD, "GstRtpH263Pay", - &rtph263pay_info, 0); - } - return rtph263pay_type; -} - -static void -gst_rtp_h263_pay_base_init (GstRtpH263PayClass * klass) + static void gst_rtp_h263_pay_base_init (gpointer klass) { GstElementClass *element_class = GST_ELEMENT_CLASS (klass); @@ -455,8 +427,6 @@ gst_rtp_h263_pay_class_init (GstRtpH263PayClass * klass) gobject_class = (GObjectClass *) klass; gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gobject_class->finalize = gst_rtp_h263_pay_finalize; gstbasertppayload_class->set_caps = gst_rtp_h263_pay_setcaps; @@ -475,7 +445,7 @@ gst_rtp_h263_pay_class_init (GstRtpH263PayClass * klass) } static void -gst_rtp_h263_pay_init (GstRtpH263Pay * rtph263pay) +gst_rtp_h263_pay_init (GstRtpH263Pay * rtph263pay, GstRtpH263PayClass * klass) { rtph263pay->adapter = gst_adapter_new (); @@ -924,9 +894,8 @@ gst_rtp_h263_pay_move_window_right (GstRtpH263PayContext * context, guint n, } else { if (n > rest_bits) { context->window = - (context-> - window << rest_bits) | (*context->win_end & (((guint) pow (2.0, - (double) rest_bits)) - 1)); + (context->window << rest_bits) | (*context-> + win_end & (((guint) pow (2.0, (double) rest_bits)) - 1)); n -= rest_bits; rest_bits = 0; } else { @@ -1687,8 +1656,8 @@ gst_rtp_h263_pay_flush (GstRtpH263Pay * rtph263pay) gst_rtp_h263_pay_boundry_init (&bound, NULL, rtph263pay->data - 1, 0, 0); context->gobs = - (GstRtpH263PayGob **) g_malloc0 (format_props[context-> - piclayer->ptype_srcformat][0] * sizeof (GstRtpH263PayGob *)); + (GstRtpH263PayGob **) g_malloc0 (format_props[context->piclayer-> + ptype_srcformat][0] * sizeof (GstRtpH263PayGob *)); for (i = 0; i < format_props[context->piclayer->ptype_srcformat][0]; i++) { diff --git a/gst/rtp/gstrtph263pdepay.c b/gst/rtp/gstrtph263pdepay.c index 42b1d9514..e6652007e 100644 --- a/gst/rtp/gstrtph263pdepay.c +++ b/gst/rtp/gstrtph263pdepay.c @@ -121,8 +121,6 @@ gst_rtp_h263p_depay_class_init (GstRtpH263PDepayClass * klass) gstelement_class = (GstElementClass *) klass; gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gstbasertpdepayload_class->process = gst_rtp_h263p_depay_process; gstbasertpdepayload_class->set_caps = gst_rtp_h263p_depay_setcaps; diff --git a/gst/rtp/gstrtph263ppay.c b/gst/rtp/gstrtph263ppay.c index ef0af9d39..067abe5d4 100644 --- a/gst/rtp/gstrtph263ppay.c +++ b/gst/rtp/gstrtph263ppay.c @@ -85,9 +85,6 @@ static GstStaticPadTemplate gst_rtp_h263p_pay_src_template = "clock-rate = (int) 90000, " "encoding-name = (string) \"H263-2000\"") ); -static void gst_rtp_h263p_pay_class_init (GstRtpH263PPayClass * klass); -static void gst_rtp_h263p_pay_base_init (GstRtpH263PPayClass * klass); -static void gst_rtp_h263p_pay_init (GstRtpH263PPay * rtph263ppay); static void gst_rtp_h263p_pay_finalize (GObject * object); static void gst_rtp_h263p_pay_set_property (GObject * object, guint prop_id, @@ -100,35 +97,11 @@ static gboolean gst_rtp_h263p_pay_setcaps (GstBaseRTPPayload * payload, static GstFlowReturn gst_rtp_h263p_pay_handle_buffer (GstBaseRTPPayload * payload, GstBuffer * buffer); -static GstBaseRTPPayloadClass *parent_class = NULL; - -static GType -gst_rtp_h263p_pay_get_type (void) -{ - static GType rtph263ppay_type = 0; - - if (!rtph263ppay_type) { - static const GTypeInfo rtph263ppay_info = { - sizeof (GstRtpH263PPayClass), - (GBaseInitFunc) gst_rtp_h263p_pay_base_init, - NULL, - (GClassInitFunc) gst_rtp_h263p_pay_class_init, - NULL, - NULL, - sizeof (GstRtpH263PPay), - 0, - (GInstanceInitFunc) gst_rtp_h263p_pay_init, - }; - - rtph263ppay_type = - g_type_register_static (GST_TYPE_BASE_RTP_PAYLOAD, "GstRtpH263PPay", - &rtph263ppay_info, 0); - } - return rtph263ppay_type; -} +GST_BOILERPLATE (GstRtpH263PPay, gst_rtp_h263p_pay, GstBaseRTPPayload, + GST_TYPE_BASE_RTP_PAYLOAD); static void -gst_rtp_h263p_pay_base_init (GstRtpH263PPayClass * klass) +gst_rtp_h263p_pay_base_init (gpointer klass) { GstElementClass *element_class = GST_ELEMENT_CLASS (klass); @@ -149,8 +122,6 @@ gst_rtp_h263p_pay_class_init (GstRtpH263PPayClass * klass) gobject_class = (GObjectClass *) klass; gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gobject_class->finalize = gst_rtp_h263p_pay_finalize; gobject_class->set_property = gst_rtp_h263p_pay_set_property; gobject_class->get_property = gst_rtp_h263p_pay_get_property; @@ -169,7 +140,8 @@ gst_rtp_h263p_pay_class_init (GstRtpH263PPayClass * klass) } static void -gst_rtp_h263p_pay_init (GstRtpH263PPay * rtph263ppay) +gst_rtp_h263p_pay_init (GstRtpH263PPay * rtph263ppay, + GstRtpH263PPayClass * klass) { rtph263ppay->adapter = gst_adapter_new (); diff --git a/gst/rtp/gstrtpilbcpay.c b/gst/rtp/gstrtpilbcpay.c index 579c3b1a8..5c0f56b9f 100644 --- a/gst/rtp/gstrtpilbcpay.c +++ b/gst/rtp/gstrtpilbcpay.c @@ -83,8 +83,6 @@ gst_rtpilbcpay_class_init (GstRTPILBCPayClass * klass) gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass; - parent_class = g_type_class_ref (GST_TYPE_BASE_RTP_PAYLOAD); - gstbasertppayload_class->set_caps = gst_rtpilbcpay_sink_setcaps; gstbasertppayload_class->get_caps = gst_rtpilbcpay_sink_getcaps; diff --git a/gst/rtp/gstrtpjpegdepay.c b/gst/rtp/gstrtpjpegdepay.c index 0ec6a97df..87c71585f 100644 --- a/gst/rtp/gstrtpjpegdepay.c +++ b/gst/rtp/gstrtpjpegdepay.c @@ -107,8 +107,6 @@ gst_rtp_jpeg_depay_class_init (GstRtpJPEGDepayClass * klass) gobject_class->finalize = gst_rtp_jpeg_depay_finalize; - parent_class = g_type_class_peek_parent (klass); - gstbasertpdepayload_class->set_caps = gst_rtp_jpeg_depay_setcaps; gstbasertpdepayload_class->process = gst_rtp_jpeg_depay_process; diff --git a/gst/rtp/gstrtpmp1sdepay.c b/gst/rtp/gstrtpmp1sdepay.c index 785fe3d64..e5f52cbb2 100644 --- a/gst/rtp/gstrtpmp1sdepay.c +++ b/gst/rtp/gstrtpmp1sdepay.c @@ -97,11 +97,8 @@ gst_rtp_mp1s_depay_class_init (GstRtpMP1SDepayClass * klass) gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gstbasertpdepayload_class->process = gst_rtp_mp1s_depay_process; gstbasertpdepayload_class->set_caps = gst_rtp_mp1s_depay_setcaps; - } static void diff --git a/gst/rtp/gstrtpmp2tdepay.c b/gst/rtp/gstrtpmp2tdepay.c index 38db6362c..7fbb4b57f 100644 --- a/gst/rtp/gstrtpmp2tdepay.c +++ b/gst/rtp/gstrtpmp2tdepay.c @@ -112,8 +112,6 @@ gst_rtp_mp2t_depay_class_init (GstRtpMP2TDepayClass * klass) gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gstbasertpdepayload_class->process = gst_rtp_mp2t_depay_process; gstbasertpdepayload_class->set_caps = gst_rtp_mp2t_depay_setcaps; diff --git a/gst/rtp/gstrtpmp4apay.c b/gst/rtp/gstrtpmp4apay.c index e395b4ca9..071e37592 100644 --- a/gst/rtp/gstrtpmp4apay.c +++ b/gst/rtp/gstrtpmp4apay.c @@ -63,10 +63,6 @@ GST_STATIC_PAD_TEMPLATE ("src", ) ); - -static void gst_rtp_mp4a_pay_class_init (GstRtpMP4APayClass * klass); -static void gst_rtp_mp4a_pay_base_init (GstRtpMP4APayClass * klass); -static void gst_rtp_mp4a_pay_init (GstRtpMP4APay * rtpmp4apay); static void gst_rtp_mp4a_pay_finalize (GObject * object); static gboolean gst_rtp_mp4a_pay_setcaps (GstBaseRTPPayload * payload, @@ -74,35 +70,10 @@ static gboolean gst_rtp_mp4a_pay_setcaps (GstBaseRTPPayload * payload, static GstFlowReturn gst_rtp_mp4a_pay_handle_buffer (GstBaseRTPPayload * payload, GstBuffer * buffer); -static GstBaseRTPPayloadClass *parent_class = NULL; +GST_BOILERPLATE (GstRtpMP4APay, gst_rtp_mp4a_pay, GstBaseRTPPayload, + GST_TYPE_BASE_RTP_PAYLOAD) -static GType -gst_rtp_mp4a_pay_get_type (void) -{ - static GType rtpmp4apay_type = 0; - - if (!rtpmp4apay_type) { - static const GTypeInfo rtpmp4apay_info = { - sizeof (GstRtpMP4APayClass), - (GBaseInitFunc) gst_rtp_mp4a_pay_base_init, - NULL, - (GClassInitFunc) gst_rtp_mp4a_pay_class_init, - NULL, - NULL, - sizeof (GstRtpMP4APay), - 0, - (GInstanceInitFunc) gst_rtp_mp4a_pay_init, - }; - - rtpmp4apay_type = - g_type_register_static (GST_TYPE_BASE_RTP_PAYLOAD, "GstRtpMP4APay", - &rtpmp4apay_info, 0); - } - return rtpmp4apay_type; -} - -static void -gst_rtp_mp4a_pay_base_init (GstRtpMP4APayClass * klass) + static void gst_rtp_mp4a_pay_base_init (gpointer klass) { GstElementClass *element_class = GST_ELEMENT_CLASS (klass); @@ -123,8 +94,6 @@ gst_rtp_mp4a_pay_class_init (GstRtpMP4APayClass * klass) gobject_class = (GObjectClass *) klass; gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gobject_class->finalize = gst_rtp_mp4a_pay_finalize; gstbasertppayload_class->set_caps = gst_rtp_mp4a_pay_setcaps; @@ -135,7 +104,7 @@ gst_rtp_mp4a_pay_class_init (GstRtpMP4APayClass * klass) } static void -gst_rtp_mp4a_pay_init (GstRtpMP4APay * rtpmp4apay) +gst_rtp_mp4a_pay_init (GstRtpMP4APay * rtpmp4apay, GstRtpMP4APayClass * klass) { rtpmp4apay->rate = 90000; rtpmp4apay->profile = g_strdup ("1"); diff --git a/gst/rtp/gstrtpmp4gdepay.c b/gst/rtp/gstrtpmp4gdepay.c index 865e120f3..d3f1b03d5 100644 --- a/gst/rtp/gstrtpmp4gdepay.c +++ b/gst/rtp/gstrtpmp4gdepay.c @@ -170,8 +170,6 @@ gst_rtp_mp4g_depay_class_init (GstRtpMP4GDepayClass * klass) gstelement_class = (GstElementClass *) klass; gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gobject_class->finalize = gst_rtp_mp4g_depay_finalize; gstelement_class->change_state = gst_rtp_mp4g_depay_change_state; diff --git a/gst/rtp/gstrtpmp4gpay.c b/gst/rtp/gstrtpmp4gpay.c index 1ad8e1c60..14e56c2b5 100644 --- a/gst/rtp/gstrtpmp4gpay.c +++ b/gst/rtp/gstrtpmp4gpay.c @@ -78,9 +78,6 @@ GST_STATIC_PAD_TEMPLATE ("src", ); -static void gst_rtp_mp4g_pay_class_init (GstRtpMP4GPayClass * klass); -static void gst_rtp_mp4g_pay_base_init (GstRtpMP4GPayClass * klass); -static void gst_rtp_mp4g_pay_init (GstRtpMP4GPay * rtpmp4gpay); static void gst_rtp_mp4g_pay_finalize (GObject * object); static gboolean gst_rtp_mp4g_pay_setcaps (GstBaseRTPPayload * payload, @@ -88,35 +85,10 @@ static gboolean gst_rtp_mp4g_pay_setcaps (GstBaseRTPPayload * payload, static GstFlowReturn gst_rtp_mp4g_pay_handle_buffer (GstBaseRTPPayload * payload, GstBuffer * buffer); -static GstBaseRTPPayloadClass *parent_class = NULL; +GST_BOILERPLATE (GstRtpMP4GPay, gst_rtp_mp4g_pay, GstBaseRTPPayload, + GST_TYPE_BASE_RTP_PAYLOAD) -static GType -gst_rtp_mp4g_pay_get_type (void) -{ - static GType rtpmp4gpay_type = 0; - - if (!rtpmp4gpay_type) { - static const GTypeInfo rtpmp4gpay_info = { - sizeof (GstRtpMP4GPayClass), - (GBaseInitFunc) gst_rtp_mp4g_pay_base_init, - NULL, - (GClassInitFunc) gst_rtp_mp4g_pay_class_init, - NULL, - NULL, - sizeof (GstRtpMP4GPay), - 0, - (GInstanceInitFunc) gst_rtp_mp4g_pay_init, - }; - - rtpmp4gpay_type = - g_type_register_static (GST_TYPE_BASE_RTP_PAYLOAD, "GstRtpMP4GPay", - &rtpmp4gpay_info, 0); - } - return rtpmp4gpay_type; -} - -static void -gst_rtp_mp4g_pay_base_init (GstRtpMP4GPayClass * klass) + static void gst_rtp_mp4g_pay_base_init (gpointer klass) { GstElementClass *element_class = GST_ELEMENT_CLASS (klass); @@ -137,8 +109,6 @@ gst_rtp_mp4g_pay_class_init (GstRtpMP4GPayClass * klass) gobject_class = (GObjectClass *) klass; gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gobject_class->finalize = gst_rtp_mp4g_pay_finalize; gstbasertppayload_class->set_caps = gst_rtp_mp4g_pay_setcaps; @@ -149,7 +119,7 @@ gst_rtp_mp4g_pay_class_init (GstRtpMP4GPayClass * klass) } static void -gst_rtp_mp4g_pay_init (GstRtpMP4GPay * rtpmp4gpay) +gst_rtp_mp4g_pay_init (GstRtpMP4GPay * rtpmp4gpay, GstRtpMP4GPayClass * klass) { rtpmp4gpay->adapter = gst_adapter_new (); rtpmp4gpay->rate = 90000; diff --git a/gst/rtp/gstrtpmp4vpay.c b/gst/rtp/gstrtpmp4vpay.c index a7bf2e202..af04d91a9 100644 --- a/gst/rtp/gstrtpmp4vpay.c +++ b/gst/rtp/gstrtpmp4vpay.c @@ -72,9 +72,6 @@ enum }; -static void gst_rtp_mp4v_pay_class_init (GstRtpMP4VPayClass * klass); -static void gst_rtp_mp4v_pay_base_init (GstRtpMP4VPayClass * klass); -static void gst_rtp_mp4v_pay_init (GstRtpMP4VPay * rtpmp4vpay); static void gst_rtp_mp4v_pay_finalize (GObject * object); static void gst_rtp_mp4v_pay_set_property (GObject * object, guint prop_id, @@ -88,35 +85,10 @@ static GstFlowReturn gst_rtp_mp4v_pay_handle_buffer (GstBaseRTPPayload * payload, GstBuffer * buffer); static gboolean gst_rtp_mp4v_pay_event (GstPad * pad, GstEvent * event); -static GstBaseRTPPayloadClass *parent_class = NULL; +GST_BOILERPLATE (GstRtpMP4VPay, gst_rtp_mp4v_pay, GstBaseRTPPayload, + GST_TYPE_BASE_RTP_PAYLOAD) -static GType -gst_rtp_mp4v_pay_get_type (void) -{ - static GType rtpmp4vpay_type = 0; - - if (!rtpmp4vpay_type) { - static const GTypeInfo rtpmp4vpay_info = { - sizeof (GstRtpMP4VPayClass), - (GBaseInitFunc) gst_rtp_mp4v_pay_base_init, - NULL, - (GClassInitFunc) gst_rtp_mp4v_pay_class_init, - NULL, - NULL, - sizeof (GstRtpMP4VPay), - 0, - (GInstanceInitFunc) gst_rtp_mp4v_pay_init, - }; - - rtpmp4vpay_type = - g_type_register_static (GST_TYPE_BASE_RTP_PAYLOAD, "GstRtpMP4VPay", - &rtpmp4vpay_info, 0); - } - return rtpmp4vpay_type; -} - -static void -gst_rtp_mp4v_pay_base_init (GstRtpMP4VPayClass * klass) + static void gst_rtp_mp4v_pay_base_init (gpointer klass) { GstElementClass *element_class = GST_ELEMENT_CLASS (klass); @@ -137,8 +109,6 @@ gst_rtp_mp4v_pay_class_init (GstRtpMP4VPayClass * klass) gobject_class = (GObjectClass *) klass; gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gobject_class->set_property = gst_rtp_mp4v_pay_set_property; gobject_class->get_property = gst_rtp_mp4v_pay_get_property; @@ -159,11 +129,10 @@ gst_rtp_mp4v_pay_class_init (GstRtpMP4VPayClass * klass) GST_DEBUG_CATEGORY_INIT (rtpmp4vpay_debug, "rtpmp4vpay", 0, "MP4 video RTP Payloader"); - } static void -gst_rtp_mp4v_pay_init (GstRtpMP4VPay * rtpmp4vpay) +gst_rtp_mp4v_pay_init (GstRtpMP4VPay * rtpmp4vpay, GstRtpMP4VPayClass * klass) { GstPad *sinkpad; diff --git a/gst/rtp/gstrtpmpadepay.c b/gst/rtp/gstrtpmpadepay.c index 3545c731e..7e8e942c0 100644 --- a/gst/rtp/gstrtpmpadepay.c +++ b/gst/rtp/gstrtpmpadepay.c @@ -85,8 +85,6 @@ gst_rtp_mpa_depay_class_init (GstRtpMPADepayClass * klass) gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gstbasertpdepayload_class->set_caps = gst_rtp_mpa_depay_setcaps; gstbasertpdepayload_class->process = gst_rtp_mpa_depay_process; diff --git a/gst/rtp/gstrtpmpapay.c b/gst/rtp/gstrtpmpapay.c index a2a80c438..781accc37 100644 --- a/gst/rtp/gstrtpmpapay.c +++ b/gst/rtp/gstrtpmpapay.c @@ -55,9 +55,6 @@ static GstStaticPadTemplate gst_rtp_mpa_pay_src_template = "clock-rate = (int) 90000, " "encoding-name = (string) \"MPA\"") ); -static void gst_rtp_mpa_pay_class_init (GstRtpMPAPayClass * klass); -static void gst_rtp_mpa_pay_base_init (GstRtpMPAPayClass * klass); -static void gst_rtp_mpa_pay_init (GstRtpMPAPay * rtpmpapay); static void gst_rtp_mpa_pay_finalize (GObject * object); static gboolean gst_rtp_mpa_pay_setcaps (GstBaseRTPPayload * payload, @@ -65,35 +62,10 @@ static gboolean gst_rtp_mpa_pay_setcaps (GstBaseRTPPayload * payload, static GstFlowReturn gst_rtp_mpa_pay_handle_buffer (GstBaseRTPPayload * payload, GstBuffer * buffer); -static GstBaseRTPPayloadClass *parent_class = NULL; +GST_BOILERPLATE (GstRtpMPAPay, gst_rtp_mpa_pay, GstBaseRTPPayload, + GST_TYPE_BASE_RTP_PAYLOAD) -static GType -gst_rtp_mpa_pay_get_type (void) -{ - static GType rtpmpapay_type = 0; - - if (!rtpmpapay_type) { - static const GTypeInfo rtpmpapay_info = { - sizeof (GstRtpMPAPayClass), - (GBaseInitFunc) gst_rtp_mpa_pay_base_init, - NULL, - (GClassInitFunc) gst_rtp_mpa_pay_class_init, - NULL, - NULL, - sizeof (GstRtpMPAPay), - 0, - (GInstanceInitFunc) gst_rtp_mpa_pay_init, - }; - - rtpmpapay_type = - g_type_register_static (GST_TYPE_BASE_RTP_PAYLOAD, "GstRtpMPAPay", - &rtpmpapay_info, 0); - } - return rtpmpapay_type; -} - -static void -gst_rtp_mpa_pay_base_init (GstRtpMPAPayClass * klass) + static void gst_rtp_mpa_pay_base_init (gpointer klass) { GstElementClass *element_class = GST_ELEMENT_CLASS (klass); @@ -114,8 +86,6 @@ gst_rtp_mpa_pay_class_init (GstRtpMPAPayClass * klass) gobject_class = (GObjectClass *) klass; gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gobject_class->finalize = gst_rtp_mpa_pay_finalize; gstbasertppayload_class->set_caps = gst_rtp_mpa_pay_setcaps; @@ -123,7 +93,7 @@ gst_rtp_mpa_pay_class_init (GstRtpMPAPayClass * klass) } static void -gst_rtp_mpa_pay_init (GstRtpMPAPay * rtpmpapay) +gst_rtp_mpa_pay_init (GstRtpMPAPay * rtpmpapay, GstRtpMPAPayClass * klass) { rtpmpapay->adapter = gst_adapter_new (); } diff --git a/gst/rtp/gstrtpmpvdepay.c b/gst/rtp/gstrtpmpvdepay.c index dc8c19ee0..93a41b487 100644 --- a/gst/rtp/gstrtpmpvdepay.c +++ b/gst/rtp/gstrtpmpvdepay.c @@ -88,8 +88,6 @@ gst_rtp_mpv_depay_class_init (GstRtpMPVDepayClass * klass) gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gstbasertpdepayload_class->set_caps = gst_rtp_mpv_depay_setcaps; gstbasertpdepayload_class->process = gst_rtp_mpv_depay_process; diff --git a/gst/rtp/gstrtppcmadepay.c b/gst/rtp/gstrtppcmadepay.c index 0a7926f25..b2dfcf9f2 100644 --- a/gst/rtp/gstrtppcmadepay.c +++ b/gst/rtp/gstrtppcmadepay.c @@ -94,8 +94,6 @@ gst_rtp_pcma_depay_class_init (GstRtpPcmaDepayClass * klass) gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gstbasertpdepayload_class->process = gst_rtp_pcma_depay_process; gstbasertpdepayload_class->set_caps = gst_rtp_pcma_depay_setcaps; } diff --git a/gst/rtp/gstrtppcmudepay.c b/gst/rtp/gstrtppcmudepay.c index 67d968ae8..30c983b49 100644 --- a/gst/rtp/gstrtppcmudepay.c +++ b/gst/rtp/gstrtppcmudepay.c @@ -94,8 +94,6 @@ gst_rtp_pcmu_depay_class_init (GstRtpPcmuDepayClass * klass) gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gstbasertpdepayload_class->process = gst_rtp_pcmu_depay_process; gstbasertpdepayload_class->set_caps = gst_rtp_pcmu_depay_setcaps; } diff --git a/gst/rtp/gstrtppcmupay.c b/gst/rtp/gstrtppcmupay.c index ef99750da..f0d149094 100644 --- a/gst/rtp/gstrtppcmupay.c +++ b/gst/rtp/gstrtppcmupay.c @@ -82,8 +82,6 @@ gst_rtp_pcmu_pay_class_init (GstRtpPcmuPayClass * klass) gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gstbasertppayload_class->set_caps = gst_rtp_pcmu_pay_setcaps; } diff --git a/gst/rtp/gstrtpqdmdepay.c b/gst/rtp/gstrtpqdmdepay.c index 5eea2121a..ff28bdc55 100644 --- a/gst/rtp/gstrtpqdmdepay.c +++ b/gst/rtp/gstrtpqdmdepay.c @@ -61,6 +61,7 @@ static const guint8 headheader[20] = { 0x51, 0x44, 0x4d, 0x32, 0x0, 0x0, 0x0, 0x24, 0x51, 0x44, 0x43, 0x41 }; + static void gst_rtp_qdm2_depay_finalize (GObject * object); static GstStateChangeReturn gst_rtp_qdm2_depay_change_state (GstElement * @@ -96,8 +97,6 @@ gst_rtp_qdm2_depay_class_init (GstRtpQDM2DepayClass * klass) gstelement_class = (GstElementClass *) klass; gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gstbasertpdepayload_class->process = gst_rtp_qdm2_depay_process; gstbasertpdepayload_class->set_caps = gst_rtp_qdm2_depay_setcaps; diff --git a/gst/rtp/gstrtpsirenpay.c b/gst/rtp/gstrtpsirenpay.c index ecc91ad81..b63244a45 100644 --- a/gst/rtp/gstrtpsirenpay.c +++ b/gst/rtp/gstrtpsirenpay.c @@ -81,8 +81,6 @@ gst_rtpsirenpay_class_init (GstRTPSirenPayClass * klass) gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass; - parent_class = g_type_class_ref (GST_TYPE_BASE_RTP_PAYLOAD); - gstbasertppayload_class->set_caps = gst_rtpsirenpay_setcaps; GST_DEBUG_CATEGORY_INIT (rtpsirenpay_debug, "rtpsirenpay", 0, diff --git a/gst/rtp/gstrtpsv3vdepay.c b/gst/rtp/gstrtpsv3vdepay.c index c68ba72fd..91dbef993 100644 --- a/gst/rtp/gstrtpsv3vdepay.c +++ b/gst/rtp/gstrtpsv3vdepay.c @@ -92,8 +92,6 @@ gst_rtp_sv3v_depay_class_init (GstRtpSV3VDepayClass * klass) gstelement_class = (GstElementClass *) klass; gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gstbasertpdepayload_class->process = gst_rtp_sv3v_depay_process; gstbasertpdepayload_class->set_caps = gst_rtp_sv3v_depay_setcaps; diff --git a/gst/rtp/gstrtptheorapay.c b/gst/rtp/gstrtptheorapay.c index 77c289f5d..ffdfdc124 100644 --- a/gst/rtp/gstrtptheorapay.c +++ b/gst/rtp/gstrtptheorapay.c @@ -107,8 +107,6 @@ gst_rtp_theora_pay_class_init (GstRtpTheoraPayClass * klass) gstelement_class = (GstElementClass *) klass; gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gstelement_class->change_state = gst_rtp_theora_pay_change_state; gstbasertppayload_class->set_caps = gst_rtp_theora_pay_setcaps; diff --git a/gst/rtp/gstrtpvorbispay.c b/gst/rtp/gstrtpvorbispay.c index 0965e5aef..c96b8bba0 100644 --- a/gst/rtp/gstrtpvorbispay.c +++ b/gst/rtp/gstrtpvorbispay.c @@ -97,8 +97,6 @@ gst_rtp_vorbis_pay_class_init (GstRtpVorbisPayClass * klass) gstelement_class = (GstElementClass *) klass; gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gstelement_class->change_state = gst_rtp_vorbis_pay_change_state; gstbasertppayload_class->set_caps = gst_rtp_vorbis_pay_setcaps; diff --git a/gst/rtp/gstrtpvrawdepay.c b/gst/rtp/gstrtpvrawdepay.c index 2b3d7998b..85756bdbd 100644 --- a/gst/rtp/gstrtpvrawdepay.c +++ b/gst/rtp/gstrtpvrawdepay.c @@ -87,8 +87,6 @@ gst_rtp_vraw_depay_class_init (GstRtpVRawDepayClass * klass) gstelement_class = (GstElementClass *) klass; gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gstelement_class->change_state = gst_rtp_vraw_depay_change_state; gstbasertpdepayload_class->set_caps = gst_rtp_vraw_depay_setcaps; diff --git a/gst/rtp/gstrtpvrawpay.c b/gst/rtp/gstrtpvrawpay.c index bc968fbe6..8f919dfd6 100644 --- a/gst/rtp/gstrtpvrawpay.c +++ b/gst/rtp/gstrtpvrawpay.c @@ -111,44 +111,15 @@ GST_STATIC_PAD_TEMPLATE ("src", ) ); -static void gst_rtp_vraw_pay_class_init (GstRtpVRawPayClass * klass); -static void gst_rtp_vraw_pay_base_init (GstRtpVRawPayClass * klass); -static void gst_rtp_vraw_pay_init (GstRtpVRawPay * rtpvrawpay); - static gboolean gst_rtp_vraw_pay_setcaps (GstBaseRTPPayload * payload, GstCaps * caps); static GstFlowReturn gst_rtp_vraw_pay_handle_buffer (GstBaseRTPPayload * payload, GstBuffer * buffer); -static GstBaseRTPPayloadClass *parent_class = NULL; +GST_BOILERPLATE (GstRtpVRawPay, gst_rtp_vraw_pay, GstBaseRTPPayload, + GST_TYPE_BASE_RTP_PAYLOAD) -static GType -gst_rtp_vraw_pay_get_type (void) -{ - static GType rtpvrawpay_type = 0; - - if (!rtpvrawpay_type) { - static const GTypeInfo rtpvrawpay_info = { - sizeof (GstRtpVRawPayClass), - (GBaseInitFunc) gst_rtp_vraw_pay_base_init, - NULL, - (GClassInitFunc) gst_rtp_vraw_pay_class_init, - NULL, - NULL, - sizeof (GstRtpVRawPay), - 0, - (GInstanceInitFunc) gst_rtp_vraw_pay_init, - }; - - rtpvrawpay_type = - g_type_register_static (GST_TYPE_BASE_RTP_PAYLOAD, "GstRtpVRawPay", - &rtpvrawpay_info, 0); - } - return rtpvrawpay_type; -} - -static void -gst_rtp_vraw_pay_base_init (GstRtpVRawPayClass * klass) + static void gst_rtp_vraw_pay_base_init (gpointer klass) { GstElementClass *element_class = GST_ELEMENT_CLASS (klass); @@ -167,8 +138,6 @@ gst_rtp_vraw_pay_class_init (GstRtpVRawPayClass * klass) gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gstbasertppayload_class->set_caps = gst_rtp_vraw_pay_setcaps; gstbasertppayload_class->handle_buffer = gst_rtp_vraw_pay_handle_buffer; @@ -177,7 +146,7 @@ gst_rtp_vraw_pay_class_init (GstRtpVRawPayClass * klass) } static void -gst_rtp_vraw_pay_init (GstRtpVRawPay * rtpvrawpay) +gst_rtp_vraw_pay_init (GstRtpVRawPay * rtpvrawpay, GstRtpVRawPayClass * klass) { } |