rtp: port some more (de)payloaders

This commit is contained in:
Wim Taymans 2011-04-25 13:16:58 +02:00
parent 237ca1631f
commit 60db07b4bb
15 changed files with 240 additions and 300 deletions

View file

@ -47,8 +47,7 @@ GST_STATIC_PAD_TEMPLATE ("sink",
"encoding-name = (string) \"AC3\"")
);
GST_BOILERPLATE (GstRtpAC3Depay, gst_rtp_ac3_depay, GstBaseRTPDepayload,
GST_TYPE_BASE_RTP_DEPAYLOAD);
G_DEFINE_TYPE (GstRtpAC3Depay, gst_rtp_ac3_depay, GST_TYPE_BASE_RTP_DEPAYLOAD);
static gboolean gst_rtp_ac3_depay_setcaps (GstBaseRTPDepayload * depayload,
GstCaps * caps);
@ -56,27 +55,23 @@ static GstBuffer *gst_rtp_ac3_depay_process (GstBaseRTPDepayload * depayload,
GstBuffer * buf);
static void
gst_rtp_ac3_depay_base_init (gpointer klass)
gst_rtp_ac3_depay_class_init (GstRtpAC3DepayClass * klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
GstElementClass *gstelement_class;
GstBaseRTPDepayloadClass *gstbasertpdepayload_class;
gst_element_class_add_pad_template (element_class,
gstelement_class = (GstElementClass *) klass;
gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass;
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_ac3_depay_src_template));
gst_element_class_add_pad_template (element_class,
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_ac3_depay_sink_template));
gst_element_class_set_details_simple (element_class, "RTP AC3 depayloader",
gst_element_class_set_details_simple (gstelement_class, "RTP AC3 depayloader",
"Codec/Depayloader/Network/RTP",
"Extracts AC3 audio from RTP packets (RFC 4184)",
"Wim Taymans <wim.taymans@gmail.com>");
}
static void
gst_rtp_ac3_depay_class_init (GstRtpAC3DepayClass * klass)
{
GstBaseRTPDepayloadClass *gstbasertpdepayload_class;
gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass;
gstbasertpdepayload_class->set_caps = gst_rtp_ac3_depay_setcaps;
gstbasertpdepayload_class->process = gst_rtp_ac3_depay_process;
@ -86,10 +81,9 @@ gst_rtp_ac3_depay_class_init (GstRtpAC3DepayClass * klass)
}
static void
gst_rtp_ac3_depay_init (GstRtpAC3Depay * rtpac3depay,
GstRtpAC3DepayClass * klass)
gst_rtp_ac3_depay_init (GstRtpAC3Depay * rtpac3depay)
{
/* needed because of GST_BOILERPLATE */
/* needed because of G_DEFINE_TYPE */
}
static gboolean

View file

@ -60,23 +60,8 @@ static GstFlowReturn gst_rtp_ac3_pay_flush (GstRtpAC3Pay * rtpac3pay);
static GstFlowReturn gst_rtp_ac3_pay_handle_buffer (GstBaseRTPPayload * payload,
GstBuffer * buffer);
GST_BOILERPLATE (GstRtpAC3Pay, gst_rtp_ac3_pay, GstBaseRTPPayload,
GST_TYPE_BASE_RTP_PAYLOAD)
static void gst_rtp_ac3_pay_base_init (gpointer klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_ac3_pay_src_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_ac3_pay_sink_template));
gst_element_class_set_details_simple (element_class,
"RTP AC3 audio payloader", "Codec/Payloader/Network/RTP",
"Payload AC3 audio as RTP packets (RFC 4184)",
"Wim Taymans <wim.taymans@gmail.com>");
}
#define gst_rtp_ac3_pay_parent_class parent_class
G_DEFINE_TYPE (GstRtpAC3Pay, gst_rtp_ac3_pay, GST_TYPE_BASE_RTP_PAYLOAD);
static void
gst_rtp_ac3_pay_class_init (GstRtpAC3PayClass * klass)
@ -85,6 +70,9 @@ gst_rtp_ac3_pay_class_init (GstRtpAC3PayClass * klass)
GstElementClass *gstelement_class;
GstBaseRTPPayloadClass *gstbasertppayload_class;
GST_DEBUG_CATEGORY_INIT (rtpac3pay_debug, "rtpac3pay", 0,
"AC3 Audio RTP Depayloader");
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass;
@ -93,16 +81,23 @@ gst_rtp_ac3_pay_class_init (GstRtpAC3PayClass * klass)
gstelement_class->change_state = gst_rtp_ac3_pay_change_state;
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_ac3_pay_src_template));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_ac3_pay_sink_template));
gst_element_class_set_details_simple (gstelement_class,
"RTP AC3 audio payloader", "Codec/Payloader/Network/RTP",
"Payload AC3 audio as RTP packets (RFC 4184)",
"Wim Taymans <wim.taymans@gmail.com>");
gstbasertppayload_class->set_caps = gst_rtp_ac3_pay_setcaps;
gstbasertppayload_class->handle_event = gst_rtp_ac3_pay_handle_event;
gstbasertppayload_class->handle_buffer = gst_rtp_ac3_pay_handle_buffer;
GST_DEBUG_CATEGORY_INIT (rtpac3pay_debug, "rtpac3pay", 0,
"AC3 Audio RTP Depayloader");
}
static void
gst_rtp_ac3_pay_init (GstRtpAC3Pay * rtpac3pay, GstRtpAC3PayClass * klass)
gst_rtp_ac3_pay_init (GstRtpAC3Pay * rtpac3pay)
{
rtpac3pay->adapter = gst_adapter_new ();
}

