summaryrefslogtreecommitdiffstats
path: root/gst/rtp/gstrtph263ppay.c
diff options
context:
space:
mode:
authorThomas Vander Stichele <thomas@apestaart.org>2005-12-01 14:30:01 +0000
committerThomas Vander Stichele <thomas@apestaart.org>2005-12-01 14:30:01 +0000
commit7a4f8655ce2679dc535d6698630dbc087dc1ce87 (patch)
tree88124114105a1b2dd08b99207689d5313c6c029f /gst/rtp/gstrtph263ppay.c
parent0b3776c0b80196d747c351ebf3e165434a38a22b (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/gstrtph263ppay.c')
-rw-r--r--gst/rtp/gstrtph263ppay.c123
1 files changed, 62 insertions, 61 deletions
diff --git a/gst/rtp/gstrtph263ppay.c b/gst/rtp/gstrtph263ppay.c
index c1402494..c2ee2ea3 100644
--- a/gst/rtp/gstrtph263ppay.c
+++ b/gst/rtp/gstrtph263ppay.c
@@ -20,24 +20,24 @@
#include <gst/rtp/gstrtpbuffer.h>
-#include "gstrtph263penc.h"
+#include "gstrtph263ppay.h"
/* elementfactory information */
-static GstElementDetails gst_rtp_h263penc_details = {
+static GstElementDetails gst_rtp_h263ppay_details = {
"RTP packet parser",
- "Codec/Encoder/Network",
- "Encodes H263+ video in RTP packets (RFC 2429)",
+ "Codec/Payloader/Network",
+ "Payodes H263+ video in RTP packets (RFC 2429)",
"Wim Taymans <wim@fluendo.com>"
};
-static GstStaticPadTemplate gst_rtph263penc_sink_template =
+static GstStaticPadTemplate gst_rtp_h263p_pay_sink_template =
GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("video/x-h263")
);
-static GstStaticPadTemplate gst_rtph263penc_src_template =
+static GstStaticPadTemplate gst_rtp_h263p_pay_src_template =
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
@@ -47,58 +47,58 @@ GST_STATIC_PAD_TEMPLATE ("src",
"clock-rate = (int) 90000, " "encoding-name = (string) \"H263-1998\"")
);
-static void gst_rtph263penc_class_init (GstRtpH263PEncClass * klass);
-static void gst_rtph263penc_base_init (GstRtpH263PEncClass * klass);
-static void gst_rtph263penc_init (GstRtpH263PEnc * rtph263penc);
-static void gst_rtph263penc_finalize (GObject * object);
+static void gst_rtp_h263p_pay_class_init (GstRtpH263PPayClass * klass);
+static void gst_rtp_h263p_pay_base_init (GstRtpH263PPayClass * klass);
+static void gst_rtp_h263p_pay_init (GstRtpH263PPay * rtph263ppay);
+static void gst_rtp_h263p_pay_finalize (GObject * object);
-static gboolean gst_rtph263penc_setcaps (GstBaseRTPPayload * payload,
+static gboolean gst_rtp_h263p_pay_setcaps (GstBaseRTPPayload * payload,
GstCaps * caps);
-static GstFlowReturn gst_rtph263penc_handle_buffer (GstBaseRTPPayload * payload,
- GstBuffer * buffer);
+static GstFlowReturn gst_rtp_h263p_pay_handle_buffer (GstBaseRTPPayload *
+ payload, GstBuffer * buffer);
static GstBaseRTPPayloadClass *parent_class = NULL;
static GType
-gst_rtph263penc_get_type (void)
+gst_rtp_h263p_pay_get_type (void)
{
- static GType rtph263penc_type = 0;
+ static GType rtph263ppay_type = 0;
- if (!rtph263penc_type) {
- static const GTypeInfo rtph263penc_info = {
- sizeof (GstRtpH263PEncClass),
- (GBaseInitFunc) gst_rtph263penc_base_init,
+ if (!rtph263ppay_type) {
+ static const GTypeInfo rtph263ppay_info = {
+ sizeof (GstRtpH263PPayClass),
+ (GBaseInitFunc) gst_rtp_h263p_pay_base_init,
NULL,
- (GClassInitFunc) gst_rtph263penc_class_init,
+ (GClassInitFunc) gst_rtp_h263p_pay_class_init,
NULL,
NULL,
- sizeof (GstRtpH263PEnc),
+ sizeof (GstRtpH263PPay),
0,
- (GInstanceInitFunc) gst_rtph263penc_init,
+ (GInstanceInitFunc) gst_rtp_h263p_pay_init,
};
- rtph263penc_type =
- g_type_register_static (GST_TYPE_BASE_RTP_PAYLOAD, "GstRtpH263PEnc",
- &rtph263penc_info, 0);
+ rtph263ppay_type =
+ g_type_register_static (GST_TYPE_BASE_RTP_PAYLOAD, "GstRtpH263PPay",
+ &rtph263ppay_info, 0);
}
- return rtph263penc_type;
+ return rtph263ppay_type;
}
static void
-gst_rtph263penc_base_init (GstRtpH263PEncClass * klass)
+gst_rtp_h263p_pay_base_init (GstRtpH263PPayClass * klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class,
- gst_static_pad_template_get (&gst_rtph263penc_src_template));
+ gst_static_pad_template_get (&gst_rtp_h263p_pay_src_template));
gst_element_class_add_pad_template (element_class,
- gst_static_pad_template_get (&gst_rtph263penc_sink_template));
+ gst_static_pad_template_get (&gst_rtp_h263p_pay_sink_template));
- gst_element_class_set_details (element_class, &gst_rtp_h263penc_details);
+ gst_element_class_set_details (element_class, &gst_rtp_h263ppay_details);
}
static void
-gst_rtph263penc_class_init (GstRtpH263PEncClass * klass)
+gst_rtp_h263p_pay_class_init (GstRtpH263PPayClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
@@ -110,33 +110,33 @@ gst_rtph263penc_class_init (GstRtpH263PEncClass * klass)
parent_class = g_type_class_ref (GST_TYPE_BASE_RTP_PAYLOAD);
- gobject_class->finalize = gst_rtph263penc_finalize;
+ gobject_class->finalize = gst_rtp_h263p_pay_finalize;
- gstbasertppayload_class->set_caps = gst_rtph263penc_setcaps;
- gstbasertppayload_class->handle_buffer = gst_rtph263penc_handle_buffer;
+ gstbasertppayload_class->set_caps = gst_rtp_h263p_pay_setcaps;
+ gstbasertppayload_class->handle_buffer = gst_rtp_h263p_pay_handle_buffer;
}
static void
-gst_rtph263penc_init (GstRtpH263PEnc * rtph263penc)
+gst_rtp_h263p_pay_init (GstRtpH263PPay * rtph263ppay)
{
- rtph263penc->adapter = gst_adapter_new ();
+ rtph263ppay->adapter = gst_adapter_new ();
}
static void
-gst_rtph263penc_finalize (GObject * object)
+gst_rtp_h263p_pay_finalize (GObject * object)
{
- GstRtpH263PEnc *rtph263penc;
+ GstRtpH263PPay *rtph263ppay;
- rtph263penc = GST_RTP_H263P_ENC (object);
+ rtph263ppay = GST_RTP_H263P_PAY (object);
- g_object_unref (rtph263penc->adapter);
- rtph263penc->adapter = NULL;
+ g_object_unref (rtph263ppay->adapter);
+ rtph263ppay->adapter = NULL;
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gboolean
-gst_rtph263penc_setcaps (GstBaseRTPPayload * payload, GstCaps * caps)
+gst_rtp_h263p_pay_setcaps (GstBaseRTPPayload * payload, GstCaps * caps)
{
gst_basertppayload_set_options (payload, "video", TRUE, "H263-1998", 90000);
gst_basertppayload_set_outcaps (payload, NULL);
@@ -146,14 +146,14 @@ gst_rtph263penc_setcaps (GstBaseRTPPayload * payload, GstCaps * caps)
static GstFlowReturn
-gst_rtph263penc_flush (GstRtpH263PEnc * rtph263penc)
+gst_rtp_h263p_pay_flush (GstRtpH263PPay * rtph263ppay)
{
guint avail;
GstBuffer *outbuf;
GstFlowReturn ret;
gboolean fragmented;
- avail = gst_adapter_available (rtph263penc->adapter);
+ avail = gst_adapter_available (rtph263ppay->adapter);
if (avail == 0)
return GST_FLOW_OK;
@@ -168,20 +168,20 @@ gst_rtph263penc_flush (GstRtpH263PEnc * rtph263penc)
/* FIXME, do better mtu packing, header len etc should be
* included in this calculation. */
- towrite = MIN (avail, GST_BASE_RTP_PAYLOAD_MTU (rtph263penc));
+ towrite = MIN (avail, GST_BASE_RTP_PAYLOAD_MTU (rtph263ppay));
/* for fragmented frames we need 2 bytes header, for other
* frames we must reuse the first 2 bytes of the data as the
* header */
header_len = (fragmented ? 2 : 0);
payload_len = header_len + towrite;
- outbuf = gst_rtpbuffer_new_allocate (payload_len, 0, 0);
+ outbuf = gst_rtp_buffer_new_allocate (payload_len, 0, 0);
/* last fragment gets the marker bit set */
- gst_rtpbuffer_set_marker (outbuf, avail > towrite ? 0 : 1);
+ gst_rtp_buffer_set_marker (outbuf, avail > towrite ? 0 : 1);
- payload = gst_rtpbuffer_get_payload (outbuf);
+ payload = gst_rtp_buffer_get_payload (outbuf);
- data = (guint8 *) gst_adapter_peek (rtph263penc->adapter, towrite);
+ data = (guint8 *) gst_adapter_peek (rtph263ppay->adapter, towrite);
memcpy (&payload[header_len], data, towrite);
/* 0 1
@@ -193,10 +193,10 @@ gst_rtph263penc_flush (GstRtpH263PEnc * rtph263penc)
payload[0] = fragmented ? 0x00 : 0x04;
payload[1] = 0;
- GST_BUFFER_TIMESTAMP (outbuf) = rtph263penc->first_ts;
- gst_adapter_flush (rtph263penc->adapter, towrite);
+ GST_BUFFER_TIMESTAMP (outbuf) = rtph263ppay->first_ts;
+ gst_adapter_flush (rtph263ppay->adapter, towrite);
- ret = gst_basertppayload_push (GST_BASE_RTP_PAYLOAD (rtph263penc), outbuf);
+ ret = gst_basertppayload_push (GST_BASE_RTP_PAYLOAD (rtph263ppay), outbuf);
avail -= towrite;
fragmented = TRUE;
@@ -206,27 +206,28 @@ gst_rtph263penc_flush (GstRtpH263PEnc * rtph263penc)
}
static GstFlowReturn
-gst_rtph263penc_handle_buffer (GstBaseRTPPayload * payload, GstBuffer * buffer)
+gst_rtp_h263p_pay_handle_buffer (GstBaseRTPPayload * payload,
+ GstBuffer * buffer)
{
- GstRtpH263PEnc *rtph263penc;
+ GstRtpH263PPay *rtph263ppay;
GstFlowReturn ret;
guint size;
- rtph263penc = GST_RTP_H263P_ENC (payload);
+ rtph263ppay = GST_RTP_H263P_PAY (payload);
size = GST_BUFFER_SIZE (buffer);
- rtph263penc->first_ts = GST_BUFFER_TIMESTAMP (buffer);
+ rtph263ppay->first_ts = GST_BUFFER_TIMESTAMP (buffer);
/* we always encode and flush a full picture */
- gst_adapter_push (rtph263penc->adapter, buffer);
- ret = gst_rtph263penc_flush (rtph263penc);
+ gst_adapter_push (rtph263ppay->adapter, buffer);
+ ret = gst_rtp_h263p_pay_flush (rtph263ppay);
return ret;
}
gboolean
-gst_rtph263penc_plugin_init (GstPlugin * plugin)
+gst_rtp_h263p_pay_plugin_init (GstPlugin * plugin)
{
- return gst_element_register (plugin, "rtph263penc",
- GST_RANK_NONE, GST_TYPE_RTP_H263P_ENC);
+ return gst_element_register (plugin, "rtph263ppay",
+ GST_RANK_NONE, GST_TYPE_RTP_H263P_PAY);
}