From 45e70563554fcfa5197a4c0d0bec14fa036ecc13 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sun, 2 Nov 2003 22:04:36 +0000 Subject: [PATCH] RTP done Original commit message from CVS: RTP done --- gst/rtp/gstrtp.c | 25 +++++++++++++++++-------- gst/rtp/gstrtpL16depay.c | 35 ++++++++++++++++++----------------- gst/rtp/gstrtpL16depay.h | 2 +- gst/rtp/gstrtpL16enc.c | 35 ++++++++++++++++++----------------- gst/rtp/gstrtpL16enc.h | 2 +- gst/rtp/gstrtpL16parse.c | 35 ++++++++++++++++++----------------- gst/rtp/gstrtpL16parse.h | 2 +- gst/rtp/gstrtpL16pay.c | 35 ++++++++++++++++++----------------- gst/rtp/gstrtpL16pay.h | 2 +- gst/rtp/gstrtpgsmdepay.c | 35 ++++++++++++++++++----------------- gst/rtp/gstrtpgsmdepay.h | 2 +- gst/rtp/gstrtpgsmenc.c | 35 ++++++++++++++++++----------------- gst/rtp/gstrtpgsmenc.h | 2 +- gst/rtp/gstrtpgsmparse.c | 35 ++++++++++++++++++----------------- gst/rtp/gstrtpgsmparse.h | 2 +- gst/rtp/gstrtpgsmpay.c | 35 ++++++++++++++++++----------------- gst/rtp/gstrtpgsmpay.h | 2 +- 17 files changed, 169 insertions(+), 152 deletions(-) diff --git a/gst/rtp/gstrtp.c b/gst/rtp/gstrtp.c index 2cf3315..21f4f08 100644 --- a/gst/rtp/gstrtp.c +++ b/gst/rtp/gstrtp.c @@ -17,25 +17,34 @@ * Boston, MA 02111-1307, USA. */ +#include "config.h" + #include "gstrtpL16enc.h" #include "gstrtpL16parse.h" #include "gstrtpgsmenc.h" #include "gstrtpgsmparse.h" static gboolean -plugin_init (GModule *module, GstPlugin *plugin) +plugin_init (GstPlugin *plugin) { - gst_rtpL16enc_plugin_init (module, plugin); - gst_rtpL16parse_plugin_init (module, plugin); - gst_rtpgsmenc_plugin_init (module, plugin); - gst_rtpgsmparse_plugin_init (module, plugin); + if (!gst_rtpL16enc_plugin_init (plugin) || + !gst_rtpL16parse_plugin_init (plugin) || + !gst_rtpgsmenc_plugin_init (plugin) || + !gst_rtpgsmparse_plugin_init (plugin)) + return FALSE; return TRUE; } -GstPluginDesc plugin_desc = { +GST_PLUGIN_DEFINE ( GST_VERSION_MAJOR, GST_VERSION_MINOR, "rtp", - plugin_init -}; + "Real-time protocol plugins", + plugin_init, + VERSION, + "LGPL", + GST_COPYRIGHT, + GST_PACKAGE, + GST_ORIGIN +) diff --git a/gst/rtp/gstrtpL16depay.c b/gst/rtp/gstrtpL16depay.c index 1623b77..2aa3207 100644 --- a/gst/rtp/gstrtpL16depay.c +++ b/gst/rtp/gstrtpL16depay.c @@ -23,11 +23,8 @@ static GstElementDetails gst_rtp_L16parse_details = { "RTP packet parser", "Codec/Network", - "GPL", "Extracts raw audio from RTP packets", - VERSION, - "Zeeshan Ali ", - "(C) 2003", + "Zeeshan Ali " }; /* RtpL16Parse signals and args */ @@ -70,6 +67,7 @@ GST_PAD_TEMPLATE_FACTORY (sink_factory, ); static void gst_rtpL16parse_class_init (GstRtpL16ParseClass * klass); +static void gst_rtpL16parse_base_init (GstRtpL16ParseClass * klass); static void gst_rtpL16parse_init (GstRtpL16Parse * rtpL16parse); static void gst_rtpL16parse_chain (GstPad * pad, GstData *_data); @@ -89,7 +87,7 @@ static GType gst_rtpL16parse_get_type (void) if (!rtpL16parse_type) { static const GTypeInfo rtpL16parse_info = { sizeof (GstRtpL16ParseClass), - NULL, + (GBaseInitFunc) gst_rtpL16parse_base_init, NULL, (GClassInitFunc) gst_rtpL16parse_class_init, NULL, @@ -105,6 +103,18 @@ static GType gst_rtpL16parse_get_type (void) } static void +gst_rtpL16parse_base_init (GstRtpL16ParseClass * klass) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (src_factory)); + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (sink_factory)); + gst_element_class_set_details (element_class, &gst_rtp_L16parse_details); +} + +static void gst_rtpL16parse_class_init (GstRtpL16ParseClass * klass) { GObjectClass *gobject_class; @@ -322,17 +332,8 @@ gst_rtpL16parse_change_state (GstElement * element) } gboolean -gst_rtpL16parse_plugin_init (GModule * module, GstPlugin * plugin) +gst_rtpL16parse_plugin_init (GstPlugin * plugin) { - GstElementFactory *rtpL16parse; - - rtpL16parse = gst_element_factory_new ("rtpL16parse", GST_TYPE_RTP_L16_PARSE, &gst_rtp_L16parse_details); - g_return_val_if_fail (rtpL16parse != NULL, FALSE); - - gst_element_factory_add_pad_template (rtpL16parse, GST_PAD_TEMPLATE_GET (src_factory)); - gst_element_factory_add_pad_template (rtpL16parse, GST_PAD_TEMPLATE_GET (sink_factory)); - - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (rtpL16parse)); - - return TRUE; + return gst_element_register (plugin, "rtpL16parse", + GST_RANK_NONE, GST_TYPE_RTP_L16_PARSE); } diff --git a/gst/rtp/gstrtpL16depay.h b/gst/rtp/gstrtpL16depay.h index ecaa24f..dad467b 100644 --- a/gst/rtp/gstrtpL16depay.h +++ b/gst/rtp/gstrtpL16depay.h @@ -63,7 +63,7 @@ struct _GstRtpL16ParseClass #define GST_IS_RTP_L16_PARSE_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_L16_PARSE)) -gboolean gst_rtpL16parse_plugin_init (GModule * module, GstPlugin * plugin); +gboolean gst_rtpL16parse_plugin_init (GstPlugin * plugin); #ifdef __cplusplus } diff --git a/gst/rtp/gstrtpL16enc.c b/gst/rtp/gstrtpL16enc.c index 47145b9..0ec42a2 100644 --- a/gst/rtp/gstrtpL16enc.c +++ b/gst/rtp/gstrtpL16enc.c @@ -27,11 +27,8 @@ static GstElementDetails gst_rtpL16enc_details = { "RTP RAW Audio Encoder", "Codec/Network", - "LGPL", "Encodes Raw Audio into an RTP packet", - VERSION, - "Zeeshan Ali ", - "(C) 2003", + "Zeeshan Ali " }; /* RtpL16Enc signals and args */ @@ -74,6 +71,7 @@ GST_PAD_TEMPLATE_FACTORY (src_factory, ); static void gst_rtpL16enc_class_init (GstRtpL16EncClass * klass); +static void gst_rtpL16enc_base_init (GstRtpL16EncClass * klass); static void gst_rtpL16enc_init (GstRtpL16Enc * rtpL16enc); static void gst_rtpL16enc_chain (GstPad * pad, GstData *_data); static void gst_rtpL16enc_set_property (GObject * object, guint prop_id, @@ -92,7 +90,7 @@ static GType gst_rtpL16enc_get_type (void) if (!rtpL16enc_type) { static const GTypeInfo rtpL16enc_info = { sizeof (GstRtpL16EncClass), - NULL, + (GBaseInitFunc) gst_rtpL16enc_base_init, NULL, (GClassInitFunc) gst_rtpL16enc_class_init, NULL, @@ -108,6 +106,18 @@ static GType gst_rtpL16enc_get_type (void) } static void +gst_rtpL16enc_base_init (GstRtpL16EncClass * klass) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (sink_factory)); + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (src_factory)); + gst_element_class_set_details (element_class, &gst_rtpL16enc_details); +} + +static void gst_rtpL16enc_class_init (GstRtpL16EncClass * klass) { GObjectClass *gobject_class; @@ -312,17 +322,8 @@ gst_rtpL16enc_change_state (GstElement * element) } gboolean -gst_rtpL16enc_plugin_init (GModule * module, GstPlugin * plugin) +gst_rtpL16enc_plugin_init (GstPlugin * plugin) { - GstElementFactory *rtpL16enc; - - rtpL16enc = gst_element_factory_new ("rtpL16enc", GST_TYPE_RTP_L16_ENC, &gst_rtpL16enc_details); - g_return_val_if_fail (rtpL16enc != NULL, FALSE); - - gst_element_factory_add_pad_template (rtpL16enc, GST_PAD_TEMPLATE_GET (sink_factory)); - gst_element_factory_add_pad_template (rtpL16enc, GST_PAD_TEMPLATE_GET (src_factory)); - - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (rtpL16enc)); - - return TRUE; + return gst_element_register (plugin, "rtpL16enc", + GST_RANK_NONE, GST_TYPE_RTP_L16_ENC); } diff --git a/gst/rtp/gstrtpL16enc.h b/gst/rtp/gstrtpL16enc.h index c9c6bd6..15ed92f 100644 --- a/gst/rtp/gstrtpL16enc.h +++ b/gst/rtp/gstrtpL16enc.h @@ -70,7 +70,7 @@ struct _GstRtpL16EncClass #define GST_IS_RTP_L16_ENC_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_L16_ENC)) -gboolean gst_rtpL16enc_plugin_init (GModule * module, GstPlugin * plugin); +gboolean gst_rtpL16enc_plugin_init (GstPlugin * plugin); #ifdef __cplusplus } diff --git a/gst/rtp/gstrtpL16parse.c b/gst/rtp/gstrtpL16parse.c index 1623b77..2aa3207 100644 --- a/gst/rtp/gstrtpL16parse.c +++ b/gst/rtp/gstrtpL16parse.c @@ -23,11 +23,8 @@ static GstElementDetails gst_rtp_L16parse_details = { "RTP packet parser", "Codec/Network", - "GPL", "Extracts raw audio from RTP packets", - VERSION, - "Zeeshan Ali ", - "(C) 2003", + "Zeeshan Ali " }; /* RtpL16Parse signals and args */ @@ -70,6 +67,7 @@ GST_PAD_TEMPLATE_FACTORY (sink_factory, ); static void gst_rtpL16parse_class_init (GstRtpL16ParseClass * klass); +static void gst_rtpL16parse_base_init (GstRtpL16ParseClass * klass); static void gst_rtpL16parse_init (GstRtpL16Parse * rtpL16parse); static void gst_rtpL16parse_chain (GstPad * pad, GstData *_data); @@ -89,7 +87,7 @@ static GType gst_rtpL16parse_get_type (void) if (!rtpL16parse_type) { static const GTypeInfo rtpL16parse_info = { sizeof (GstRtpL16ParseClass), - NULL, + (GBaseInitFunc) gst_rtpL16parse_base_init, NULL, (GClassInitFunc) gst_rtpL16parse_class_init, NULL, @@ -105,6 +103,18 @@ static GType gst_rtpL16parse_get_type (void) } static void +gst_rtpL16parse_base_init (GstRtpL16ParseClass * klass) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (src_factory)); + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (sink_factory)); + gst_element_class_set_details (element_class, &gst_rtp_L16parse_details); +} + +static void gst_rtpL16parse_class_init (GstRtpL16ParseClass * klass) { GObjectClass *gobject_class; @@ -322,17 +332,8 @@ gst_rtpL16parse_change_state (GstElement * element) } gboolean -gst_rtpL16parse_plugin_init (GModule * module, GstPlugin * plugin) +gst_rtpL16parse_plugin_init (GstPlugin * plugin) { - GstElementFactory *rtpL16parse; - - rtpL16parse = gst_element_factory_new ("rtpL16parse", GST_TYPE_RTP_L16_PARSE, &gst_rtp_L16parse_details); - g_return_val_if_fail (rtpL16parse != NULL, FALSE); - - gst_element_factory_add_pad_template (rtpL16parse, GST_PAD_TEMPLATE_GET (src_factory)); - gst_element_factory_add_pad_template (rtpL16parse, GST_PAD_TEMPLATE_GET (sink_factory)); - - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (rtpL16parse)); - - return TRUE; + return gst_element_register (plugin, "rtpL16parse", + GST_RANK_NONE, GST_TYPE_RTP_L16_PARSE); } diff --git a/gst/rtp/gstrtpL16parse.h b/gst/rtp/gstrtpL16parse.h index ecaa24f..dad467b 100644 --- a/gst/rtp/gstrtpL16parse.h +++ b/gst/rtp/gstrtpL16parse.h @@ -63,7 +63,7 @@ struct _GstRtpL16ParseClass #define GST_IS_RTP_L16_PARSE_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_L16_PARSE)) -gboolean gst_rtpL16parse_plugin_init (GModule * module, GstPlugin * plugin); +gboolean gst_rtpL16parse_plugin_init (GstPlugin * plugin); #ifdef __cplusplus } diff --git a/gst/rtp/gstrtpL16pay.c b/gst/rtp/gstrtpL16pay.c index 47145b9..0ec42a2 100644 --- a/gst/rtp/gstrtpL16pay.c +++ b/gst/rtp/gstrtpL16pay.c @@ -27,11 +27,8 @@ static GstElementDetails gst_rtpL16enc_details = { "RTP RAW Audio Encoder", "Codec/Network", - "LGPL", "Encodes Raw Audio into an RTP packet", - VERSION, - "Zeeshan Ali ", - "(C) 2003", + "Zeeshan Ali " }; /* RtpL16Enc signals and args */ @@ -74,6 +71,7 @@ GST_PAD_TEMPLATE_FACTORY (src_factory, ); static void gst_rtpL16enc_class_init (GstRtpL16EncClass * klass); +static void gst_rtpL16enc_base_init (GstRtpL16EncClass * klass); static void gst_rtpL16enc_init (GstRtpL16Enc * rtpL16enc); static void gst_rtpL16enc_chain (GstPad * pad, GstData *_data); static void gst_rtpL16enc_set_property (GObject * object, guint prop_id, @@ -92,7 +90,7 @@ static GType gst_rtpL16enc_get_type (void) if (!rtpL16enc_type) { static const GTypeInfo rtpL16enc_info = { sizeof (GstRtpL16EncClass), - NULL, + (GBaseInitFunc) gst_rtpL16enc_base_init, NULL, (GClassInitFunc) gst_rtpL16enc_class_init, NULL, @@ -108,6 +106,18 @@ static GType gst_rtpL16enc_get_type (void) } static void +gst_rtpL16enc_base_init (GstRtpL16EncClass * klass) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (sink_factory)); + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (src_factory)); + gst_element_class_set_details (element_class, &gst_rtpL16enc_details); +} + +static void gst_rtpL16enc_class_init (GstRtpL16EncClass * klass) { GObjectClass *gobject_class; @@ -312,17 +322,8 @@ gst_rtpL16enc_change_state (GstElement * element) } gboolean -gst_rtpL16enc_plugin_init (GModule * module, GstPlugin * plugin) +gst_rtpL16enc_plugin_init (GstPlugin * plugin) { - GstElementFactory *rtpL16enc; - - rtpL16enc = gst_element_factory_new ("rtpL16enc", GST_TYPE_RTP_L16_ENC, &gst_rtpL16enc_details); - g_return_val_if_fail (rtpL16enc != NULL, FALSE); - - gst_element_factory_add_pad_template (rtpL16enc, GST_PAD_TEMPLATE_GET (sink_factory)); - gst_element_factory_add_pad_template (rtpL16enc, GST_PAD_TEMPLATE_GET (src_factory)); - - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (rtpL16enc)); - - return TRUE; + return gst_element_register (plugin, "rtpL16enc", + GST_RANK_NONE, GST_TYPE_RTP_L16_ENC); } diff --git a/gst/rtp/gstrtpL16pay.h b/gst/rtp/gstrtpL16pay.h index c9c6bd6..15ed92f 100644 --- a/gst/rtp/gstrtpL16pay.h +++ b/gst/rtp/gstrtpL16pay.h @@ -70,7 +70,7 @@ struct _GstRtpL16EncClass #define GST_IS_RTP_L16_ENC_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_L16_ENC)) -gboolean gst_rtpL16enc_plugin_init (GModule * module, GstPlugin * plugin); +gboolean gst_rtpL16enc_plugin_init (GstPlugin * plugin); #ifdef __cplusplus } diff --git a/gst/rtp/gstrtpgsmdepay.c b/gst/rtp/gstrtpgsmdepay.c index 4d32f37..ee00941 100644 --- a/gst/rtp/gstrtpgsmdepay.c +++ b/gst/rtp/gstrtpgsmdepay.c @@ -24,11 +24,8 @@ static GstElementDetails gst_rtp_gsmparse_details = { "RTP packet parser", "Codec/Network", - "GPL", "Extracts GSM audio from RTP packets", - VERSION, - "Zeeshan Ali ", - "(C) 2003", + "Zeeshan Ali " }; /* RtpGSMParse signals and args */ @@ -65,6 +62,7 @@ GST_PAD_TEMPLATE_FACTORY (sink_factory, ); static void gst_rtpgsmparse_class_init (GstRtpGSMParseClass * klass); +static void gst_rtpgsmparse_base_init (GstRtpGSMParseClass * klass); static void gst_rtpgsmparse_init (GstRtpGSMParse * rtpgsmparse); static void gst_rtpgsmparse_chain (GstPad * pad, GstData *_data); @@ -84,7 +82,7 @@ static GType gst_rtpgsmparse_get_type (void) if (!rtpgsmparse_type) { static const GTypeInfo rtpgsmparse_info = { sizeof (GstRtpGSMParseClass), - NULL, + (GBaseInitFunc) gst_rtpgsmparse_base_init, NULL, (GClassInitFunc) gst_rtpgsmparse_class_init, NULL, @@ -100,6 +98,18 @@ static GType gst_rtpgsmparse_get_type (void) } static void +gst_rtpgsmparse_base_init (GstRtpGSMParseClass * klass) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (src_factory)); + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (sink_factory)); + gst_element_class_set_details (element_class, &gst_rtp_gsmparse_details); +} + +static void gst_rtpgsmparse_class_init (GstRtpGSMParseClass * klass) { GObjectClass *gobject_class; @@ -284,17 +294,8 @@ gst_rtpgsmparse_change_state (GstElement * element) } gboolean -gst_rtpgsmparse_plugin_init (GModule * module, GstPlugin * plugin) +gst_rtpgsmparse_plugin_init (GstPlugin * plugin) { - GstElementFactory *rtpgsmparse; - - rtpgsmparse = gst_element_factory_new ("rtpgsmparse", GST_TYPE_RTP_GSM_PARSE, &gst_rtp_gsmparse_details); - g_return_val_if_fail (rtpgsmparse != NULL, FALSE); - - gst_element_factory_add_pad_template (rtpgsmparse, GST_PAD_TEMPLATE_GET (src_factory)); - gst_element_factory_add_pad_template (rtpgsmparse, GST_PAD_TEMPLATE_GET (sink_factory)); - - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (rtpgsmparse)); - - return TRUE; + return gst_element_register (plugin, "rtpgsmparse", + GST_RANK_NONE, GST_TYPE_RTP_GSM_PARSE); } diff --git a/gst/rtp/gstrtpgsmdepay.h b/gst/rtp/gstrtpgsmdepay.h index 9d61fb7..0a006e7 100644 --- a/gst/rtp/gstrtpgsmdepay.h +++ b/gst/rtp/gstrtpgsmdepay.h @@ -60,7 +60,7 @@ struct _GstRtpGSMParseClass #define GST_IS_RTP_GSM_PARSE_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_GSM_PARSE)) -gboolean gst_rtpgsmparse_plugin_init (GModule * module, GstPlugin * plugin); +gboolean gst_rtpgsmparse_plugin_init (GstPlugin * plugin); #ifdef __cplusplus } diff --git a/gst/rtp/gstrtpgsmenc.c b/gst/rtp/gstrtpgsmenc.c index eb7a785..47a622b 100644 --- a/gst/rtp/gstrtpgsmenc.c +++ b/gst/rtp/gstrtpgsmenc.c @@ -28,11 +28,8 @@ static GstElementDetails gst_rtpgsmenc_details = { "RTP GSM Audio Encoder", "Codec/Network", - "LGPL", "Encodes GSM audio into an RTP packet", - VERSION, - "Zeeshan Ali ", - "(C) 2003", + "Zeeshan Ali " }; /* RtpGSMEnc signals and args */ @@ -70,6 +67,7 @@ GST_PAD_TEMPLATE_FACTORY (src_factory, ) static void gst_rtpgsmenc_class_init (GstRtpGSMEncClass * klass); +static void gst_rtpgsmenc_base_init (GstRtpGSMEncClass * klass); static void gst_rtpgsmenc_init (GstRtpGSMEnc * rtpgsmenc); static void gst_rtpgsmenc_chain (GstPad * pad, GstData *_data); static void gst_rtpgsmenc_set_property (GObject * object, guint prop_id, @@ -88,7 +86,7 @@ static GType gst_rtpgsmenc_get_type (void) if (!rtpgsmenc_type) { static const GTypeInfo rtpgsmenc_info = { sizeof (GstRtpGSMEncClass), - NULL, + (GBaseInitFunc) gst_rtpgsmenc_base_init, NULL, (GClassInitFunc) gst_rtpgsmenc_class_init, NULL, @@ -104,6 +102,18 @@ static GType gst_rtpgsmenc_get_type (void) } static void +gst_rtpgsmenc_base_init (GstRtpGSMEncClass * klass) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (sink_factory)); + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (src_factory)); + gst_element_class_set_details (element_class, &gst_rtpgsmenc_details); +} + +static void gst_rtpgsmenc_class_init (GstRtpGSMEncClass * klass) { GObjectClass *gobject_class; @@ -299,17 +309,8 @@ gst_rtpgsmenc_change_state (GstElement * element) } gboolean -gst_rtpgsmenc_plugin_init (GModule * module, GstPlugin * plugin) +gst_rtpgsmenc_plugin_init (GstPlugin * plugin) { - GstElementFactory *rtpgsmenc; - - rtpgsmenc = gst_element_factory_new ("rtpgsmenc", GST_TYPE_RTP_GSM_ENC, &gst_rtpgsmenc_details); - g_return_val_if_fail (rtpgsmenc != NULL, FALSE); - - gst_element_factory_add_pad_template (rtpgsmenc, GST_PAD_TEMPLATE_GET (sink_factory)); - gst_element_factory_add_pad_template (rtpgsmenc, GST_PAD_TEMPLATE_GET (src_factory)); - - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (rtpgsmenc)); - - return TRUE; + return gst_element_register (plugin, "rtpgsmenc", + GST_RANK_NONE, GST_TYPE_RTP_GSM_ENC); } diff --git a/gst/rtp/gstrtpgsmenc.h b/gst/rtp/gstrtpgsmenc.h index 76a0ec0..1220d40 100644 --- a/gst/rtp/gstrtpgsmenc.h +++ b/gst/rtp/gstrtpgsmenc.h @@ -69,7 +69,7 @@ struct _GstRtpGSMEncClass #define GST_IS_RTP_GSM_ENC_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_GSM_ENC)) -gboolean gst_rtpgsmenc_plugin_init (GModule * module, GstPlugin * plugin); +gboolean gst_rtpgsmenc_plugin_init (GstPlugin * plugin); #ifdef __cplusplus } diff --git a/gst/rtp/gstrtpgsmparse.c b/gst/rtp/gstrtpgsmparse.c index 4d32f37..ee00941 100644 --- a/gst/rtp/gstrtpgsmparse.c +++ b/gst/rtp/gstrtpgsmparse.c @@ -24,11 +24,8 @@ static GstElementDetails gst_rtp_gsmparse_details = { "RTP packet parser", "Codec/Network", - "GPL", "Extracts GSM audio from RTP packets", - VERSION, - "Zeeshan Ali ", - "(C) 2003", + "Zeeshan Ali " }; /* RtpGSMParse signals and args */ @@ -65,6 +62,7 @@ GST_PAD_TEMPLATE_FACTORY (sink_factory, ); static void gst_rtpgsmparse_class_init (GstRtpGSMParseClass * klass); +static void gst_rtpgsmparse_base_init (GstRtpGSMParseClass * klass); static void gst_rtpgsmparse_init (GstRtpGSMParse * rtpgsmparse); static void gst_rtpgsmparse_chain (GstPad * pad, GstData *_data); @@ -84,7 +82,7 @@ static GType gst_rtpgsmparse_get_type (void) if (!rtpgsmparse_type) { static const GTypeInfo rtpgsmparse_info = { sizeof (GstRtpGSMParseClass), - NULL, + (GBaseInitFunc) gst_rtpgsmparse_base_init, NULL, (GClassInitFunc) gst_rtpgsmparse_class_init, NULL, @@ -100,6 +98,18 @@ static GType gst_rtpgsmparse_get_type (void) } static void +gst_rtpgsmparse_base_init (GstRtpGSMParseClass * klass) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (src_factory)); + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (sink_factory)); + gst_element_class_set_details (element_class, &gst_rtp_gsmparse_details); +} + +static void gst_rtpgsmparse_class_init (GstRtpGSMParseClass * klass) { GObjectClass *gobject_class; @@ -284,17 +294,8 @@ gst_rtpgsmparse_change_state (GstElement * element) } gboolean -gst_rtpgsmparse_plugin_init (GModule * module, GstPlugin * plugin) +gst_rtpgsmparse_plugin_init (GstPlugin * plugin) { - GstElementFactory *rtpgsmparse; - - rtpgsmparse = gst_element_factory_new ("rtpgsmparse", GST_TYPE_RTP_GSM_PARSE, &gst_rtp_gsmparse_details); - g_return_val_if_fail (rtpgsmparse != NULL, FALSE); - - gst_element_factory_add_pad_template (rtpgsmparse, GST_PAD_TEMPLATE_GET (src_factory)); - gst_element_factory_add_pad_template (rtpgsmparse, GST_PAD_TEMPLATE_GET (sink_factory)); - - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (rtpgsmparse)); - - return TRUE; + return gst_element_register (plugin, "rtpgsmparse", + GST_RANK_NONE, GST_TYPE_RTP_GSM_PARSE); } diff --git a/gst/rtp/gstrtpgsmparse.h b/gst/rtp/gstrtpgsmparse.h index 9d61fb7..0a006e7 100644 --- a/gst/rtp/gstrtpgsmparse.h +++ b/gst/rtp/gstrtpgsmparse.h @@ -60,7 +60,7 @@ struct _GstRtpGSMParseClass #define GST_IS_RTP_GSM_PARSE_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_GSM_PARSE)) -gboolean gst_rtpgsmparse_plugin_init (GModule * module, GstPlugin * plugin); +gboolean gst_rtpgsmparse_plugin_init (GstPlugin * plugin); #ifdef __cplusplus } diff --git a/gst/rtp/gstrtpgsmpay.c b/gst/rtp/gstrtpgsmpay.c index eb7a785..47a622b 100644 --- a/gst/rtp/gstrtpgsmpay.c +++ b/gst/rtp/gstrtpgsmpay.c @@ -28,11 +28,8 @@ static GstElementDetails gst_rtpgsmenc_details = { "RTP GSM Audio Encoder", "Codec/Network", - "LGPL", "Encodes GSM audio into an RTP packet", - VERSION, - "Zeeshan Ali ", - "(C) 2003", + "Zeeshan Ali " }; /* RtpGSMEnc signals and args */ @@ -70,6 +67,7 @@ GST_PAD_TEMPLATE_FACTORY (src_factory, ) static void gst_rtpgsmenc_class_init (GstRtpGSMEncClass * klass); +static void gst_rtpgsmenc_base_init (GstRtpGSMEncClass * klass); static void gst_rtpgsmenc_init (GstRtpGSMEnc * rtpgsmenc); static void gst_rtpgsmenc_chain (GstPad * pad, GstData *_data); static void gst_rtpgsmenc_set_property (GObject * object, guint prop_id, @@ -88,7 +86,7 @@ static GType gst_rtpgsmenc_get_type (void) if (!rtpgsmenc_type) { static const GTypeInfo rtpgsmenc_info = { sizeof (GstRtpGSMEncClass), - NULL, + (GBaseInitFunc) gst_rtpgsmenc_base_init, NULL, (GClassInitFunc) gst_rtpgsmenc_class_init, NULL, @@ -104,6 +102,18 @@ static GType gst_rtpgsmenc_get_type (void) } static void +gst_rtpgsmenc_base_init (GstRtpGSMEncClass * klass) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (sink_factory)); + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (src_factory)); + gst_element_class_set_details (element_class, &gst_rtpgsmenc_details); +} + +static void gst_rtpgsmenc_class_init (GstRtpGSMEncClass * klass) { GObjectClass *gobject_class; @@ -299,17 +309,8 @@ gst_rtpgsmenc_change_state (GstElement * element) } gboolean -gst_rtpgsmenc_plugin_init (GModule * module, GstPlugin * plugin) +gst_rtpgsmenc_plugin_init (GstPlugin * plugin) { - GstElementFactory *rtpgsmenc; - - rtpgsmenc = gst_element_factory_new ("rtpgsmenc", GST_TYPE_RTP_GSM_ENC, &gst_rtpgsmenc_details); - g_return_val_if_fail (rtpgsmenc != NULL, FALSE); - - gst_element_factory_add_pad_template (rtpgsmenc, GST_PAD_TEMPLATE_GET (sink_factory)); - gst_element_factory_add_pad_template (rtpgsmenc, GST_PAD_TEMPLATE_GET (src_factory)); - - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (rtpgsmenc)); - - return TRUE; + return gst_element_register (plugin, "rtpgsmenc", + GST_RANK_NONE, GST_TYPE_RTP_GSM_ENC); } diff --git a/gst/rtp/gstrtpgsmpay.h b/gst/rtp/gstrtpgsmpay.h index 76a0ec0..1220d40 100644 --- a/gst/rtp/gstrtpgsmpay.h +++ b/gst/rtp/gstrtpgsmpay.h @@ -69,7 +69,7 @@ struct _GstRtpGSMEncClass #define GST_IS_RTP_GSM_ENC_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_GSM_ENC)) -gboolean gst_rtpgsmenc_plugin_init (GModule * module, GstPlugin * plugin); +gboolean gst_rtpgsmenc_plugin_init (GstPlugin * plugin); #ifdef __cplusplus } -- 2.7.4