View file

@ -54,37 +54,34 @@ static GstBuffer *gst_rtp_bv_depay_process (GstBaseRTPDepayload * depayload,
static gboolean gst_rtp_bv_depay_setcaps (GstBaseRTPDepayload * depayload,
GstCaps * caps);
GST_BOILERPLATE (GstRTPBVDepay, gst_rtp_bv_depay, GstBaseRTPDepayload,
GST_TYPE_BASE_RTP_DEPAYLOAD);
static void
gst_rtp_bv_depay_base_init (gpointer klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_bv_depay_src_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_bv_depay_sink_template));
gst_element_class_set_details_simple (element_class,
"RTP BroadcomVoice depayloader", "Codec/Depayloader/Network/RTP",
"Extracts BroadcomVoice audio from RTP packets (RFC 4298)",
"Wim Taymans <wim.taymans@collabora.co.uk>");
}
#define gst_rtp_bv_depay_parent_class parent_class
G_DEFINE_TYPE (GstRTPBVDepay, gst_rtp_bv_depay, GST_TYPE_BASE_RTP_DEPAYLOAD);
static void
gst_rtp_bv_depay_class_init (GstRTPBVDepayClass * klass)
{
GstElementClass *gstelement_class;
GstBaseRTPDepayloadClass *gstbasertpdepayload_class;
gstelement_class = (GstElementClass *) klass;
gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass;
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_bv_depay_src_template));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_bv_depay_sink_template));
gst_element_class_set_details_simple (gstelement_class,
"RTP BroadcomVoice depayloader", "Codec/Depayloader/Network/RTP",
"Extracts BroadcomVoice audio from RTP packets (RFC 4298)",
"Wim Taymans <wim.taymans@collabora.co.uk>");
gstbasertpdepayload_class->process = gst_rtp_bv_depay_process;
gstbasertpdepayload_class->set_caps = gst_rtp_bv_depay_setcaps;
}
static void
gst_rtp_bv_depay_init (GstRTPBVDepay * rtpbvdepay, GstRTPBVDepayClass * klass)
gst_rtp_bv_depay_init (GstRTPBVDepay * rtpbvdepay)
{
rtpbvdepay->mode = -1;
}

View file

