diff options
author | Thomas Vander Stichele <thomas@apestaart.org> | 2005-12-01 14:30:01 +0000 |
---|---|---|
committer | Thomas Vander Stichele <thomas@apestaart.org> | 2005-12-01 14:30:01 +0000 |
commit | 7a4f8655ce2679dc535d6698630dbc087dc1ce87 (patch) | |
tree | 88124114105a1b2dd08b99207689d5313c6c029f /gst/rtp/gstrtph263pdepay.c | |
parent | 0b3776c0b80196d747c351ebf3e165434a38a22b (diff) |
Do burger's rename for rtp payloaders and depayloaders
Original commit message from CVS:
Do burger's rename for rtp payloaders and depayloaders
Diffstat (limited to 'gst/rtp/gstrtph263pdepay.c')
-rw-r--r-- | gst/rtp/gstrtph263pdepay.c | 159 |
1 files changed, 81 insertions, 78 deletions
diff --git a/gst/rtp/gstrtph263pdepay.c b/gst/rtp/gstrtph263pdepay.c index 4a7467bd..7b6925e9 100644 --- a/gst/rtp/gstrtph263pdepay.c +++ b/gst/rtp/gstrtph263pdepay.c @@ -19,17 +19,17 @@ #include <string.h> #include <gst/rtp/gstrtpbuffer.h> -#include "gstrtph263pdec.h" +#include "gstrtph263pdepay.h" /* elementfactory information */ -static GstElementDetails gst_rtp_h263pdec_details = { +static GstElementDetails gst_rtp_h263pdepay_details = { "RTP packet parser", "Codec/Parser/Network", "Extracts H263+ video from RTP packets (RFC 2429)", "Wim Taymans <wim@fluendo.com>" }; -/* RtpH263PDec signals and args */ +/* RtpH263PDepay signals and args */ enum { /* FILL ME */ @@ -42,14 +42,14 @@ enum ARG_FREQUENCY }; -static GstStaticPadTemplate gst_rtph263pdec_src_template = +static GstStaticPadTemplate gst_rtp_h263p_depay_src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("video/x-h263") ); -static GstStaticPadTemplate gst_rtph263pdec_sink_template = +static GstStaticPadTemplate gst_rtp_h263p_depay_sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, @@ -60,63 +60,64 @@ GST_STATIC_PAD_TEMPLATE ("sink", ); -static void gst_rtph263pdec_class_init (GstRtpH263PDecClass * klass); -static void gst_rtph263pdec_base_init (GstRtpH263PDecClass * klass); -static void gst_rtph263pdec_init (GstRtpH263PDec * rtph263pdec); -static void gst_rtph263pdec_finalize (GObject * object); +static void gst_rtp_h263p_depay_class_init (GstRtpH263PDepayClass * klass); +static void gst_rtp_h263p_depay_base_init (GstRtpH263PDepayClass * klass); +static void gst_rtp_h263p_depay_init (GstRtpH263PDepay * rtph263pdepay); +static void gst_rtp_h263p_depay_finalize (GObject * object); -static GstFlowReturn gst_rtph263pdec_chain (GstPad * pad, GstBuffer * buffer); +static GstFlowReturn gst_rtp_h263p_depay_chain (GstPad * pad, + GstBuffer * buffer); -static void gst_rtph263pdec_set_property (GObject * object, guint prop_id, +static void gst_rtp_h263p_depay_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); -static void gst_rtph263pdec_get_property (GObject * object, guint prop_id, +static void gst_rtp_h263p_depay_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -static GstStateChangeReturn gst_rtph263pdec_change_state (GstElement * +static GstStateChangeReturn gst_rtp_h263p_depay_change_state (GstElement * element, GstStateChange transition); static GstElementClass *parent_class = NULL; static GType -gst_rtph263pdec_get_type (void) +gst_rtp_h263p_depay_get_type (void) { - static GType rtph263pdec_type = 0; + static GType rtph263pdepay_type = 0; - if (!rtph263pdec_type) { - static const GTypeInfo rtph263pdec_info = { - sizeof (GstRtpH263PDecClass), - (GBaseInitFunc) gst_rtph263pdec_base_init, + if (!rtph263pdepay_type) { + static const GTypeInfo rtph263pdepay_info = { + sizeof (GstRtpH263PDepayClass), + (GBaseInitFunc) gst_rtp_h263p_depay_base_init, NULL, - (GClassInitFunc) gst_rtph263pdec_class_init, + (GClassInitFunc) gst_rtp_h263p_depay_class_init, NULL, NULL, - sizeof (GstRtpH263PDec), + sizeof (GstRtpH263PDepay), 0, - (GInstanceInitFunc) gst_rtph263pdec_init, + (GInstanceInitFunc) gst_rtp_h263p_depay_init, }; - rtph263pdec_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstRtpH263PDec", - &rtph263pdec_info, 0); + rtph263pdepay_type = + g_type_register_static (GST_TYPE_ELEMENT, "GstRtpH263PDepay", + &rtph263pdepay_info, 0); } - return rtph263pdec_type; + return rtph263pdepay_type; } static void -gst_rtph263pdec_base_init (GstRtpH263PDecClass * klass) +gst_rtp_h263p_depay_base_init (GstRtpH263PDepayClass * klass) { GstElementClass *element_class = GST_ELEMENT_CLASS (klass); gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&gst_rtph263pdec_src_template)); + gst_static_pad_template_get (&gst_rtp_h263p_depay_src_template)); gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&gst_rtph263pdec_sink_template)); + gst_static_pad_template_get (&gst_rtp_h263p_depay_sink_template)); - gst_element_class_set_details (element_class, &gst_rtp_h263pdec_details); + gst_element_class_set_details (element_class, &gst_rtp_h263pdepay_details); } static void -gst_rtph263pdec_class_init (GstRtpH263PDecClass * klass) +gst_rtp_h263p_depay_class_init (GstRtpH263PDepayClass * klass) { GObjectClass *gobject_class; GstElementClass *gstelement_class; @@ -126,60 +127,61 @@ gst_rtph263pdec_class_init (GstRtpH263PDecClass * klass) parent_class = g_type_class_ref (GST_TYPE_ELEMENT); - gobject_class->finalize = gst_rtph263pdec_finalize; + gobject_class->finalize = gst_rtp_h263p_depay_finalize; - gobject_class->set_property = gst_rtph263pdec_set_property; - gobject_class->get_property = gst_rtph263pdec_get_property; + gobject_class->set_property = gst_rtp_h263p_depay_set_property; + gobject_class->get_property = gst_rtp_h263p_depay_get_property; - gstelement_class->change_state = gst_rtph263pdec_change_state; + gstelement_class->change_state = gst_rtp_h263p_depay_change_state; } static void -gst_rtph263pdec_init (GstRtpH263PDec * rtph263pdec) +gst_rtp_h263p_depay_init (GstRtpH263PDepay * rtph263pdepay) { - rtph263pdec->srcpad = + rtph263pdepay->srcpad = gst_pad_new_from_template (gst_static_pad_template_get - (&gst_rtph263pdec_src_template), "src"); - gst_element_add_pad (GST_ELEMENT (rtph263pdec), rtph263pdec->srcpad); + (&gst_rtp_h263p_depay_src_template), "src"); + gst_element_add_pad (GST_ELEMENT (rtph263pdepay), rtph263pdepay->srcpad); - rtph263pdec->sinkpad = + rtph263pdepay->sinkpad = gst_pad_new_from_template (gst_static_pad_template_get - (&gst_rtph263pdec_sink_template), "sink"); - gst_pad_set_chain_function (rtph263pdec->sinkpad, gst_rtph263pdec_chain); - gst_element_add_pad (GST_ELEMENT (rtph263pdec), rtph263pdec->sinkpad); + (&gst_rtp_h263p_depay_sink_template), "sink"); + gst_pad_set_chain_function (rtph263pdepay->sinkpad, + gst_rtp_h263p_depay_chain); + gst_element_add_pad (GST_ELEMENT (rtph263pdepay), rtph263pdepay->sinkpad); - rtph263pdec->adapter = gst_adapter_new (); + rtph263pdepay->adapter = gst_adapter_new (); } static void -gst_rtph263pdec_finalize (GObject * object) +gst_rtp_h263p_depay_finalize (GObject * object) { - GstRtpH263PDec *rtph263pdec; + GstRtpH263PDepay *rtph263pdepay; - rtph263pdec = GST_RTP_H263P_DEC (object); + rtph263pdepay = GST_RTP_H263P_DEPAY (object); - g_object_unref (rtph263pdec->adapter); - rtph263pdec->adapter = NULL; + g_object_unref (rtph263pdepay->adapter); + rtph263pdepay->adapter = NULL; G_OBJECT_CLASS (parent_class)->finalize (object); } static GstFlowReturn -gst_rtph263pdec_chain (GstPad * pad, GstBuffer * buf) +gst_rtp_h263p_depay_chain (GstPad * pad, GstBuffer * buf) { - GstRtpH263PDec *rtph263pdec; + GstRtpH263PDepay *rtph263pdepay; GstBuffer *outbuf; GstFlowReturn ret; /* GstRTPPayload pt; */ - rtph263pdec = GST_RTP_H263P_DEC (GST_OBJECT_PARENT (pad)); + rtph263pdepay = GST_RTP_H263P_DEPAY (GST_OBJECT_PARENT (pad)); - if (!gst_rtpbuffer_validate (buf)) + if (!gst_rtp_buffer_validate (buf)) goto bad_packet; /* - if ((pt = gst_rtpbuffer_get_payload_type (buf)) != 0) + if ((pt = gst_rtp_buffer_get_payload_type (buf)) != 0) goto bad_payload; */ @@ -191,12 +193,12 @@ gst_rtph263pdec_chain (GstPad * pad, GstBuffer * buf) guint header_len; guint8 PLEN; - payload_len = gst_rtpbuffer_get_payload_len (buf); - payload = gst_rtpbuffer_get_payload (buf); + payload_len = gst_rtp_buffer_get_payload_len (buf); + payload = gst_rtp_buffer_get_payload (buf); header_len = 2; - M = gst_rtpbuffer_get_marker (buf); + M = gst_rtp_buffer_get_marker (buf); P = (payload[0] & 0x04) == 0x04; V = (payload[0] & 0x02) == 0x02; PLEN = ((payload[0] & 0x1) << 5) | (payload[1] >> 3); @@ -218,37 +220,37 @@ gst_rtph263pdec_chain (GstPad * pad, GstBuffer * buf) payload += header_len; payload_len -= header_len; - timestamp = gst_rtpbuffer_get_timestamp (buf); + timestamp = gst_rtp_buffer_get_timestamp (buf); if (M) { /* frame is completed: append to previous, push it out */ guint avail; guint8 *data; - avail = gst_adapter_available (rtph263pdec->adapter); + avail = gst_adapter_available (rtph263pdepay->adapter); outbuf = gst_buffer_new_and_alloc (avail + payload_len); /* prepend previous data */ if (avail > 0) { - data = (guint8 *) gst_adapter_peek (rtph263pdec->adapter, avail); + data = (guint8 *) gst_adapter_peek (rtph263pdepay->adapter, avail); memcpy (GST_BUFFER_DATA (outbuf), data, avail); - gst_adapter_flush (rtph263pdec->adapter, avail); + gst_adapter_flush (rtph263pdepay->adapter, avail); } memcpy (GST_BUFFER_DATA (outbuf) + avail, payload, payload_len); GST_BUFFER_TIMESTAMP (outbuf) = timestamp * GST_SECOND / 90000; gst_buffer_set_caps (outbuf, - (GstCaps *) gst_pad_get_pad_template_caps (rtph263pdec->srcpad)); + (GstCaps *) gst_pad_get_pad_template_caps (rtph263pdepay->srcpad)); - ret = gst_pad_push (rtph263pdec->srcpad, outbuf); + ret = gst_pad_push (rtph263pdepay->srcpad, outbuf); } else { /* frame not completed: store in adapter */ outbuf = gst_buffer_new_and_alloc (payload_len); memcpy (GST_BUFFER_DATA (outbuf), payload, payload_len); - gst_adapter_push (rtph263pdec->adapter, outbuf); + gst_adapter_push (rtph263pdepay->adapter, outbuf); ret = GST_FLOW_OK; } @@ -276,12 +278,12 @@ bad_packet: } static void -gst_rtph263pdec_set_property (GObject * object, guint prop_id, +gst_rtp_h263p_depay_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { - GstRtpH263PDec *rtph263pdec; + GstRtpH263PDepay *rtph263pdepay; - rtph263pdec = GST_RTP_H263P_DEC (object); + rtph263pdepay = GST_RTP_H263P_DEPAY (object); switch (prop_id) { default: @@ -291,12 +293,12 @@ gst_rtph263pdec_set_property (GObject * object, guint prop_id, } static void -gst_rtph263pdec_get_property (GObject * object, guint prop_id, GValue * value, - GParamSpec * pspec) +gst_rtp_h263p_depay_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec) { - GstRtpH263PDec *rtph263pdec; + GstRtpH263PDepay *rtph263pdepay; - rtph263pdec = GST_RTP_H263P_DEC (object); + rtph263pdepay = GST_RTP_H263P_DEPAY (object); switch (prop_id) { default: @@ -306,18 +308,19 @@ gst_rtph263pdec_get_property (GObject * object, guint prop_id, GValue * value, } static GstStateChangeReturn -gst_rtph263pdec_change_state (GstElement * element, GstStateChange transition) +gst_rtp_h263p_depay_change_state (GstElement * element, + GstStateChange transition) { - GstRtpH263PDec *rtph263pdec; + GstRtpH263PDepay *rtph263pdepay; GstStateChangeReturn ret; - rtph263pdec = GST_RTP_H263P_DEC (element); + rtph263pdepay = GST_RTP_H263P_DEPAY (element); switch (transition) { case GST_STATE_CHANGE_NULL_TO_READY: break; case GST_STATE_CHANGE_READY_TO_PAUSED: - gst_adapter_clear (rtph263pdec->adapter); + gst_adapter_clear (rtph263pdepay->adapter); break; default: break; @@ -335,8 +338,8 @@ gst_rtph263pdec_change_state (GstElement * element, GstStateChange transition) } gboolean -gst_rtph263pdec_plugin_init (GstPlugin * plugin) +gst_rtp_h263p_depay_plugin_init (GstPlugin * plugin) { - return gst_element_register (plugin, "rtph263pdec", - GST_RANK_NONE, GST_TYPE_RTP_H263P_DEC); + return gst_element_register (plugin, "rtph263pdepay", + GST_RANK_NONE, GST_TYPE_RTP_H263P_DEPAY); } |