Commit 60db07b4 authored by Wim Taymans's avatar Wim Taymans

rtp: port some more (de)payloaders

parent 237ca163
...@@ -47,8 +47,7 @@ GST_STATIC_PAD_TEMPLATE ("sink", ...@@ -47,8 +47,7 @@ GST_STATIC_PAD_TEMPLATE ("sink",
"encoding-name = (string) \"AC3\"") "encoding-name = (string) \"AC3\"")
); );
GST_BOILERPLATE (GstRtpAC3Depay, gst_rtp_ac3_depay, GstBaseRTPDepayload, G_DEFINE_TYPE (GstRtpAC3Depay, gst_rtp_ac3_depay, GST_TYPE_BASE_RTP_DEPAYLOAD);
GST_TYPE_BASE_RTP_DEPAYLOAD);
static gboolean gst_rtp_ac3_depay_setcaps (GstBaseRTPDepayload * depayload, static gboolean gst_rtp_ac3_depay_setcaps (GstBaseRTPDepayload * depayload,
GstCaps * caps); GstCaps * caps);
...@@ -56,27 +55,23 @@ static GstBuffer *gst_rtp_ac3_depay_process (GstBaseRTPDepayload * depayload, ...@@ -56,27 +55,23 @@ static GstBuffer *gst_rtp_ac3_depay_process (GstBaseRTPDepayload * depayload,
GstBuffer * buf); GstBuffer * buf);
static void 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;
gstelement_class = (GstElementClass *) klass;
gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass;
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_src_template)); 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_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", "Codec/Depayloader/Network/RTP",
"Extracts AC3 audio from RTP packets (RFC 4184)", "Extracts AC3 audio from RTP packets (RFC 4184)",
"Wim Taymans <wim.taymans@gmail.com>"); "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->set_caps = gst_rtp_ac3_depay_setcaps;
gstbasertpdepayload_class->process = gst_rtp_ac3_depay_process; gstbasertpdepayload_class->process = gst_rtp_ac3_depay_process;
...@@ -86,10 +81,9 @@ gst_rtp_ac3_depay_class_init (GstRtpAC3DepayClass * klass) ...@@ -86,10 +81,9 @@ gst_rtp_ac3_depay_class_init (GstRtpAC3DepayClass * klass)
} }
static void static void
gst_rtp_ac3_depay_init (GstRtpAC3Depay * rtpac3depay, gst_rtp_ac3_depay_init (GstRtpAC3Depay * rtpac3depay)
GstRtpAC3DepayClass * klass)
{ {
/* needed because of GST_BOILERPLATE */ /* needed because of G_DEFINE_TYPE */
} }
static gboolean static gboolean
......
...@@ -60,23 +60,8 @@ static GstFlowReturn gst_rtp_ac3_pay_flush (GstRtpAC3Pay * rtpac3pay); ...@@ -60,23 +60,8 @@ static GstFlowReturn gst_rtp_ac3_pay_flush (GstRtpAC3Pay * rtpac3pay);
static GstFlowReturn gst_rtp_ac3_pay_handle_buffer (GstBaseRTPPayload * payload, static GstFlowReturn gst_rtp_ac3_pay_handle_buffer (GstBaseRTPPayload * payload,
GstBuffer * buffer); GstBuffer * buffer);
GST_BOILERPLATE (GstRtpAC3Pay, gst_rtp_ac3_pay, GstBaseRTPPayload, #define gst_rtp_ac3_pay_parent_class parent_class
GST_TYPE_BASE_RTP_PAYLOAD) G_DEFINE_TYPE (GstRtpAC3Pay, gst_rtp_ac3_pay, 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>");
}
static void static void
gst_rtp_ac3_pay_class_init (GstRtpAC3PayClass * klass) gst_rtp_ac3_pay_class_init (GstRtpAC3PayClass * klass)
...@@ -85,6 +70,9 @@ gst_rtp_ac3_pay_class_init (GstRtpAC3PayClass * klass) ...@@ -85,6 +70,9 @@ gst_rtp_ac3_pay_class_init (GstRtpAC3PayClass * klass)
GstElementClass *gstelement_class; GstElementClass *gstelement_class;
GstBaseRTPPayloadClass *gstbasertppayload_class; GstBaseRTPPayloadClass *gstbasertppayload_class;
GST_DEBUG_CATEGORY_INIT (rtpac3pay_debug, "rtpac3pay", 0,
"AC3 Audio RTP Depayloader");
gobject_class = (GObjectClass *) klass; gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass; gstelement_class = (GstElementClass *) klass;
gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass; gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass;
...@@ -93,16 +81,23 @@ gst_rtp_ac3_pay_class_init (GstRtpAC3PayClass * klass) ...@@ -93,16 +81,23 @@ gst_rtp_ac3_pay_class_init (GstRtpAC3PayClass * klass)
gstelement_class->change_state = gst_rtp_ac3_pay_change_state; 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->set_caps = gst_rtp_ac3_pay_setcaps;
gstbasertppayload_class->handle_event = gst_rtp_ac3_pay_handle_event; gstbasertppayload_class->handle_event = gst_rtp_ac3_pay_handle_event;
gstbasertppayload_class->handle_buffer = gst_rtp_ac3_pay_handle_buffer; gstbasertppayload_class->handle_buffer = gst_rtp_ac3_pay_handle_buffer;
GST_DEBUG_CATEGORY_INIT (rtpac3pay_debug, "rtpac3pay", 0,
"AC3 Audio RTP Depayloader");
} }
static void static void
gst_rtp_ac3_pay_init (GstRtpAC3Pay * rtpac3pay, GstRtpAC3PayClass * klass) gst_rtp_ac3_pay_init (GstRtpAC3Pay * rtpac3pay)
{ {
rtpac3pay->adapter = gst_adapter_new (); rtpac3pay->adapter = gst_adapter_new ();
} }
......
...@@ -54,37 +54,34 @@ static GstBuffer *gst_rtp_bv_depay_process (GstBaseRTPDepayload * depayload, ...@@ -54,37 +54,34 @@ static GstBuffer *gst_rtp_bv_depay_process (GstBaseRTPDepayload * depayload,
static gboolean gst_rtp_bv_depay_setcaps (GstBaseRTPDepayload * depayload, static gboolean gst_rtp_bv_depay_setcaps (GstBaseRTPDepayload * depayload,
GstCaps * caps); GstCaps * caps);
GST_BOILERPLATE (GstRTPBVDepay, gst_rtp_bv_depay, GstBaseRTPDepayload, #define gst_rtp_bv_depay_parent_class parent_class
GST_TYPE_BASE_RTP_DEPAYLOAD); G_DEFINE_TYPE (GstRTPBVDepay, gst_rtp_bv_depay, GST_TYPE_BASE_RTP_DEPAYLOAD);
static void static void
gst_rtp_bv_depay_base_init (gpointer klass) gst_rtp_bv_depay_class_init (GstRTPBVDepayClass * klass)
{ {
GstElementClass *element_class = GST_ELEMENT_CLASS (klass); GstElementClass *gstelement_class;
GstBaseRTPDepayloadClass *gstbasertpdepayload_class;
gstelement_class = (GstElementClass *) klass;
gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass;
gst_element_class_add_pad_template (element_class, gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_bv_depay_src_template)); gst_static_pad_template_get (&gst_rtp_bv_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_bv_depay_sink_template)); gst_static_pad_template_get (&gst_rtp_bv_depay_sink_template));
gst_element_class_set_details_simple (element_class,
gst_element_class_set_details_simple (gstelement_class,
"RTP BroadcomVoice depayloader", "Codec/Depayloader/Network/RTP", "RTP BroadcomVoice depayloader", "Codec/Depayloader/Network/RTP",
"Extracts BroadcomVoice audio from RTP packets (RFC 4298)", "Extracts BroadcomVoice audio from RTP packets (RFC 4298)",
"Wim Taymans <wim.taymans@collabora.co.uk>"); "Wim Taymans <wim.taymans@collabora.co.uk>");
}
static void
gst_rtp_bv_depay_class_init (GstRTPBVDepayClass * klass)
{
GstBaseRTPDepayloadClass *gstbasertpdepayload_class;
gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) klass;
gstbasertpdepayload_class->process = gst_rtp_bv_depay_process; gstbasertpdepayload_class->process = gst_rtp_bv_depay_process;
gstbasertpdepayload_class->set_caps = gst_rtp_bv_depay_setcaps; gstbasertpdepayload_class->set_caps = gst_rtp_bv_depay_setcaps;
} }
static void static void
gst_rtp_bv_depay_init (GstRTPBVDepay * rtpbvdepay, GstRTPBVDepayClass * klass) gst_rtp_bv_depay_init (GstRTPBVDepay * rtpbvdepay)
{ {
rtpbvdepay->mode = -1; rtpbvdepay->mode = -1;
} }
......
...@@ -58,40 +58,37 @@ static GstCaps *gst_rtp_bv_pay_sink_getcaps (GstBaseRTPPayload * payload, ...@@ -58,40 +58,37 @@ static GstCaps *gst_rtp_bv_pay_sink_getcaps (GstBaseRTPPayload * payload,
static gboolean gst_rtp_bv_pay_sink_setcaps (GstBaseRTPPayload * payload, static gboolean gst_rtp_bv_pay_sink_setcaps (GstBaseRTPPayload * payload,
GstCaps * caps); GstCaps * caps);
GST_BOILERPLATE (GstRTPBVPay, gst_rtp_bv_pay, GstBaseRTPAudioPayload, #define gst_rtp_bv_pay_parent_class parent_class
GST_TYPE_BASE_RTP_AUDIO_PAYLOAD); G_DEFINE_TYPE (GstRTPBVPay, gst_rtp_bv_pay, GST_TYPE_BASE_RTP_AUDIO_PAYLOAD);
static void static void
gst_rtp_bv_pay_base_init (gpointer klass) gst_rtp_bv_pay_class_init (GstRTPBVPayClass * klass)
{ {
GstElementClass *element_class = GST_ELEMENT_CLASS (klass); GstElementClass *gstelement_class;
GstBaseRTPPayloadClass *gstbasertppayload_class;
GST_DEBUG_CATEGORY_INIT (rtpbvpay_debug, "rtpbvpay", 0,
"BroadcomVoice audio RTP payloader");
gst_element_class_add_pad_template (element_class, 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_static_pad_template_get (&gst_rtp_bv_pay_sink_template));
gst_element_class_add_pad_template (element_class, gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_bv_pay_src_template)); gst_static_pad_template_get (&gst_rtp_bv_pay_src_template));
gst_element_class_set_details_simple (element_class, "RTP BV Payloader",
gst_element_class_set_details_simple (gstelement_class, "RTP BV Payloader",
"Codec/Payloader/Network/RTP", "Codec/Payloader/Network/RTP",
"Packetize BroadcomVoice audio streams into RTP packets (RFC 4298)", "Packetize BroadcomVoice audio streams into RTP packets (RFC 4298)",
"Wim Taymans <wim.taymans@collabora.co.uk>"); "Wim Taymans <wim.taymans@collabora.co.uk>");
}
static void
gst_rtp_bv_pay_class_init (GstRTPBVPayClass * klass)
{
GstBaseRTPPayloadClass *gstbasertppayload_class;
gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass;
gstbasertppayload_class->set_caps = gst_rtp_bv_pay_sink_setcaps; gstbasertppayload_class->set_caps = gst_rtp_bv_pay_sink_setcaps;
gstbasertppayload_class->get_caps = gst_rtp_bv_pay_sink_getcaps; gstbasertppayload_class->get_caps = gst_rtp_bv_pay_sink_getcaps;
GST_DEBUG_CATEGORY_INIT (rtpbvpay_debug, "rtpbvpay", 0,
"BroadcomVoice audio RTP payloader");
} }
static void static void
gst_rtp_bv_pay_init (GstRTPBVPay * rtpbvpay, GstRTPBVPayClass * klass) gst_rtp_bv_pay_init (GstRTPBVPay * rtpbvpay)
{ {
GstBaseRTPAudioPayload *basertpaudiopayload; GstBaseRTPAudioPayload *basertpaudiopayload;
......
...@@ -70,41 +70,38 @@ static GstBuffer *gst_rtp_celt_depay_process (GstBaseRTPDepayload * depayload, ...@@ -70,41 +70,38 @@ static GstBuffer *gst_rtp_celt_depay_process (GstBaseRTPDepayload * depayload,
static gboolean gst_rtp_celt_depay_setcaps (GstBaseRTPDepayload * depayload, static gboolean gst_rtp_celt_depay_setcaps (GstBaseRTPDepayload * depayload,
GstCaps * caps); 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); GST_TYPE_BASE_RTP_DEPAYLOAD);
static void static void
gst_rtp_celt_depay_base_init (gpointer klass) gst_rtp_celt_depay_class_init (GstRtpCELTDepayClass * klass)
{ {
GstElementClass *element_class = GST_ELEMENT_CLASS (klass); GstElementClass *gstelement_class;
GstBaseRTPDepayloadClass *gstbasertpdepayload_class;
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, GST_DEBUG_CATEGORY_INIT (rtpceltdepay_debug, "rtpceltdepay", 0,
"CELT RTP Depayloader"); "CELT RTP Depayloader");
}
static void
gst_rtp_celt_depay_class_init (GstRtpCELTDepayClass * klass)
{
GstBaseRTPDepayloadClass *gstbasertpdepayload_class;
gstelement_class = (GstElementClass *) klass;
gstbasertpdepayload_class = (GstBaseRTPDepayloadClass *) 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->process = gst_rtp_celt_depay_process;
gstbasertpdepayload_class->set_caps = gst_rtp_celt_depay_setcaps; gstbasertpdepayload_class->set_caps = gst_rtp_celt_depay_setcaps;
} }
static void static void
gst_rtp_celt_depay_init (GstRtpCELTDepay * rtpceltdepay, gst_rtp_celt_depay_init (GstRtpCELTDepay * rtpceltdepay)
GstRtpCELTDepayClass * klass)
{ {
} }
......
...@@ -62,26 +62,8 @@ static GstCaps *gst_rtp_celt_pay_getcaps (GstBaseRTPPayload * payload, ...@@ -62,26 +62,8 @@ static GstCaps *gst_rtp_celt_pay_getcaps (GstBaseRTPPayload * payload,
static GstFlowReturn gst_rtp_celt_pay_handle_buffer (GstBaseRTPPayload * static GstFlowReturn gst_rtp_celt_pay_handle_buffer (GstBaseRTPPayload *
payload, GstBuffer * buffer); payload, GstBuffer * buffer);
GST_BOILERPLATE (GstRtpCELTPay, gst_rtp_celt_pay, GstBaseRTPPayload, #define gst_rtp_celt_pay_parent_class parent_class
GST_TYPE_BASE_RTP_PAYLOAD); G_DEFINE_TYPE (GstRtpCELTPay, gst_rtp_celt_pay, 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");
}
static void static void
gst_rtp_celt_pay_class_init (GstRtpCELTPayClass * klass) gst_rtp_celt_pay_class_init (GstRtpCELTPayClass * klass)
...@@ -90,6 +72,9 @@ gst_rtp_celt_pay_class_init (GstRtpCELTPayClass * klass) ...@@ -90,6 +72,9 @@ gst_rtp_celt_pay_class_init (GstRtpCELTPayClass * klass)
GstElementClass *gstelement_class; GstElementClass *gstelement_class;
GstBaseRTPPayloadClass *gstbasertppayload_class; GstBaseRTPPayloadClass *gstbasertppayload_class;
GST_DEBUG_CATEGORY_INIT (rtpceltpay_debug, "rtpceltpay", 0,
"CELT RTP Payloader");
gobject_class = (GObjectClass *) klass; gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass; gstelement_class = (GstElementClass *) klass;
gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass; gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass;
...@@ -98,13 +83,23 @@ gst_rtp_celt_pay_class_init (GstRtpCELTPayClass * klass) ...@@ -98,13 +83,23 @@ gst_rtp_celt_pay_class_init (GstRtpCELTPayClass * klass)
gstelement_class->change_state = gst_rtp_celt_pay_change_state; 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->set_caps = gst_rtp_celt_pay_setcaps;
gstbasertppayload_class->get_caps = gst_rtp_celt_pay_getcaps; gstbasertppayload_class->get_caps = gst_rtp_celt_pay_getcaps;
gstbasertppayload_class->handle_buffer = gst_rtp_celt_pay_handle_buffer; gstbasertppayload_class->handle_buffer = gst_rtp_celt_pay_handle_buffer;
} }
static void static void
gst_rtp_celt_pay_init (GstRtpCELTPay * rtpceltpay, GstRtpCELTPayClass * klass) gst_rtp_celt_pay_init (GstRtpCELTPay * rtpceltpay)
{ {
rtpceltpay->queue = g_queue_new (); rtpceltpay->queue = g_queue_new ();
} }
......
...@@ -56,13 +56,15 @@ static GstFlowReturn gst_rtp_depay_chain_rtp (GstPad * pad, GstBuffer * buffer); ...@@ -56,13 +56,15 @@ static GstFlowReturn gst_rtp_depay_chain_rtp (GstPad * pad, GstBuffer * buffer);
static GstFlowReturn gst_rtp_depay_chain_rtcp (GstPad * pad, static GstFlowReturn gst_rtp_depay_chain_rtcp (GstPad * pad,
GstBuffer * buffer); GstBuffer * buffer);
GST_BOILERPLATE (GstRTPDepay, gst_rtp_depay, GstElement, GST_TYPE_ELEMENT); G_DEFINE_TYPE (GstRTPDepay, gst_rtp_depay, GST_TYPE_ELEMENT);
static void static void
gst_rtp_depay_base_init (gpointer klass) gst_rtp_depay_class_init (GstRTPDepayClass * klass)
{ {
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (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_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_depay_src_rtp_template)); gst_static_pad_template_get (&gst_rtp_depay_src_rtp_template));
gst_element_class_add_pad_template (gstelement_class, gst_element_class_add_pad_template (gstelement_class,
...@@ -71,6 +73,7 @@ gst_rtp_depay_base_init (gpointer klass) ...@@ -71,6 +73,7 @@ gst_rtp_depay_base_init (gpointer klass)
gst_static_pad_template_get (&gst_rtp_depay_sink_rtp_template)); gst_static_pad_template_get (&gst_rtp_depay_sink_rtp_template));
gst_element_class_add_pad_template (gstelement_class, gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_depay_sink_rtcp_template)); gst_static_pad_template_get (&gst_rtp_depay_sink_rtcp_template));
gst_element_class_set_details_simple (gstelement_class, gst_element_class_set_details_simple (gstelement_class,
"Dummy RTP session manager", "Codec/Depayloader/Network/RTP", "Dummy RTP session manager", "Codec/Depayloader/Network/RTP",
"Accepts raw RTP and RTCP packets and sends them forward", "Accepts raw RTP and RTCP packets and sends them forward",
...@@ -78,13 +81,7 @@ gst_rtp_depay_base_init (gpointer klass) ...@@ -78,13 +81,7 @@ gst_rtp_depay_base_init (gpointer klass)
} }
static void static void
gst_rtp_depay_class_init (GstRTPDepayClass * klass) gst_rtp_depay_init (GstRTPDepay * rtpdepay)
{
GST_DEBUG_CATEGORY_INIT (rtpdepay_debug, "rtpdepay", 0, "RTP decoder");
}
static void
gst_rtp_depay_init (GstRTPDepay * rtpdepay, GstRTPDepayClass * klass)
{ {
/* the input rtp pad */ /* the input rtp pad */
rtpdepay->sink_rtp = rtpdepay->sink_rtp =
......
...@@ -80,25 +80,10 @@ static GstBuffer *gst_rtp_dv_depay_process (GstBaseRTPDepayload * base, ...@@ -80,25 +80,10 @@ static GstBuffer *gst_rtp_dv_depay_process (GstBaseRTPDepayload * base,
static gboolean gst_rtp_dv_depay_setcaps (GstBaseRTPDepayload * depayload, static gboolean gst_rtp_dv_depay_setcaps (GstBaseRTPDepayload * depayload,
GstCaps * caps); GstCaps * caps);
GST_BOILERPLATE (GstRTPDVDepay, gst_rtp_dv_depay, GstBaseRTPDepayload, #define gst_rtp_dv_depay_parent_class parent_class
GST_TYPE_BASE_RTP_DEPAYLOAD) 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 static void
gst_rtp_dv_depay_class_init (GstRTPDVDepayClass * klass) gst_rtp_dv_depay_class_init (GstRTPDVDepayClass * klass)
{ {
...@@ -106,16 +91,26 @@ gst_rtp_dv_depay_class_init (GstRTPDVDepayClass * klass) ...@@ -106,16 +91,26 @@ gst_rtp_dv_depay_class_init (GstRTPDVDepayClass * klass)
GstBaseRTPDepayloadClass *gstbasertpdepayload_class = GstBaseRTPDepayloadClass *gstbasertpdepayload_class =
(GstBaseRTPDepayloadClass *) klass; (GstBaseRTPDepayloadClass *) klass;
GST_DEBUG_CATEGORY_INIT (rtpdvdepay_debug, "rtpdvdepay", 0,
"DV RTP Depayloader");
gstelement_class->change_state = gstelement_class->change_state =
GST_DEBUG_FUNCPTR (gst_rtp_dv_depay_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 = gstbasertpdepayload_class->process =
GST_DEBUG_FUNCPTR (gst_rtp_dv_depay_process); GST_DEBUG_FUNCPTR (gst_rtp_dv_depay_process);
gstbasertpdepayload_class->set_caps = gstbasertpdepayload_class->set_caps =
GST_DEBUG_FUNCPTR (gst_rtp_dv_depay_setcaps); GST_DEBUG_FUNCPTR (gst_rtp_dv_depay_setcaps);
GST_DEBUG_CATEGORY_INIT (rtpdvdepay_debug, "rtpdvdepay", 0,
"DV RTP Depayloader");
} }
/* initialize the new element /* initialize the new element
...@@ -124,7 +119,7 @@ gst_rtp_dv_depay_class_init (GstRTPDVDepayClass * klass) ...@@ -124,7 +119,7 @@ gst_rtp_dv_depay_class_init (GstRTPDVDepayClass * klass)
* initialize structure * initialize structure
*/ */
static void static void
gst_rtp_dv_depay_init (GstRTPDVDepay * filter, GstRTPDVDepayClass * klass) gst_rtp_dv_depay_init (GstRTPDVDepay * filter)
{ {
} }
......
...@@ -94,49 +94,47 @@ static void gst_dv_pay_set_property (GObject * object, ...@@ -94,49 +94,47 @@ static void gst_dv_pay_set_property (GObject * object,
static void gst_dv_pay_get_property (GObject * object, static void gst_dv_pay_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec); guint prop_id, GValue * value, GParamSpec * pspec);
GST_BOILERPLATE (GstRTPDVPay, gst_rtp_dv_pay, GstBaseRTPPayload, #define gst_rtp_dv_pay_parent_class parent_class
GST_TYPE_BASE_RTP_PAYLOAD) G_DEFINE_TYPE (GstRTPDVPay, gst_rtp_dv_pay, 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",