@ -58,40 +58,37 @@ static GstCaps *gst_rtp_bv_pay_sink_getcaps (GstBaseRTPPayload * payload,
static gboolean gst_rtp_bv_pay_sink_setcaps (GstBaseRTPPayload * payload,
GstCaps * caps);
GST_BOILERPLATE (GstRTPBVPay, gst_rtp_bv_pay, GstBaseRTPAudioPayload,
GST_TYPE_BASE_RTP_AUDIO_PAYLOAD);
static void
gst_rtp_bv_pay_base_init (gpointer klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_bv_pay_sink_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_bv_pay_src_template));
gst_element_class_set_details_simple (element_class, "RTP BV Payloader",
"Codec/Payloader/Network/RTP",
"Packetize BroadcomVoice audio streams into RTP packets (RFC 4298)",
"Wim Taymans <wim.taymans@collabora.co.uk>");
}
#define gst_rtp_bv_pay_parent_class parent_class
G_DEFINE_TYPE (GstRTPBVPay, gst_rtp_bv_pay, GST_TYPE_BASE_RTP_AUDIO_PAYLOAD);
static void
gst_rtp_bv_pay_class_init (GstRTPBVPayClass * klass)
{
GstElementClass *gstelement_class;
GstBaseRTPPayloadClass *gstbasertppayload_class;
gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass;
gstbasertppayload_class->set_caps = gst_rtp_bv_pay_sink_setcaps;
gstbasertppayload_class->get_caps = gst_rtp_bv_pay_sink_getcaps;
GST_DEBUG_CATEGORY_INIT (rtpbvpay_debug, "rtpbvpay", 0,
"BroadcomVoice audio RTP payloader");
gstelement_class = (GstElementClass *) klass;
gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass;
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_bv_pay_sink_template));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_bv_pay_src_template));
gst_element_class_set_details_simple (gstelement_class, "RTP BV Payloader",
"Codec/Payloader/Network/RTP",
"Packetize BroadcomVoice audio streams into RTP packets (RFC 4298)",
"Wim Taymans <wim.taymans@collabora.co.uk>");
gstbasertppayload_class->set_caps = gst_rtp_bv_pay_sink_setcaps;
gstbasertppayload_class->get_caps = gst_rtp_bv_pay_sink_getcaps;
}
static void
gst_rtp_bv_pay_init (GstRTPBVPay * rtpbvpay, GstRTPBVPayClass * klass)
gst_rtp_bv_pay_init (GstRTPBVPay * rtpbvpay)
{
GstBaseRTPAudioPayload *basertpaudiopayload;

View file

@ -70,41 +70,38 @@ static GstBuffer *gst_rtp_celt_depay_process (GstBaseRTPDepayload * depayload,
static gboolean gst_rtp_celt_depay_setcaps (GstBaseRTPDepayload * depayload,
GstCaps * caps);
GST_BOILERPLATE (GstRtpCELTDepay, gst_rtp_celt_depay, GstBaseRTPDepayload,
#define gst_rtp_celt_depay_parent_class parent_class
G_DEFINE_TYPE (GstRtpCELTDepay, gst_rtp_celt_depay,
GST_TYPE_BASE_RTP_DEPAYLOAD);
static void
gst_rtp_celt_depay_base_init (gpointer klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_celt_depay_src_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_celt_depay_sink_template));
gst_element_class_set_details_simple (element_class, "RTP CELT depayloader",
"Codec/Depayloader/Network/RTP",
"Extracts CELT audio from RTP packets",
"Wim Taymans <wim.taymans@gmail.com>");
GST_DEBUG_CATEGORY_INIT (rtpceltdepay_debug, "rtpceltdepay", 0,
"CELT RTP Depayloader");
}
static void
gst_rtp_celt_depay_class_init (GstRtpCELTDepayClass * klass)
{
GstElementClass *gstelement_class;
GstBaseRTPDepayloadClass *gstbasertpdepayload_class;
GST_DEBUG_CATEGORY_INIT (rtpceltdepay_debug, "rtpceltdepay", 0,
"CELT RTP Depayloader");
gstelement_class = (GstElementClass *) klass;
gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass;
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_celt_depay_src_template));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_celt_depay_sink_template));
gst_element_class_set_details_simple (gstelement_class,
"RTP CELT depayloader", "Codec/Depayloader/Network/RTP",
"Extracts CELT audio from RTP packets",
"Wim Taymans <wim.taymans@gmail.com>");
gstbasertpdepayload_class->process = gst_rtp_celt_depay_process;
gstbasertpdepayload_class->set_caps = gst_rtp_celt_depay_setcaps;
}
static void
gst_rtp_celt_depay_init (GstRtpCELTDepay * rtpceltdepay,
GstRtpCELTDepayClass * klass)
gst_rtp_celt_depay_init (GstRtpCELTDepay * rtpceltdepay)
{
}

View file

@ -62,26 +62,8 @@ static GstCaps *gst_rtp_celt_pay_getcaps (GstBaseRTPPayload * payload,
static GstFlowReturn gst_rtp_celt_pay_handle_buffer (GstBaseRTPPayload *
payload, GstBuffer * buffer);
GST_BOILERPLATE (GstRtpCELTPay, gst_rtp_celt_pay, GstBaseRTPPayload,
GST_TYPE_BASE_RTP_PAYLOAD);
static void
gst_rtp_celt_pay_base_init (gpointer klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_celt_pay_sink_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_celt_pay_src_template));
gst_element_class_set_details_simple (element_class, "RTP CELT payloader",
"Codec/Payloader/Network/RTP",
"Payload-encodes CELT audio into a RTP packet",
"Wim Taymans <wim.taymans@gmail.com>");
GST_DEBUG_CATEGORY_INIT (rtpceltpay_debug, "rtpceltpay", 0,
"CELT RTP Payloader");
}
#define gst_rtp_celt_pay_parent_class parent_class
G_DEFINE_TYPE (GstRtpCELTPay, gst_rtp_celt_pay, GST_TYPE_BASE_RTP_PAYLOAD);
static void
gst_rtp_celt_pay_class_init (GstRtpCELTPayClass * klass)
@ -90,6 +72,9 @@ gst_rtp_celt_pay_class_init (GstRtpCELTPayClass * klass)
GstElementClass *gstelement_class;
GstBaseRTPPayloadClass *gstbasertppayload_class;
GST_DEBUG_CATEGORY_INIT (rtpceltpay_debug, "rtpceltpay", 0,
"CELT RTP Payloader");
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass;
@ -98,13 +83,23 @@ gst_rtp_celt_pay_class_init (GstRtpCELTPayClass * klass)
gstelement_class->change_state = gst_rtp_celt_pay_change_state;
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_celt_pay_sink_template));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_celt_pay_src_template));
gst_element_class_set_details_simple (gstelement_class, "RTP CELT payloader",
"Codec/Payloader/Network/RTP",
"Payload-encodes CELT audio into a RTP packet",
"Wim Taymans <wim.taymans@gmail.com>");
gstbasertppayload_class->set_caps = gst_rtp_celt_pay_setcaps;
gstbasertppayload_class->get_caps = gst_rtp_celt_pay_getcaps;
gstbasertppayload_class->handle_buffer = gst_rtp_celt_pay_handle_buffer;
}
static void
gst_rtp_celt_pay_init (GstRtpCELTPay * rtpceltpay, GstRtpCELTPayClass * klass)
gst_rtp_celt_pay_init (GstRtpCELTPay * rtpceltpay)
{
rtpceltpay->queue = g_queue_new ();
}

