From 45e70563554fcfa5197a4c0d0bec14fa036ecc13 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sun, 2 Nov 2003 22:04:36 +0000 Subject: RTP done Original commit message from CVS: RTP done --- gst/rtp/gstrtpL16enc.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'gst/rtp/gstrtpL16enc.c') diff --git a/gst/rtp/gstrtpL16enc.c b/gst/rtp/gstrtpL16enc.c index 47145b97..0ec42a29 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, @@ -107,6 +105,18 @@ static GType gst_rtpL16enc_get_type (void) return rtpL16enc_type; } +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) { @@ -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); } -- cgit