View file

@ -56,13 +56,15 @@ static GstFlowReturn gst_rtp_depay_chain_rtp (GstPad * pad, GstBuffer * buffer);
static GstFlowReturn gst_rtp_depay_chain_rtcp (GstPad * pad,
GstBuffer * buffer);
GST_BOILERPLATE (GstRTPDepay, gst_rtp_depay, GstElement, GST_TYPE_ELEMENT);
G_DEFINE_TYPE (GstRTPDepay, gst_rtp_depay, GST_TYPE_ELEMENT);
static void
gst_rtp_depay_base_init (gpointer klass)
gst_rtp_depay_class_init (GstRTPDepayClass * klass)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
GST_DEBUG_CATEGORY_INIT (rtpdepay_debug, "rtpdepay", 0, "RTP decoder");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_depay_src_rtp_template));
gst_element_class_add_pad_template (gstelement_class,
@ -71,6 +73,7 @@ gst_rtp_depay_base_init (gpointer klass)
gst_static_pad_template_get (&gst_rtp_depay_sink_rtp_template));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_depay_sink_rtcp_template));
gst_element_class_set_details_simple (gstelement_class,
"Dummy RTP session manager", "Codec/Depayloader/Network/RTP",
"Accepts raw RTP and RTCP packets and sends them forward",
@ -78,13 +81,7 @@ gst_rtp_depay_base_init (gpointer 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, GstRTPDepayClass * klass)
gst_rtp_depay_init (GstRTPDepay * rtpdepay)
{
/* the input rtp pad */
rtpdepay->sink_rtp =

View file

@ -80,25 +80,10 @@ static GstBuffer *gst_rtp_dv_depay_process (GstBaseRTPDepayload * base,
static gboolean gst_rtp_dv_depay_setcaps (GstBaseRTPDepayload * depayload,
GstCaps * caps);
GST_BOILERPLATE (GstRTPDVDepay, gst_rtp_dv_depay, GstBaseRTPDepayload,
GST_TYPE_BASE_RTP_DEPAYLOAD)
#define gst_rtp_dv_depay_parent_class parent_class
G_DEFINE_TYPE (GstRTPDVDepay, gst_rtp_dv_depay, GST_TYPE_BASE_RTP_DEPAYLOAD);
static void gst_rtp_dv_depay_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&src_factory));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&sink_factory));
gst_element_class_set_details_simple (element_class, "RTP DV Depayloader",
"Codec/Depayloader/Network/RTP",
"Depayloads DV from RTP packets (RFC 3189)",
"Marcel Moreaux <marcelm@spacelabs.nl>, Wim Taymans <wim.taymans@gmail.com>");
}
/* initialize the plugin's class */
static void
gst_rtp_dv_depay_class_init (GstRTPDVDepayClass * klass)
{
@ -106,16 +91,26 @@ gst_rtp_dv_depay_class_init (GstRTPDVDepayClass * klass)
GstBaseRTPDepayloadClass *gstbasertpdepayload_class =
(GstBaseRTPDepayloadClass *) klass;
GST_DEBUG_CATEGORY_INIT (rtpdvdepay_debug, "rtpdvdepay", 0,
"DV RTP Depayloader");
gstelement_class->change_state =
GST_DEBUG_FUNCPTR (gst_rtp_dv_depay_change_state);
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&src_factory));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sink_factory));
gst_element_class_set_details_simple (gstelement_class, "RTP DV Depayloader",
"Codec/Depayloader/Network/RTP",
"Depayloads DV from RTP packets (RFC 3189)",
"Marcel Moreaux <marcelm@spacelabs.nl>, Wim Taymans <wim.taymans@gmail.com>");
gstbasertpdepayload_class->process =
GST_DEBUG_FUNCPTR (gst_rtp_dv_depay_process);
gstbasertpdepayload_class->set_caps =
GST_DEBUG_FUNCPTR (gst_rtp_dv_depay_setcaps);
GST_DEBUG_CATEGORY_INIT (rtpdvdepay_debug, "rtpdvdepay", 0,
"DV RTP Depayloader");
}
/* initialize the new element
@ -124,7 +119,7 @@ gst_rtp_dv_depay_class_init (GstRTPDVDepayClass * klass)
* initialize structure
*/
static void
gst_rtp_dv_depay_init (GstRTPDVDepay * filter, GstRTPDVDepayClass * klass)
gst_rtp_dv_depay_init (GstRTPDVDepay * filter)
{
}

View file

@ -94,49 +94,47 @@ static void gst_dv_pay_set_property (GObject * object,
static void gst_dv_pay_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec);
GST_BOILERPLATE (GstRTPDVPay, gst_rtp_dv_pay, GstBaseRTPPayload,
GST_TYPE_BASE_RTP_PAYLOAD)
static void gst_rtp_dv_pay_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_dv_pay_sink_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_dv_pay_src_template));
gst_element_class_set_details_simple (element_class, "RTP DV Payloader",
"Codec/Payloader/Network/RTP",
"Payloads DV into RTP packets (RFC 3189)",
"Marcel Moreaux <marcelm@spacelabs.nl>, Wim Taymans <wim.taymans@gmail.com>");
}
#define gst_rtp_dv_pay_parent_class parent_class
G_DEFINE_TYPE (GstRTPDVPay, gst_rtp_dv_pay, GST_TYPE_BASE_RTP_PAYLOAD);
static void
gst_rtp_dv_pay_class_init (GstRTPDVPayClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
GstBaseRTPPayloadClass *gstbasertppayload_class;
GST_DEBUG_CATEGORY_INIT (rtpdvpay_debug, "rtpdvpay", 0, "DV RTP Payloader");
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass;
gobject_class->set_property = gst_dv_pay_set_property;
gobject_class->get_property = gst_dv_pay_get_property;
gstbasertppayload_class->set_caps = gst_rtp_dv_pay_setcaps;
gstbasertppayload_class->handle_buffer = gst_rtp_dv_pay_handle_buffer;
g_object_class_install_property (gobject_class, PROP_MODE,
g_param_spec_enum ("mode", "Mode",
"The payload mode of payloading",
GST_TYPE_DV_PAY_MODE, DEFAULT_MODE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
GST_DEBUG_CATEGORY_INIT (rtpdvpay_debug, "rtpdvpay", 0, "DV RTP Payloader");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_dv_pay_sink_template));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_dv_pay_src_template));
gst_element_class_set_details_simple (gstelement_class, "RTP DV Payloader",
"Codec/Payloader/Network/RTP",
"Payloads DV into RTP packets (RFC 3189)",
"Marcel Moreaux <marcelm@spacelabs.nl>, Wim Taymans <wim.taymans@gmail.com>");
gstbasertppayload_class->set_caps = gst_rtp_dv_pay_setcaps;
gstbasertppayload_class->handle_buffer = gst_rtp_dv_pay_handle_buffer;
}
static void
gst_rtp_dv_pay_init (GstRTPDVPay * rtpdvpay, GstRTPDVPayClass * klass)
gst_rtp_dv_pay_init (GstRTPDVPay * rtpdvpay)
{
}

View file

@ -45,8 +45,8 @@ GST_STATIC_PAD_TEMPLATE ("sink",
"clock-rate = (int) 90000, " "encoding-name = (string) \"X-GST\"")
);
GST_BOILERPLATE (GstRtpGSTDepay, gst_rtp_gst_depay, GstBaseRTPDepayload,
GST_TYPE_BASE_RTP_DEPAYLOAD);
#define gst_rtp_gst_depay_parent_class parent_class
G_DEFINE_TYPE (GstRtpGSTDepay, gst_rtp_gst_depay, GST_TYPE_BASE_RTP_DEPAYLOAD);
static void gst_rtp_gst_depay_finalize (GObject * object);
@ -59,22 +59,6 @@ static gboolean gst_rtp_gst_depay_setcaps (GstBaseRTPDepayload * depayload,
static GstBuffer *gst_rtp_gst_depay_process (GstBaseRTPDepayload * depayload,
GstBuffer * buf);
static void
gst_rtp_gst_depay_base_init (gpointer klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_gst_depay_src_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_gst_depay_sink_template));
gst_element_class_set_details_simple (element_class,
"GStreamer depayloader", "Codec/Depayloader/Network",
"Extracts GStreamer buffers from RTP packets",
"Wim Taymans <wim.taymans@gmail.com>");
}
static void
gst_rtp_gst_depay_class_init (GstRtpGSTDepayClass * klass)
{
@ -82,6 +66,9 @@ gst_rtp_gst_depay_class_init (GstRtpGSTDepayClass * klass)
GstElementClass *gstelement_class;
GstBaseRTPDepayloadClass *gstbasertpdepayload_class;
GST_DEBUG_CATEGORY_INIT (rtpgstdepay_debug, "rtpgstdepay", 0,
"Gstreamer RTP Depayloader");
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass;
@ -90,16 +77,22 @@ gst_rtp_gst_depay_class_init (GstRtpGSTDepayClass * klass)
gstelement_class->change_state = gst_rtp_gst_depay_change_state;
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_gst_depay_src_template));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_gst_depay_sink_template));
gst_element_class_set_details_simple (gstelement_class,
"GStreamer depayloader", "Codec/Depayloader/Network",
"Extracts GStreamer buffers from RTP packets",
"Wim Taymans <wim.taymans@gmail.com>");
gstbasertpdepayload_class->set_caps = gst_rtp_gst_depay_setcaps;
gstbasertpdepayload_class->process = gst_rtp_gst_depay_process;
GST_DEBUG_CATEGORY_INIT (rtpgstdepay_debug, "rtpgstdepay", 0,
"Gstreamer RTP Depayloader");
}
static void
gst_rtp_gst_depay_init (GstRtpGSTDepay * rtpgstdepay,
GstRtpGSTDepayClass * klass)
gst_rtp_gst_depay_init (GstRtpGSTDepay * rtpgstdepay)
{
rtpgstdepay->adapter = gst_adapter_new ();
}

View file

@ -73,37 +73,34 @@ static gboolean gst_rtp_gst_pay_setcaps (GstBaseRTPPayload * payload,
static GstFlowReturn gst_rtp_gst_pay_handle_buffer (GstBaseRTPPayload * payload,
GstBuffer * buffer);
GST_BOILERPLATE (GstRtpGSTPay, gst_rtp_gst_pay, GstBaseRTPPayload,
GST_TYPE_BASE_RTP_PAYLOAD)
static void gst_rtp_gst_pay_base_init (gpointer klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_gst_pay_src_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_gst_pay_sink_template));
gst_element_class_set_details_simple (element_class,
"RTP GStreamer payloader", "Codec/Payloader/Network/RTP",
"Payload GStreamer buffers as RTP packets",
"Wim Taymans <wim.taymans@gmail.com>");
}
#define gst_rtp_gst_pay_parent_class parent_class
G_DEFINE_TYPE (GstRtpGSTPay, gst_rtp_gst_pay, GST_TYPE_BASE_RTP_PAYLOAD);
static void
gst_rtp_gst_pay_class_init (GstRtpGSTPayClass * klass)
{
GstElementClass *gstelement_class;
GstBaseRTPPayloadClass *gstbasertppayload_class;
gstelement_class = (GstElementClass *) klass;
gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass;
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_gst_pay_src_template));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_gst_pay_sink_template));
gst_element_class_set_details_simple (gstelement_class,
"RTP GStreamer payloader", "Codec/Payloader/Network/RTP",
"Payload GStreamer buffers as RTP packets",
"Wim Taymans <wim.taymans@gmail.com>");
gstbasertppayload_class->set_caps = gst_rtp_gst_pay_setcaps;
gstbasertppayload_class->handle_buffer = gst_rtp_gst_pay_handle_buffer;
}
static void
gst_rtp_gst_pay_init (GstRtpGSTPay * rtpgstpay, GstRtpGSTPayClass * klass)
gst_rtp_gst_pay_init (GstRtpGSTPay * rtpgstpay)
{
}

View file

@ -71,7 +71,8 @@ static GstBuffer *gst_rtp_ilbc_depay_process (GstBaseRTPDepayload * depayload,
static gboolean gst_rtp_ilbc_depay_setcaps (GstBaseRTPDepayload * depayload,
GstCaps * caps);
GST_BOILERPLATE (GstRTPiLBCDepay, gst_rtp_ilbc_depay, GstBaseRTPDepayload,
#define gst_rtp_ilbc_depay_parent_class parent_class
G_DEFINE_TYPE (GstRTPiLBCDepay, gst_rtp_ilbc_depay,
GST_TYPE_BASE_RTP_DEPAYLOAD);
#define GST_TYPE_ILBC_MODE (gst_ilbc_mode_get_type())
@ -91,28 +92,15 @@ gst_ilbc_mode_get_type (void)
return ilbc_mode_type;
}
static void
gst_rtp_ilbc_depay_base_init (gpointer klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_ilbc_depay_src_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_ilbc_depay_sink_template));
gst_element_class_set_details_simple (element_class, "RTP iLBC depayloader",
"Codec/Depayloader/Network/RTP",
"Extracts iLBC audio from RTP packets (RFC 3952)",
"Philippe Kalaf <philippe.kalaf@collabora.co.uk>");
}
static void
gst_rtp_ilbc_depay_class_init (GstRTPiLBCDepayClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
GstBaseRTPDepayloadClass *gstbasertpdepayload_class;
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass;
gobject_class->set_property = gst_ilbc_depay_set_property;
@ -124,13 +112,22 @@ gst_rtp_ilbc_depay_class_init (GstRTPiLBCDepayClass * klass)
GST_TYPE_ILBC_MODE, DEFAULT_MODE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_ilbc_depay_src_template));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_ilbc_depay_sink_template));
gst_element_class_set_details_simple (gstelement_class,
"RTP iLBC depayloader", "Codec/Depayloader/Network/RTP",
"Extracts iLBC audio from RTP packets (RFC 3952)",
"Philippe Kalaf <philippe.kalaf@collabora.co.uk>");
gstbasertpdepayload_class->process = gst_rtp_ilbc_depay_process;
gstbasertpdepayload_class->set_caps = gst_rtp_ilbc_depay_setcaps;
}
static void
gst_rtp_ilbc_depay_init (GstRTPiLBCDepay * rtpilbcdepay,
GstRTPiLBCDepayClass * klass)
gst_rtp_ilbc_depay_init (GstRTPiLBCDepay * rtpilbcdepay)
{
/* Set default mode */
rtpilbcdepay->mode = DEFAULT_MODE;

View file

@ -53,40 +53,38 @@ static GstCaps *gst_rtp_ilbc_pay_sink_getcaps (GstBaseRTPPayload * payload,
static gboolean gst_rtp_ilbc_pay_sink_setcaps (GstBaseRTPPayload * payload,
GstCaps * caps);
GST_BOILERPLATE (GstRTPILBCPay, gst_rtp_ilbc_pay, GstBaseRTPAudioPayload,
#define gst_rtp_ilbc_pay_parent_class parent_class
G_DEFINE_TYPE (GstRTPILBCPay, gst_rtp_ilbc_pay,
GST_TYPE_BASE_RTP_AUDIO_PAYLOAD);
static void
gst_rtp_ilbc_pay_base_init (gpointer klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_ilbc_pay_sink_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_ilbc_pay_src_template));
gst_element_class_set_details_simple (element_class, "RTP iLBC Payloader",
"Codec/Payloader/Network/RTP",
"Packetize iLBC audio streams into RTP packets",
"Philippe Kalaf <philippe.kalaf@collabora.co.uk>");
}
static void
gst_rtp_ilbc_pay_class_init (GstRTPILBCPayClass * klass)
{
GstElementClass *gstelement_class;
GstBaseRTPPayloadClass *gstbasertppayload_class;
gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass;
gstbasertppayload_class->set_caps = gst_rtp_ilbc_pay_sink_setcaps;
gstbasertppayload_class->get_caps = gst_rtp_ilbc_pay_sink_getcaps;
GST_DEBUG_CATEGORY_INIT (rtpilbcpay_debug, "rtpilbcpay", 0,
"iLBC audio RTP payloader");
gstelement_class = (GstElementClass *) klass;
gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass;
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_ilbc_pay_sink_template));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_ilbc_pay_src_template));
gst_element_class_set_details_simple (gstelement_class, "RTP iLBC Payloader",
"Codec/Payloader/Network/RTP",
"Packetize iLBC audio streams into RTP packets",
"Philippe Kalaf <philippe.kalaf@collabora.co.uk>");
gstbasertppayload_class->set_caps = gst_rtp_ilbc_pay_sink_setcaps;
gstbasertppayload_class->get_caps = gst_rtp_ilbc_pay_sink_getcaps;
}
static void
gst_rtp_ilbc_pay_init (GstRTPILBCPay * rtpilbcpay, GstRTPILBCPayClass * klass)
gst_rtp_ilbc_pay_init (GstRTPILBCPay * rtpilbcpay)
{
GstBaseRTPPayload *basertppayload;
GstBaseRTPAudioPayload *basertpaudiopayload;

View file

@ -50,47 +50,42 @@ static GstStaticPadTemplate gst_rtp_mpa_depay_sink_template =
"clock-rate = (int) 90000")
);
GST_BOILERPLATE (GstRtpMPADepay, gst_rtp_mpa_depay, GstBaseRTPDepayload,
GST_TYPE_BASE_RTP_DEPAYLOAD);
#define gst_rtp_mpa_depay_parent_class parent_class
G_DEFINE_TYPE (GstRtpMPADepay, gst_rtp_mpa_depay, GST_TYPE_BASE_RTP_DEPAYLOAD);
static gboolean gst_rtp_mpa_depay_setcaps (GstBaseRTPDepayload * depayload,
GstCaps * caps);
static GstBuffer *gst_rtp_mpa_depay_process (GstBaseRTPDepayload * depayload,
GstBuffer * buf);
static void
gst_rtp_mpa_depay_base_init (gpointer klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_mpa_depay_src_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_mpa_depay_sink_template));
gst_element_class_set_details_simple (element_class,
"RTP MPEG audio depayloader", "Codec/Depayloader/Network/RTP",
"Extracts MPEG audio from RTP packets (RFC 2038)",
"Wim Taymans <wim.taymans@gmail.com>");
}
static void
gst_rtp_mpa_depay_class_init (GstRtpMPADepayClass * klass)
{
GstElementClass *gstelement_class;
GstBaseRTPDepayloadClass *gstbasertpdepayload_class;
gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass;
gstbasertpdepayload_class->set_caps = gst_rtp_mpa_depay_setcaps;
gstbasertpdepayload_class->process = gst_rtp_mpa_depay_process;
GST_DEBUG_CATEGORY_INIT (rtpmpadepay_debug, "rtpmpadepay", 0,
"MPEG Audio RTP Depayloader");
gstelement_class = (GstElementClass *) klass;
gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass;
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_mpa_depay_src_template));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_mpa_depay_sink_template));
gst_element_class_set_details_simple (gstelement_class,
"RTP MPEG audio depayloader", "Codec/Depayloader/Network/RTP",
"Extracts MPEG audio from RTP packets (RFC 2038)",
"Wim Taymans <wim.taymans@gmail.com>");
gstbasertpdepayload_class->set_caps = gst_rtp_mpa_depay_setcaps;
gstbasertpdepayload_class->process = gst_rtp_mpa_depay_process;
}
static void
gst_rtp_mpa_depay_init (GstRtpMPADepay * rtpmpadepay,
GstRtpMPADepayClass * klass)
gst_rtp_mpa_depay_init (GstRtpMPADepay * rtpmpadepay)
{
/* needed because of GST_BOILERPLATE */
}

View file

@ -63,23 +63,8 @@ static GstFlowReturn gst_rtp_mpa_pay_flush (GstRtpMPAPay * rtpmpapay);
static GstFlowReturn gst_rtp_mpa_pay_handle_buffer (GstBaseRTPPayload * payload,
GstBuffer * buffer);
GST_BOILERPLATE (GstRtpMPAPay, gst_rtp_mpa_pay, GstBaseRTPPayload,
GST_TYPE_BASE_RTP_PAYLOAD)
static void gst_rtp_mpa_pay_base_init (gpointer klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_mpa_pay_src_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_mpa_pay_sink_template));
gst_element_class_set_details_simple (element_class,
"RTP MPEG audio payloader", "Codec/Payloader/Network/RTP",
"Payload MPEG audio as RTP packets (RFC 2038)",
"Wim Taymans <wim.taymans@gmail.com>");
}
#define gst_rtp_mpa_pay_parent_class parent_class
G_DEFINE_TYPE (GstRtpMPAPay, gst_rtp_mpa_pay, GST_TYPE_BASE_RTP_PAYLOAD);
static void
gst_rtp_mpa_pay_class_init (GstRtpMPAPayClass * klass)
@ -88,6 +73,9 @@ gst_rtp_mpa_pay_class_init (GstRtpMPAPayClass * klass)
GstElementClass *gstelement_class;
GstBaseRTPPayloadClass *gstbasertppayload_class;
GST_DEBUG_CATEGORY_INIT (rtpmpapay_debug, "rtpmpapay", 0,
"MPEG Audio RTP Depayloader");
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass;
@ -96,16 +84,23 @@ gst_rtp_mpa_pay_class_init (GstRtpMPAPayClass * klass)
gstelement_class->change_state = gst_rtp_mpa_pay_change_state;
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_mpa_pay_src_template));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_mpa_pay_sink_template));
gst_element_class_set_details_simple (gstelement_class,
"RTP MPEG audio payloader", "Codec/Payloader/Network/RTP",
"Payload MPEG audio as RTP packets (RFC 2038)",
"Wim Taymans <wim.taymans@gmail.com>");
gstbasertppayload_class->set_caps = gst_rtp_mpa_pay_setcaps;
gstbasertppayload_class->handle_event = gst_rtp_mpa_pay_handle_event;
gstbasertppayload_class->handle_buffer = gst_rtp_mpa_pay_handle_buffer;
GST_DEBUG_CATEGORY_INIT (rtpmpapay_debug, "rtpmpapay", 0,
"MPEG Audio RTP Depayloader");
}
static void
gst_rtp_mpa_pay_init (GstRtpMPAPay * rtpmpapay, GstRtpMPAPayClass * klass)
gst_rtp_mpa_pay_init (GstRtpMPAPay * rtpmpapay)
{
rtpmpapay->adapter = gst_adapter_new ();
}