static gboolean gst_rtp_L16_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
static GstBuffer *gst_rtp_L16_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static void
gst_rtp_L16_depay_class_init (GstRtpL16DepayClass * klass)
gstrtpbasedepayload_class = (GstRTPBaseDepayloadClass *) klass;
gstrtpbasedepayload_class->set_caps = gst_rtp_L16_depay_setcaps;
- gstrtpbasedepayload_class->process = gst_rtp_L16_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_L16_depay_process;
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_L16_depay_src_template));
}
static GstBuffer *
-gst_rtp_L16_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_L16_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstRtpL16Depay *rtpL16depay;
GstBuffer *outbuf;
gint payload_len;
gboolean marker;
- GstRTPBuffer rtp = { NULL };
rtpL16depay = GST_RTP_L16_DEPAY (depayload);
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
if (payload_len <= 0)
goto empty_packet;
GST_DEBUG_OBJECT (rtpL16depay, "got payload of %d bytes", payload_len);
- outbuf = gst_rtp_buffer_get_payload_buffer (&rtp);
- marker = gst_rtp_buffer_get_marker (&rtp);
+ outbuf = gst_rtp_buffer_get_payload_buffer (rtp);
+ marker = gst_rtp_buffer_get_marker (rtp);
if (marker) {
/* mark talk spurt with RESYNC */
goto reorder_failed;
}
- gst_rtp_buffer_unmap (&rtp);
-
return outbuf;
/* ERRORS */
{
GST_ELEMENT_WARNING (rtpL16depay, STREAM, DECODE,
("Empty Payload."), (NULL));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
reorder_failed:
{
GST_ELEMENT_ERROR (rtpL16depay, STREAM, DECODE,
("Channel reordering failed."), (NULL));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
}
static gboolean gst_rtp_L24_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
static GstBuffer *gst_rtp_L24_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static void
gst_rtp_L24_depay_class_init (GstRtpL24DepayClass * klass)
gstrtpbasedepayload_class = (GstRTPBaseDepayloadClass *) klass;
gstrtpbasedepayload_class->set_caps = gst_rtp_L24_depay_setcaps;
- gstrtpbasedepayload_class->process = gst_rtp_L24_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_L24_depay_process;
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_rtp_L24_depay_src_template));
}
static GstBuffer *
-gst_rtp_L24_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_L24_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstRtpL24Depay *rtpL24depay;
GstBuffer *outbuf;
gint payload_len;
gboolean marker;
- GstRTPBuffer rtp = { NULL };
rtpL24depay = GST_RTP_L24_DEPAY (depayload);
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
if (payload_len <= 0)
goto empty_packet;
GST_DEBUG_OBJECT (rtpL24depay, "got payload of %d bytes", payload_len);
- outbuf = gst_rtp_buffer_get_payload_buffer (&rtp);
- marker = gst_rtp_buffer_get_marker (&rtp);
+ outbuf = gst_rtp_buffer_get_payload_buffer (rtp);
+ marker = gst_rtp_buffer_get_marker (rtp);
if (marker) {
/* mark talk spurt with RESYNC */
goto reorder_failed;
}
- gst_rtp_buffer_unmap (&rtp);
-
return outbuf;
/* ERRORS */
{
GST_ELEMENT_WARNING (rtpL24depay, STREAM, DECODE,
("Empty Payload."), (NULL));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
reorder_failed:
{
GST_ELEMENT_ERROR (rtpL24depay, STREAM, DECODE,
("Channel reordering failed."), (NULL));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
}
static gboolean gst_rtp_ac3_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
static GstBuffer *gst_rtp_ac3_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static void
gst_rtp_ac3_depay_class_init (GstRtpAC3DepayClass * klass)
"Wim Taymans <wim.taymans@gmail.com>");
gstrtpbasedepayload_class->set_caps = gst_rtp_ac3_depay_setcaps;
- gstrtpbasedepayload_class->process = gst_rtp_ac3_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_ac3_depay_process;
GST_DEBUG_CATEGORY_INIT (rtpac3depay_debug, "rtpac3depay", 0,
"AC3 Audio RTP Depayloader");
}
static GstBuffer *
-gst_rtp_ac3_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_ac3_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstRtpAC3Depay *rtpac3depay;
GstBuffer *outbuf;
- GstRTPBuffer rtp = { NULL, };
guint8 *payload;
guint16 FT, NF;
rtpac3depay = GST_RTP_AC3_DEPAY (depayload);
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
-
- if (gst_rtp_buffer_get_payload_len (&rtp) < 2)
+ if (gst_rtp_buffer_get_payload_len (rtp) < 2)
goto empty_packet;
- payload = gst_rtp_buffer_get_payload (&rtp);
+ payload = gst_rtp_buffer_get_payload (rtp);
/* strip off header
*
GST_DEBUG_OBJECT (rtpac3depay, "FT: %d, NF: %d", FT, NF);
/* We don't bother with fragmented packets yet */
- outbuf = gst_rtp_buffer_get_payload_subbuffer (&rtp, 2, -1);
-
- gst_rtp_buffer_unmap (&rtp);
+ outbuf = gst_rtp_buffer_get_payload_subbuffer (rtp, 2, -1);
if (outbuf)
GST_DEBUG_OBJECT (rtpac3depay, "pushing buffer of size %" G_GSIZE_FORMAT,
{
GST_ELEMENT_WARNING (rtpac3depay, STREAM, DECODE,
("Empty Payload."), (NULL));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
}
static gboolean gst_rtp_amr_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
static GstBuffer *gst_rtp_amr_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
#define gst_rtp_amr_depay_parent_class parent_class
G_DEFINE_TYPE (GstRtpAMRDepay, gst_rtp_amr_depay, GST_TYPE_RTP_BASE_DEPAYLOAD);
"Extracts AMR or AMR-WB audio from RTP packets (RFC 3267)",
"Wim Taymans <wim.taymans@gmail.com>");
- gstrtpbasedepayload_class->process = gst_rtp_amr_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_amr_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_amr_depay_setcaps;
GST_DEBUG_CATEGORY_INIT (rtpamrdepay_debug, "rtpamrdepay", 0,
};
static GstBuffer *
-gst_rtp_amr_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_amr_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstRtpAMRDepay *rtpamrdepay;
const gint *frame_size;
GstBuffer *outbuf = NULL;
gint payload_len;
- GstRTPBuffer rtp = { NULL };
GstMapInfo map;
rtpamrdepay = GST_RTP_AMR_DEPAY (depayload);
else
frame_size = wb_frame_size;
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
-
/* when we get here, 1 channel, 8000/16000 Hz, octet aligned, no CRC,
* no robust sorting, no interleaving data is to be depayloaded */
{
gint amr_len;
gint ILL, ILP;
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
/* need at least 2 bytes for the header */
if (payload_len < 2)
goto too_small;
- payload = gst_rtp_buffer_get_payload (&rtp);
+ payload = gst_rtp_buffer_get_payload (rtp);
/* depay CMR. The CMR is used by the sender to request
* a new encoding mode.
/* we can set the duration because each packet is 20 milliseconds */
GST_BUFFER_DURATION (outbuf) = num_packets * 20 * GST_MSECOND;
- if (gst_rtp_buffer_get_marker (&rtp)) {
+ if (gst_rtp_buffer_get_marker (rtp)) {
/* marker bit marks a buffer after a talkspurt. */
GST_DEBUG_OBJECT (depayload, "marker bit was set");
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_RESYNC);
gst_buffer_get_size (outbuf));
}
- gst_rtp_buffer_unmap (&rtp);
return outbuf;
/* ERRORS */
bad_packet:
{
/* no fatal error */
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
}
);
static GstBuffer *gst_rtp_bv_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static gboolean gst_rtp_bv_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
"Extracts BroadcomVoice audio from RTP packets (RFC 4298)",
"Wim Taymans <wim.taymans@collabora.co.uk>");
- gstrtpbasedepayload_class->process = gst_rtp_bv_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_bv_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_bv_depay_setcaps;
}
}
static GstBuffer *
-gst_rtp_bv_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_bv_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstBuffer *outbuf;
gboolean marker;
- GstRTPBuffer rtp = { NULL, };
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
-
- marker = gst_rtp_buffer_get_marker (&rtp);
+ marker = gst_rtp_buffer_get_marker (rtp);
GST_DEBUG ("process : got %" G_GSIZE_FORMAT " bytes, mark %d ts %u seqn %d",
- gst_buffer_get_size (buf), marker,
- gst_rtp_buffer_get_timestamp (&rtp), gst_rtp_buffer_get_seq (&rtp));
+ gst_buffer_get_size (rtp->buffer), marker,
+ gst_rtp_buffer_get_timestamp (rtp), gst_rtp_buffer_get_seq (rtp));
- outbuf = gst_rtp_buffer_get_payload_buffer (&rtp);
- gst_rtp_buffer_unmap (&rtp);
+ outbuf = gst_rtp_buffer_get_payload_buffer (rtp);
if (marker && outbuf) {
/* mark start of talkspurt with RESYNC */
);
static GstBuffer *gst_rtp_celt_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static gboolean gst_rtp_celt_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
"Extracts CELT audio from RTP packets",
"Wim Taymans <wim.taymans@gmail.com>");
- gstrtpbasedepayload_class->process = gst_rtp_celt_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_celt_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_celt_depay_setcaps;
}
}
static GstBuffer *
-gst_rtp_celt_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_celt_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstBuffer *outbuf = NULL;
guint8 *payload;
GstClockTime framesize_ns = 0, timestamp;
guint n = 0;
GstRtpCELTDepay *rtpceltdepay;
- GstRTPBuffer rtp = { NULL, };
rtpceltdepay = GST_RTP_CELT_DEPAY (depayload);
clock_rate = depayload->clock_rate;
frame_size = rtpceltdepay->frame_size;
framesize_ns = gst_util_uint64_scale_int (frame_size, GST_SECOND, clock_rate);
- timestamp = GST_BUFFER_PTS (buf);
-
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
+ timestamp = GST_BUFFER_PTS (rtp->buffer);
GST_LOG_OBJECT (depayload,
"got %" G_GSIZE_FORMAT " bytes, mark %d ts %u seqn %d",
- gst_buffer_get_size (buf), gst_rtp_buffer_get_marker (&rtp),
- gst_rtp_buffer_get_timestamp (&rtp), gst_rtp_buffer_get_seq (&rtp));
+ gst_buffer_get_size (rtp->buffer), gst_rtp_buffer_get_marker (rtp),
+ gst_rtp_buffer_get_timestamp (rtp), gst_rtp_buffer_get_seq (rtp));
GST_LOG_OBJECT (depayload, "got clock-rate=%d, frame_size=%d, "
"_ns=%" GST_TIME_FORMAT ", timestamp=%" GST_TIME_FORMAT, clock_rate,
frame_size, GST_TIME_ARGS (framesize_ns), GST_TIME_ARGS (timestamp));
- payload = gst_rtp_buffer_get_payload (&rtp);
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
+ payload = gst_rtp_buffer_get_payload (rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
/* first count how many bytes are consumed by the size headers and make offset
* point to the first data byte */
total_size += s + 1;
} while (s == 0xff);
- outbuf = gst_rtp_buffer_get_payload_subbuffer (&rtp, offset, size);
+ outbuf = gst_rtp_buffer_get_payload_subbuffer (rtp, offset, size);
offset += size;
if (frame_size != -1 && clock_rate != -1) {
gst_rtp_base_depayload_push (depayload, outbuf);
}
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
gst_rtp_dv_depay_change_state (GstElement * element, GstStateChange transition);
static GstBuffer *gst_rtp_dv_depay_process (GstRTPBaseDepayload * base,
- GstBuffer * in);
+ GstRTPBuffer * rtp);
static gboolean gst_rtp_dv_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
"Depayloads DV from RTP packets (RFC 3189)",
"Marcel Moreaux <marcelm@spacelabs.nl>, Wim Taymans <wim.taymans@gmail.com>");
- gstrtpbasedepayload_class->process =
+ gstrtpbasedepayload_class->process_rtp_packet =
GST_DEBUG_FUNCPTR (gst_rtp_dv_depay_process);
gstrtpbasedepayload_class->set_caps =
GST_DEBUG_FUNCPTR (gst_rtp_dv_depay_setcaps);
* NTSC.
*/
static GstBuffer *
-gst_rtp_dv_depay_process (GstRTPBaseDepayload * base, GstBuffer * in)
+gst_rtp_dv_depay_process (GstRTPBaseDepayload * base, GstRTPBuffer * rtp)
{
GstBuffer *out = NULL;
guint8 *payload;
guint payload_len, location;
GstRTPDVDepay *dvdepay = GST_RTP_DV_DEPAY (base);
gboolean marker;
- GstRTPBuffer rtp = { NULL, };
GstMapInfo map;
- gst_rtp_buffer_map (in, GST_MAP_READ, &rtp);
-
- marker = gst_rtp_buffer_get_marker (&rtp);
+ marker = gst_rtp_buffer_get_marker (rtp);
/* Check if the received packet contains (the start of) a new frame, we do
* this by checking the RTP timestamp. */
- rtp_ts = gst_rtp_buffer_get_timestamp (&rtp);
+ rtp_ts = gst_rtp_buffer_get_timestamp (rtp);
/* we cannot copy the packet yet if the marker is set, we will do that below
* after taking out the data */
}
/* Extract the payload */
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
- payload = gst_rtp_buffer_get_payload (&rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
+ payload = gst_rtp_buffer_get_payload (rtp);
/* copy all DIF chunks in their place. */
gst_buffer_map (dvdepay->acc, &map, GST_MAP_READWRITE);
payload += 80;
payload_len -= 80;
}
- gst_rtp_buffer_unmap (&rtp);
gst_buffer_unmap (dvdepay->acc, &map);
if (marker) {
static gboolean gst_rtp_g722_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
static GstBuffer *gst_rtp_g722_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static void
gst_rtp_g722_depay_class_init (GstRtpG722DepayClass * klass)
"Wim Taymans <wim.taymans@gmail.com>");
gstrtpbasedepayload_class->set_caps = gst_rtp_g722_depay_setcaps;
- gstrtpbasedepayload_class->process = gst_rtp_g722_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_g722_depay_process;
}
static void
}
static GstBuffer *
-gst_rtp_g722_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_g722_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstRtpG722Depay *rtpg722depay;
GstBuffer *outbuf;
gint payload_len;
gboolean marker;
- GstRTPBuffer rtp = { NULL };
rtpg722depay = GST_RTP_G722_DEPAY (depayload);
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
-
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
if (payload_len <= 0)
goto empty_packet;
GST_DEBUG_OBJECT (rtpg722depay, "got payload of %d bytes", payload_len);
- outbuf = gst_rtp_buffer_get_payload_buffer (&rtp);
- marker = gst_rtp_buffer_get_marker (&rtp);
- gst_rtp_buffer_unmap (&rtp);
+ outbuf = gst_rtp_buffer_get_payload_buffer (rtp);
+ marker = gst_rtp_buffer_get_marker (rtp);
if (marker && outbuf) {
/* mark talk spurt with RESYNC */
{
GST_ELEMENT_WARNING (rtpg722depay, STREAM, DECODE,
("Empty Payload."), (NULL));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
}
static gboolean gst_rtp_g723_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
static GstBuffer *gst_rtp_g723_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
#define gst_rtp_g723_depay_parent_class parent_class
G_DEFINE_TYPE (GstRtpG723Depay, gst_rtp_g723_depay,
"Extracts G.723 audio from RTP packets (RFC 3551)",
"Wim Taymans <wim.taymans@gmail.com>");
- gstrtpbasedepayload_class->process = gst_rtp_g723_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_g723_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_g723_depay_setcaps;
}
static GstBuffer *
-gst_rtp_g723_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_g723_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstRtpG723Depay *rtpg723depay;
GstBuffer *outbuf = NULL;
gint payload_len;
gboolean marker;
- GstRTPBuffer rtp = { NULL };
rtpg723depay = GST_RTP_G723_DEPAY (depayload);
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
-
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
/* At least 4 bytes */
if (payload_len < 4)
GST_LOG_OBJECT (rtpg723depay, "payload len %d", payload_len);
- outbuf = gst_rtp_buffer_get_payload_buffer (&rtp);
- marker = gst_rtp_buffer_get_marker (&rtp);
- gst_rtp_buffer_unmap (&rtp);
+ outbuf = gst_rtp_buffer_get_payload_buffer (rtp);
+ marker = gst_rtp_buffer_get_marker (rtp);
if (marker) {
/* marker bit starts talkspurt */
bad_packet:
{
/* no fatal error */
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
}
const GValue * value, GParamSpec * pspec);
static GstBuffer *gst_rtp_g726_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static gboolean gst_rtp_g726_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
"Extracts G.726 audio from RTP packets",
"Axis Communications <dev-gstreamer@axis.com>");
- gstrtpbasedepayload_class->process = gst_rtp_g726_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_g726_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_g726_depay_setcaps;
}
static GstBuffer *
-gst_rtp_g726_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_g726_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstRtpG726Depay *depay;
GstBuffer *outbuf = NULL;
gboolean marker;
- GstRTPBuffer rtp = { NULL };
depay = GST_RTP_G726_DEPAY (depayload);
- gst_rtp_buffer_map (buf, GST_MAP_READWRITE, &rtp);
-
- marker = gst_rtp_buffer_get_marker (&rtp);
+ marker = gst_rtp_buffer_get_marker (rtp);
GST_DEBUG ("process : got %" G_GSIZE_FORMAT " bytes, mark %d ts %u seqn %d",
- gst_buffer_get_size (buf), marker,
- gst_rtp_buffer_get_timestamp (&rtp), gst_rtp_buffer_get_seq (&rtp));
+ gst_buffer_get_size (rtp->buffer), marker,
+ gst_rtp_buffer_get_timestamp (rtp), gst_rtp_buffer_get_seq (rtp));
if (depay->aal2 || depay->force_aal2) {
/* AAL2, we can just copy the bytes */
- outbuf = gst_rtp_buffer_get_payload_buffer (&rtp);
+ outbuf = gst_rtp_buffer_get_payload_buffer (rtp);
if (!outbuf)
goto bad_len;
} else {
guint len;
GstMapInfo map;
- in = gst_rtp_buffer_get_payload (&rtp);
- len = gst_rtp_buffer_get_payload_len (&rtp);
+ in = gst_rtp_buffer_get_payload (rtp);
+ len = gst_rtp_buffer_get_payload_len (rtp);
- outbuf = gst_rtp_buffer_get_payload_buffer (&rtp);
+ outbuf = gst_rtp_buffer_get_payload_buffer (rtp);
if (!outbuf)
goto bad_len;
outbuf = gst_buffer_make_writable (outbuf);
gst_buffer_unmap (outbuf, &map);
}
- gst_rtp_buffer_unmap (&rtp);
-
if (marker) {
/* mark start of talkspurt with RESYNC */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_RESYNC);
bad_len:
{
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
-
}
static void
static gboolean gst_rtp_g729_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
static GstBuffer *gst_rtp_g729_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
#define gst_rtp_g729_depay_parent_class parent_class
G_DEFINE_TYPE (GstRtpG729Depay, gst_rtp_g729_depay,
"Extracts G.729 audio from RTP packets (RFC 3551)",
"Laurent Glayal <spglegle@yahoo.fr>");
- gstrtpbasedepayload_class->process = gst_rtp_g729_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_g729_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_g729_depay_setcaps;
}
}
static GstBuffer *
-gst_rtp_g729_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_g729_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstRtpG729Depay *rtpg729depay;
GstBuffer *outbuf = NULL;
gint payload_len;
gboolean marker;
- GstRTPBuffer rtp = { NULL };
rtpg729depay = GST_RTP_G729_DEPAY (depayload);
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
-
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
/* At least 2 bytes (CNG from G729 Annex B) */
if (payload_len < 2) {
GST_LOG_OBJECT (rtpg729depay, "G729 payload contains CNG frame");
}
- outbuf = gst_rtp_buffer_get_payload_buffer (&rtp);
- marker = gst_rtp_buffer_get_marker (&rtp);
-
- gst_rtp_buffer_unmap (&rtp);
+ outbuf = gst_rtp_buffer_get_payload_buffer (rtp);
+ marker = gst_rtp_buffer_get_marker (rtp);
if (marker) {
/* marker bit starts talkspurt */
bad_packet:
{
/* no fatal error */
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
}
);
static GstBuffer *gst_rtp_gsm_depay_process (GstRTPBaseDepayload * _depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static gboolean gst_rtp_gsm_depay_setcaps (GstRTPBaseDepayload * _depayload,
GstCaps * caps);
"RTP GSM depayloader", "Codec/Depayloader/Network/RTP",
"Extracts GSM audio from RTP packets", "Zeeshan Ali <zeenix@gmail.com>");
- gstrtpbase_depayload_class->process = gst_rtp_gsm_depay_process;
+ gstrtpbase_depayload_class->process_rtp_packet = gst_rtp_gsm_depay_process;
gstrtpbase_depayload_class->set_caps = gst_rtp_gsm_depay_setcaps;
GST_DEBUG_CATEGORY_INIT (rtpgsmdepay_debug, "rtpgsmdepay", 0,
}
static GstBuffer *
-gst_rtp_gsm_depay_process (GstRTPBaseDepayload * _depayload, GstBuffer * buf)
+gst_rtp_gsm_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstBuffer *outbuf = NULL;
gboolean marker;
- GstRTPBuffer rtp = { NULL };
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
-
- marker = gst_rtp_buffer_get_marker (&rtp);
+ marker = gst_rtp_buffer_get_marker (rtp);
GST_DEBUG ("process : got %" G_GSIZE_FORMAT " bytes, mark %d ts %u seqn %d",
- gst_buffer_get_size (buf), marker,
- gst_rtp_buffer_get_timestamp (&rtp), gst_rtp_buffer_get_seq (&rtp));
-
- outbuf = gst_rtp_buffer_get_payload_buffer (&rtp);
+ gst_buffer_get_size (rtp->buffer), marker,
+ gst_rtp_buffer_get_timestamp (rtp), gst_rtp_buffer_get_seq (rtp));
- gst_rtp_buffer_unmap (&rtp);
+ outbuf = gst_rtp_buffer_get_payload_buffer (rtp);
if (marker && outbuf) {
/* mark start of talkspurt with RESYNC */
static gboolean gst_rtp_gst_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
static GstBuffer *gst_rtp_gst_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static void
gst_rtp_gst_depay_class_init (GstRtpGSTDepayClass * klass)
gstrtpbasedepayload_class->handle_event = gst_rtp_gst_depay_handle_event;
gstrtpbasedepayload_class->set_caps = gst_rtp_gst_depay_setcaps;
- gstrtpbasedepayload_class->process = gst_rtp_gst_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_gst_depay_process;
}
static void
}
static GstBuffer *
-gst_rtp_gst_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_gst_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstRtpGSTDepay *rtpgstdepay;
GstBuffer *subbuf, *outbuf = NULL;
gint payload_len;
guint8 *payload;
guint CV, frag_offset, avail, offset;
- GstRTPBuffer rtp = { NULL };
rtpgstdepay = GST_RTP_GST_DEPAY (depayload);
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
-
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
if (payload_len <= 8)
goto empty_packet;
- if (GST_BUFFER_IS_DISCONT (buf)) {
+ if (GST_BUFFER_IS_DISCONT (rtp->buffer)) {
GST_WARNING_OBJECT (rtpgstdepay, "DISCONT, clear adapter");
gst_adapter_clear (rtpgstdepay->adapter);
}
- payload = gst_rtp_buffer_get_payload (&rtp);
+ payload = gst_rtp_buffer_get_payload (rtp);
/* strip off header
*
goto wrong_frag;
/* subbuffer skipping the 8 header bytes */
- subbuf = gst_rtp_buffer_get_payload_subbuffer (&rtp, 8, -1);
+ subbuf = gst_rtp_buffer_get_payload_subbuffer (rtp, 8, -1);
gst_adapter_push (rtpgstdepay->adapter, subbuf);
offset = 0;
- if (gst_rtp_buffer_get_marker (&rtp)) {
+ if (gst_rtp_buffer_get_marker (rtp)) {
guint avail;
GstCaps *outcaps;
outbuf = NULL;
}
}
- gst_rtp_buffer_unmap (&rtp);
return outbuf;
{
GST_ELEMENT_WARNING (rtpgstdepay, STREAM, DECODE,
("Empty Payload."), (NULL));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
wrong_frag:
{
gst_adapter_clear (rtpgstdepay->adapter);
- gst_rtp_buffer_unmap (&rtp);
GST_LOG_OBJECT (rtpgstdepay, "wrong fragment, skipping");
return NULL;
}
{
GST_WARNING_OBJECT (rtpgstdepay, "failed to parse caps");
gst_buffer_unref (outbuf);
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
no_event:
{
GST_WARNING_OBJECT (rtpgstdepay, "failed to parse event");
gst_buffer_unref (outbuf);
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
missing_caps:
GST_ELEMENT_WARNING (rtpgstdepay, STREAM, DECODE,
("Missing caps %u.", CV), (NULL));
gst_buffer_unref (outbuf);
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
}
#define parent_class gst_rtp_h261_depay_parent_class
static GstBuffer *
-gst_rtp_h261_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_h261_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstRtpH261Depay *depay;
GstBuffer *outbuf = NULL;
const guint header_len = GST_RTP_H261_PAYLOAD_HEADER_LEN;
gboolean marker;
GstRtpH261PayHeader *header;
- GstRTPBuffer rtp = GST_RTP_BUFFER_INIT;
depay = GST_RTP_H261_DEPAY (depayload);
- if (GST_BUFFER_IS_DISCONT (buf)) {
+ if (GST_BUFFER_IS_DISCONT (rtp->buffer)) {
GST_DEBUG_OBJECT (depay, "Discont buffer, flushing adapter");
gst_adapter_clear (depay->adapter);
depay->leftover = NO_LEFTOVER;
depay->start = FALSE;
}
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
+ payload = gst_rtp_buffer_get_payload (rtp);
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
- payload = gst_rtp_buffer_get_payload (&rtp);
-
- marker = gst_rtp_buffer_get_marker (&rtp);
+ marker = gst_rtp_buffer_get_marker (rtp);
if (payload_len < 4) {
GST_WARNING_OBJECT (depay,
"Dropping packet with payload length invalid length");
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
if (header->ebit == 0) {
/* H.261 stream ends on byte boundary, take entire packet */
gst_adapter_push (depay->adapter,
- gst_rtp_buffer_get_payload_subbuffer (&rtp, header_len, payload_len));
+ gst_rtp_buffer_get_payload_subbuffer (rtp, header_len, payload_len));
} else {
/* Take the entire buffer except for the last byte, which will be kept to
* merge with next packet */
gst_adapter_push (depay->adapter,
- gst_rtp_buffer_get_payload_subbuffer (&rtp, header_len,
+ gst_rtp_buffer_get_payload_subbuffer (rtp, header_len,
payload_len - 1));
depay->leftover = payload[payload_len - 1] & (0xFF << header->ebit);
}
depay->start = TRUE;
}
}
- gst_rtp_buffer_unmap (&rtp);
return outbuf;
}
"Extracts H261 video from RTP packets (RFC 4587)",
"Stian Selnes <stian@pexip.com>");
- gstrtpbasedepayload_class->process = gst_rtp_h261_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_h261_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_h261_depay_setcaps;
gobject_class->dispose = gst_rtp_h261_depay_dispose;
element, GstStateChange transition);
static GstBuffer *gst_rtp_h263_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
gboolean gst_rtp_h263_depay_setcaps (GstRTPBaseDepayload * filter,
GstCaps * caps);
"Philippe Kalaf <philippe.kalaf@collabora.co.uk>, "
"Edward Hervey <bilboed@bilboed.com>");
- gstrtpbasedepayload_class->process = gst_rtp_h263_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_h263_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_h263_depay_setcaps;
}
}
static GstBuffer *
-gst_rtp_h263_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_h263_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstRtpH263Depay *rtph263depay;
GstBuffer *outbuf;
guint SBIT, EBIT;
gboolean F, P, M;
gboolean I;
- GstRTPBuffer rtp = { NULL };
rtph263depay = GST_RTP_H263_DEPAY (depayload);
/* flush remaining data on discont */
- if (GST_BUFFER_IS_DISCONT (buf)) {
+ if (GST_BUFFER_IS_DISCONT (rtp->buffer)) {
GST_LOG_OBJECT (depayload, "Discont buffer, flushing adapter");
gst_adapter_clear (rtph263depay->adapter);
rtph263depay->offset = 0;
rtph263depay->start = FALSE;
}
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
+ payload = gst_rtp_buffer_get_payload (rtp);
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
- payload = gst_rtp_buffer_get_payload (&rtp);
-
- M = gst_rtp_buffer_get_marker (&rtp);
+ M = gst_rtp_buffer_get_marker (rtp);
if (payload_len < 1)
goto too_small;
GstBuffer *tmp;
/* Take the entire buffer */
- tmp = gst_rtp_buffer_get_payload_subbuffer (&rtp, header_len, payload_len);
+ tmp = gst_rtp_buffer_get_payload_subbuffer (rtp, header_len, payload_len);
gst_adapter_push (rtph263depay->adapter, tmp);
} else {
GstBuffer *tmp;
/* Take the entire buffer except for the last byte */
- tmp = gst_rtp_buffer_get_payload_subbuffer (&rtp, header_len,
+ tmp = gst_rtp_buffer_get_payload_subbuffer (rtp, header_len,
payload_len - 1);
gst_adapter_push (rtph263depay->adapter, tmp);
rtph263depay->start = TRUE;
}
}
- gst_rtp_buffer_unmap (&rtp);
return NULL;
{
GST_ELEMENT_WARNING (rtph263depay, STREAM, DECODE,
("Packet payload was too small"), (NULL));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
}
element, GstStateChange transition);
static GstBuffer *gst_rtp_h263p_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
gboolean gst_rtp_h263p_depay_setcaps (GstRTPBaseDepayload * filter,
GstCaps * caps);
"Extracts H263/+/++ video from RTP packets (RFC 4629)",
"Wim Taymans <wim.taymans@gmail.com>");
- gstrtpbasedepayload_class->process = gst_rtp_h263p_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_h263p_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_h263p_depay_setcaps;
GST_DEBUG_CATEGORY_INIT (rtph263pdepay_debug, "rtph263pdepay", 0,
}
static GstBuffer *
-gst_rtp_h263p_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_h263p_depay_process (GstRTPBaseDepayload * depayload,
+ GstRTPBuffer * rtp)
{
GstRtpH263PDepay *rtph263pdepay;
GstBuffer *outbuf;
gboolean P, V, M;
guint header_len;
guint8 PLEN, PEBIT;
- GstRTPBuffer rtp = { NULL };
rtph263pdepay = GST_RTP_H263P_DEPAY (depayload);
/* flush remaining data on discont */
- if (GST_BUFFER_IS_DISCONT (buf)) {
+ if (GST_BUFFER_IS_DISCONT (rtp->buffer)) {
GST_LOG_OBJECT (depayload, "DISCONT, flushing adapter");
gst_adapter_clear (rtph263pdepay->adapter);
rtph263pdepay->wait_start = TRUE;
}
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
-
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
header_len = 2;
if (payload_len < header_len)
goto too_small;
- payload = gst_rtp_buffer_get_payload (&rtp);
+ payload = gst_rtp_buffer_get_payload (rtp);
- M = gst_rtp_buffer_get_marker (&rtp);
+ M = gst_rtp_buffer_get_marker (rtp);
/* 0 1
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
GST_LOG_OBJECT (depayload, "Frame complete");
outbuf =
- gst_rtp_buffer_get_payload_subbuffer (&rtp, header_len, payload_len);
+ gst_rtp_buffer_get_payload_subbuffer (rtp, header_len, payload_len);
gst_adapter_push (rtph263pdepay->adapter, outbuf);
outbuf = NULL;
gst_buffer_memset (padbuf, 0, 0, padlen);
outbuf = gst_buffer_append (outbuf, padbuf);
}
- gst_rtp_buffer_unmap (&rtp);
return outbuf;
-
} else {
/* frame not completed: store in adapter */
GST_LOG_OBJECT (depayload, "Frame incomplete, storing %d", payload_len);
outbuf =
- gst_rtp_buffer_get_payload_subbuffer (&rtp, header_len, payload_len);
+ gst_rtp_buffer_get_payload_subbuffer (rtp, header_len, payload_len);
gst_adapter_push (rtph263pdepay->adapter, outbuf);
- gst_rtp_buffer_unmap (&rtp);
}
return NULL;
{
GST_ELEMENT_WARNING (rtph263pdepay, STREAM, DECODE,
("Packet payload was too small"), (NULL));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
waiting_start:
{
GST_DEBUG_OBJECT (rtph263pdepay, "waiting for picture start");
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
}
element, GstStateChange transition);
static GstBuffer *gst_rtp_h264_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static gboolean gst_rtp_h264_depay_setcaps (GstRTPBaseDepayload * filter,
GstCaps * caps);
static gboolean gst_rtp_h264_depay_handle_event (GstRTPBaseDepayload * depay,
"Wim Taymans <wim.taymans@gmail.com>");
gstelement_class->change_state = gst_rtp_h264_depay_change_state;
- gstrtpbasedepayload_class->process = gst_rtp_h264_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_h264_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_h264_depay_setcaps;
gstrtpbasedepayload_class->handle_event = gst_rtp_h264_depay_handle_event;
}
}
static GstBuffer *
-gst_rtp_h264_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_h264_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstRtpH264Depay *rtph264depay;
GstBuffer *outbuf = NULL;
guint8 nal_unit_type;
- GstRTPBuffer rtp = { NULL };
rtph264depay = GST_RTP_H264_DEPAY (depayload);
/* flush remaining data on discont */
- if (GST_BUFFER_IS_DISCONT (buf)) {
+ if (GST_BUFFER_IS_DISCONT (rtp->buffer)) {
gst_adapter_clear (rtph264depay->adapter);
rtph264depay->wait_start = TRUE;
rtph264depay->current_fu_type = 0;
GstClockTime timestamp;
gboolean marker;
- timestamp = GST_BUFFER_PTS (buf);
+ timestamp = GST_BUFFER_PTS (rtp->buffer);
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
-
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
- payload = gst_rtp_buffer_get_payload (&rtp);
- marker = gst_rtp_buffer_get_marker (&rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
+ payload = gst_rtp_buffer_get_payload (rtp);
+ marker = gst_rtp_buffer_get_marker (rtp);
GST_DEBUG_OBJECT (rtph264depay, "receiving %d bytes", payload_len);
break;
}
}
- gst_rtp_buffer_unmap (&rtp);
}
return outbuf;
empty_packet:
{
GST_DEBUG_OBJECT (rtph264depay, "empty packet");
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
undefined_type:
{
GST_ELEMENT_WARNING (rtph264depay, STREAM, DECODE,
(NULL), ("Undefined packet type"));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
waiting_start:
{
GST_DEBUG_OBJECT (rtph264depay, "waiting for start");
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
not_implemented:
{
GST_ELEMENT_ERROR (rtph264depay, STREAM, FORMAT,
(NULL), ("NAL unit type %d not supported yet", nal_unit_type));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
}
guint prop_id, GValue * value, GParamSpec * pspec);
static GstBuffer *gst_rtp_ilbc_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static gboolean gst_rtp_ilbc_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
"Extracts iLBC audio from RTP packets (RFC 3952)",
"Philippe Kalaf <philippe.kalaf@collabora.co.uk>");
- gstrtpbasedepayload_class->process = gst_rtp_ilbc_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_ilbc_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_ilbc_depay_setcaps;
}
}
static GstBuffer *
-gst_rtp_ilbc_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_ilbc_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstBuffer *outbuf;
gboolean marker;
- GstRTPBuffer rtp = { NULL };
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
-
- marker = gst_rtp_buffer_get_marker (&rtp);
+ marker = gst_rtp_buffer_get_marker (rtp);
GST_DEBUG ("process : got %" G_GSIZE_FORMAT " bytes, mark %d ts %u seqn %d",
- gst_buffer_get_size (buf), marker,
- gst_rtp_buffer_get_timestamp (&rtp), gst_rtp_buffer_get_seq (&rtp));
-
- outbuf = gst_rtp_buffer_get_payload_buffer (&rtp);
+ gst_buffer_get_size (rtp->buffer), marker,
+ gst_rtp_buffer_get_timestamp (rtp), gst_rtp_buffer_get_seq (rtp));
- gst_rtp_buffer_unmap (&rtp);
+ outbuf = gst_rtp_buffer_get_payload_buffer (rtp);
if (marker && outbuf) {
/* mark start of talkspurt with RESYNC */
static gboolean gst_rtp_j2k_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
static GstBuffer *gst_rtp_j2k_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static void
gst_rtp_j2k_depay_class_init (GstRtpJ2KDepayClass * klass)
gstelement_class->change_state = gst_rtp_j2k_depay_change_state;
gstrtpbasedepayload_class->set_caps = gst_rtp_j2k_depay_setcaps;
- gstrtpbasedepayload_class->process = gst_rtp_j2k_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_j2k_depay_process;
GST_DEBUG_CATEGORY_INIT (rtpj2kdepay_debug, "rtpj2kdepay", 0,
"J2K Video RTP Depayloader");
}
static GstBuffer *
-gst_rtp_j2k_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_j2k_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstRtpJ2KDepay *rtpj2kdepay;
guint8 *payload;
guint MHF, mh_id, frag_offset, tile, payload_len, j2klen;
gint gap;
guint32 rtptime;
- GstRTPBuffer rtp = { NULL };
rtpj2kdepay = GST_RTP_J2K_DEPAY (depayload);
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
-
- payload = gst_rtp_buffer_get_payload (&rtp);
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
+ payload = gst_rtp_buffer_get_payload (rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
/* we need at least a header */
if (payload_len < 8)
goto empty_packet;
- rtptime = gst_rtp_buffer_get_timestamp (&rtp);
+ rtptime = gst_rtp_buffer_get_timestamp (rtp);
/* new timestamp marks new frame */
if (rtpj2kdepay->last_rtptime != rtptime) {
}
/* and push in pu adapter */
GST_DEBUG_OBJECT (rtpj2kdepay, "push pu of size %u in adapter", j2klen);
- pu_frag = gst_rtp_buffer_get_payload_subbuffer (&rtp, 8, -1);
+ pu_frag = gst_rtp_buffer_get_payload_subbuffer (rtp, 8, -1);
gst_adapter_push (rtpj2kdepay->pu_adapter, pu_frag);
if (MHF & 2) {
}
/* marker bit finishes the frame */
- if (gst_rtp_buffer_get_marker (&rtp)) {
+ if (gst_rtp_buffer_get_marker (rtp)) {
GST_DEBUG_OBJECT (rtpj2kdepay, "marker set, last buffer");
/* then flush frame */
gst_rtp_j2k_depay_flush_frame (depayload);
}
- gst_rtp_buffer_unmap (&rtp);
return NULL;
{
GST_ELEMENT_WARNING (rtpj2kdepay, STREAM, DECODE,
("Empty Payload."), (NULL));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
wrong_mh_id:
("Invalid mh_id %u, expected %u", mh_id, rtpj2kdepay->last_mh_id),
(NULL));
gst_rtp_j2k_depay_clear_pu (rtpj2kdepay);
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
}
static gboolean gst_rtp_jpeg_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
static GstBuffer *gst_rtp_jpeg_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static void
gst_rtp_jpeg_depay_class_init (GstRtpJPEGDepayClass * klass)
gstelement_class->change_state = gst_rtp_jpeg_depay_change_state;
gstrtpbasedepayload_class->set_caps = gst_rtp_jpeg_depay_setcaps;
- gstrtpbasedepayload_class->process = gst_rtp_jpeg_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_jpeg_depay_process;
GST_DEBUG_CATEGORY_INIT (rtpjpegdepay_debug, "rtpjpegdepay", 0,
"JPEG Video RTP Depayloader");
}
static GstBuffer *
-gst_rtp_jpeg_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_jpeg_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstRtpJPEGDepay *rtpjpegdepay;
GstBuffer *outbuf;
guint type, width, height;
guint16 dri, precision, length;
guint8 *qtable;
- GstRTPBuffer rtp = { NULL };
rtpjpegdepay = GST_RTP_JPEG_DEPAY (depayload);
- if (GST_BUFFER_IS_DISCONT (buf)) {
+ if (GST_BUFFER_IS_DISCONT (rtp->buffer)) {
GST_DEBUG_OBJECT (depayload, "DISCONT, reset adapter");
gst_adapter_clear (rtpjpegdepay->adapter);
rtpjpegdepay->discont = TRUE;
}
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
if (payload_len < 8)
goto empty_packet;
- payload = gst_rtp_buffer_get_payload (&rtp);
+ payload = gst_rtp_buffer_get_payload (rtp);
header_len = 0;
/* 0 1 2 3
/* take JPEG data, push in the adapter */
GST_DEBUG_OBJECT (rtpjpegdepay, "pushing data at offset %d", header_len);
- outbuf = gst_rtp_buffer_get_payload_subbuffer (&rtp, header_len, -1);
+ outbuf = gst_rtp_buffer_get_payload_subbuffer (rtp, header_len, -1);
gst_adapter_push (rtpjpegdepay->adapter, outbuf);
outbuf = NULL;
- if (gst_rtp_buffer_get_marker (&rtp)) {
+ if (gst_rtp_buffer_get_marker (rtp)) {
guint avail;
guint8 end[2];
GstMapInfo map;
GST_DEBUG_OBJECT (rtpjpegdepay, "returning %u bytes", avail);
}
- gst_rtp_buffer_unmap (&rtp);
-
return outbuf;
/* ERRORS */
{
GST_ELEMENT_WARNING (rtpjpegdepay, STREAM, DECODE,
("Empty Payload."), (NULL));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
invalid_dimension:
{
GST_ELEMENT_WARNING (rtpjpegdepay, STREAM, FORMAT,
("Invalid Dimension %dx%d.", width, height), (NULL));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
no_qtable:
{
GST_WARNING_OBJECT (rtpjpegdepay, "no qtable");
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
invalid_packet:
GST_WARNING_OBJECT (rtpjpegdepay, "invalid packet");
gst_adapter_flush (rtpjpegdepay->adapter,
gst_adapter_available (rtpjpegdepay->adapter));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
}
static gboolean gst_rtp_klv_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
static GstBuffer *gst_rtp_klv_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static void gst_rtp_klv_depay_reset (GstRtpKlvDepay * klvdepay);
rtpbasedepayload_class = (GstRTPBaseDepayloadClass *) klass;
rtpbasedepayload_class->set_caps = gst_rtp_klv_depay_setcaps;
- rtpbasedepayload_class->process = gst_rtp_klv_depay_process;
+ rtpbasedepayload_class->process_rtp_packet = gst_rtp_klv_depay_process;
}
static void
/* We're trying to be pragmatic here, not quite as strict as the spec wants
* us to be with regard to marker bits and resyncing after packet loss */
static GstBuffer *
-gst_rtp_klv_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_klv_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstRtpKlvDepay *klvdepay = GST_RTP_KLV_DEPAY (depayload);
- GstRTPBuffer rtp = { NULL };
GstBuffer *payload, *outbuf = NULL;
gboolean marker, start = FALSE, maybe_start;
guint32 rtp_ts;
guint payload_len;
/* Ignore DISCONT on first buffer and on buffers following a discont */
- if (GST_BUFFER_IS_DISCONT (buf) && klvdepay->last_rtp_ts != -1) {
+ if (GST_BUFFER_IS_DISCONT (rtp->buffer) && klvdepay->last_rtp_ts != -1) {
GST_WARNING_OBJECT (klvdepay, "DISCONT, need to resync");
gst_rtp_klv_depay_reset (klvdepay);
}
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
-
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
/* marker bit signals last fragment of a KLV unit */
- marker = gst_rtp_buffer_get_marker (&rtp);
+ marker = gst_rtp_buffer_get_marker (rtp);
- seq = gst_rtp_buffer_get_seq (&rtp);
+ seq = gst_rtp_buffer_get_seq (rtp);
/* packet directly after one with marker bit set => start */
start = klvdepay->last_marker_seq != -1
/* deduce start of new KLV unit in case sender doesn't set marker bits
* (it's not like the spec is ambiguous about that, but what can you do) */
- rtp_ts = gst_rtp_buffer_get_timestamp (&rtp);
+ rtp_ts = gst_rtp_buffer_get_timestamp (rtp);
maybe_start = klvdepay->last_rtp_ts == -1 || klvdepay->last_rtp_ts != rtp_ts;
guint64 v_len;
gsize len_size;
- data = gst_rtp_buffer_get_payload (&rtp);
+ data = gst_rtp_buffer_get_payload (rtp);
if (GST_READ_UINT32_BE (data) == 0x060e2b34 &&
klv_get_vlen (data + 16, payload_len - 16, &v_len, &len_size)) {
if (16 + len_size + v_len == payload_len) {
if (start && !marker)
outbuf = gst_rtp_klv_depay_process_data (klvdepay);
- payload = gst_rtp_buffer_get_payload_buffer (&rtp);
+ payload = gst_rtp_buffer_get_payload_buffer (rtp);
gst_adapter_push (klvdepay->adapter, payload);
if (marker)
done:
- gst_rtp_buffer_unmap (&rtp);
-
return outbuf;
}
static gboolean gst_rtp_mp1s_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
static GstBuffer *gst_rtp_mp1s_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static void
gst_rtp_mp1s_depay_class_init (GstRtpMP1SDepayClass * klass)
gstelement_class = (GstElementClass *) klass;
gstrtpbasedepayload_class = (GstRTPBaseDepayloadClass *) klass;
- gstrtpbasedepayload_class->process = gst_rtp_mp1s_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_mp1s_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_mp1s_depay_setcaps;
gst_element_class_add_pad_template (gstelement_class,
}
static GstBuffer *
-gst_rtp_mp1s_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_mp1s_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstBuffer *outbuf;
- GstRTPBuffer rtp = { NULL };
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
- outbuf = gst_rtp_buffer_get_payload_buffer (&rtp);
- gst_rtp_buffer_unmap (&rtp);
+ outbuf = gst_rtp_buffer_get_payload_buffer (rtp);
if (outbuf)
GST_DEBUG ("gst_rtp_mp1s_depay_chain: pushing buffer of size %"
static gboolean gst_rtp_mp2t_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
static GstBuffer *gst_rtp_mp2t_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static void gst_rtp_mp2t_depay_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
gstelement_class = (GstElementClass *) klass;
gstrtpbasedepayload_class = (GstRTPBaseDepayloadClass *) klass;
- gstrtpbasedepayload_class->process = gst_rtp_mp2t_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_mp2t_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_mp2t_depay_setcaps;
gobject_class->set_property = gst_rtp_mp2t_depay_set_property;
}
static GstBuffer *
-gst_rtp_mp2t_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_mp2t_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstRtpMP2TDepay *rtpmp2tdepay;
GstBuffer *outbuf;
gint payload_len, leftover;
- GstRTPBuffer rtp = { NULL };
rtpmp2tdepay = GST_RTP_MP2T_DEPAY (depayload);
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
if (G_UNLIKELY (payload_len <= rtpmp2tdepay->skip_first_bytes))
goto empty_packet;
}
outbuf =
- gst_rtp_buffer_get_payload_subbuffer (&rtp,
+ gst_rtp_buffer_get_payload_subbuffer (rtp,
rtpmp2tdepay->skip_first_bytes, payload_len);
- gst_rtp_buffer_unmap (&rtp);
if (outbuf)
GST_DEBUG ("gst_rtp_mp2t_depay_chain: pushing buffer of size %"
G_GSIZE_FORMAT, gst_buffer_get_size (outbuf));
{
GST_ELEMENT_WARNING (rtpmp2tdepay, STREAM, DECODE,
(NULL), ("Packet was empty"));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
}
static gboolean gst_rtp_mp4a_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
static GstBuffer *gst_rtp_mp4a_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static GstStateChangeReturn gst_rtp_mp4a_depay_change_state (GstElement *
element, GstStateChange transition);
gstelement_class->change_state = gst_rtp_mp4a_depay_change_state;
- gstrtpbasedepayload_class->process = gst_rtp_mp4a_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_mp4a_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_mp4a_depay_setcaps;
gst_element_class_add_pad_template (gstelement_class,
}
static GstBuffer *
-gst_rtp_mp4a_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_mp4a_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstRtpMP4ADepay *rtpmp4adepay;
GstBuffer *outbuf;
- GstRTPBuffer rtp = { NULL };
GstMapInfo map;
rtpmp4adepay = GST_RTP_MP4A_DEPAY (depayload);
/* flush remaining data on discont */
- if (GST_BUFFER_IS_DISCONT (buf)) {
+ if (GST_BUFFER_IS_DISCONT (rtp->buffer)) {
gst_adapter_clear (rtpmp4adepay->adapter);
}
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
- outbuf = gst_rtp_buffer_get_payload_buffer (&rtp);
+ outbuf = gst_rtp_buffer_get_payload_buffer (rtp);
outbuf = gst_buffer_make_writable (outbuf);
- GST_BUFFER_PTS (outbuf) = GST_BUFFER_PTS (buf);
+ GST_BUFFER_PTS (outbuf) = GST_BUFFER_PTS (rtp->buffer);
gst_adapter_push (rtpmp4adepay->adapter, outbuf);
/* RTP marker bit indicates the last packet of the AudioMuxElement => create
* and push a buffer */
- if (gst_rtp_buffer_get_marker (&rtp)) {
+ if (gst_rtp_buffer_get_marker (rtp)) {
guint avail;
guint i;
guint8 *data;
gst_buffer_unmap (outbuf, &map);
gst_buffer_unref (outbuf);
}
- gst_rtp_buffer_unmap (&rtp);
return NULL;
/* ERRORS */
("Packet did not validate"), ("wrong packet size"));
gst_buffer_unmap (outbuf, &map);
gst_buffer_unref (outbuf);
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
}
static gboolean gst_rtp_mp4g_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
static GstBuffer *gst_rtp_mp4g_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static gboolean gst_rtp_mp4g_depay_handle_event (GstRTPBaseDepayload * filter,
GstEvent * event);
gstelement_class->change_state = gst_rtp_mp4g_depay_change_state;
- gstrtpbasedepayload_class->process = gst_rtp_mp4g_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_mp4g_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_mp4g_depay_setcaps;
gstrtpbasedepayload_class->handle_event = gst_rtp_mp4g_depay_handle_event;
}
static GstBuffer *
-gst_rtp_mp4g_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_mp4g_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstRtpMP4GDepay *rtpmp4gdepay;
GstBuffer *outbuf = NULL;
GstClockTime timestamp;
- GstRTPBuffer rtp = { NULL };
rtpmp4gdepay = GST_RTP_MP4G_DEPAY (depayload);
/* flush remaining data on discont */
- if (GST_BUFFER_IS_DISCONT (buf)) {
+ if (GST_BUFFER_IS_DISCONT (rtp->buffer)) {
GST_DEBUG_OBJECT (rtpmp4gdepay, "received DISCONT");
gst_adapter_clear (rtpmp4gdepay->adapter);
}
- timestamp = GST_BUFFER_PTS (buf);
+ timestamp = GST_BUFFER_PTS (rtp->buffer);
{
gint payload_len, payload_AU;
guint AU_size, AU_index, AU_index_delta, payload_AU_size;
gboolean M;
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
- payload = gst_rtp_buffer_get_payload (&rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
+ payload = gst_rtp_buffer_get_payload (rtp);
GST_DEBUG_OBJECT (rtpmp4gdepay, "received payload of %d", payload_len);
- rtptime = gst_rtp_buffer_get_timestamp (&rtp);
- M = gst_rtp_buffer_get_marker (&rtp);
+ rtptime = gst_rtp_buffer_get_timestamp (rtp);
+ M = gst_rtp_buffer_get_marker (rtp);
if (rtpmp4gdepay->sizelength > 0) {
gint num_AU_headers, AU_headers_bytes, i;
/* collect stuff in the adapter, strip header from payload and push in
* the adapter */
outbuf =
- gst_rtp_buffer_get_payload_subbuffer (&rtp, payload_AU, AU_size);
+ gst_rtp_buffer_get_payload_subbuffer (rtp, payload_AU, AU_size);
gst_adapter_push (rtpmp4gdepay->adapter, outbuf);
if (M) {
}
} else {
/* push complete buffer in adapter */
- outbuf = gst_rtp_buffer_get_payload_subbuffer (&rtp, 0, payload_len);
+ outbuf = gst_rtp_buffer_get_payload_subbuffer (rtp, 0, payload_len);
gst_adapter_push (rtpmp4gdepay->adapter, outbuf);
/* if this was the last packet of the VOP, create and push a buffer */
GST_DEBUG ("gst_rtp_mp4g_depay_chain: pushing buffer of size %"
G_GSIZE_FORMAT, gst_buffer_get_size (outbuf));
- gst_rtp_buffer_unmap (&rtp);
return outbuf;
}
}
}
- gst_rtp_buffer_unmap (&rtp);
return NULL;
/* ERRORS */
{
GST_ELEMENT_WARNING (rtpmp4gdepay, STREAM, DECODE,
("Packet payload was too short."), (NULL));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
}
static gboolean gst_rtp_mp4v_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
static GstBuffer *gst_rtp_mp4v_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static GstStateChangeReturn gst_rtp_mp4v_depay_change_state (GstElement *
element, GstStateChange transition);
gstelement_class->change_state = gst_rtp_mp4v_depay_change_state;
- gstrtpbasedepayload_class->process = gst_rtp_mp4v_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_mp4v_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_mp4v_depay_setcaps;
gst_element_class_add_pad_template (gstelement_class,
}
static GstBuffer *
-gst_rtp_mp4v_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_mp4v_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstRtpMP4VDepay *rtpmp4vdepay;
GstBuffer *pbuf, *outbuf = NULL;
- GstRTPBuffer rtp = { NULL };
gboolean marker;
rtpmp4vdepay = GST_RTP_MP4V_DEPAY (depayload);
/* flush remaining data on discont */
- if (GST_BUFFER_IS_DISCONT (buf))
+ if (GST_BUFFER_IS_DISCONT (rtp->buffer))
gst_adapter_clear (rtpmp4vdepay->adapter);
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
- pbuf = gst_rtp_buffer_get_payload_buffer (&rtp);
- marker = gst_rtp_buffer_get_marker (&rtp);
- gst_rtp_buffer_unmap (&rtp);
+ pbuf = gst_rtp_buffer_get_payload_buffer (rtp);
+ marker = gst_rtp_buffer_get_marker (rtp);
+ gst_rtp_buffer_unmap (rtp);
gst_adapter_push (rtpmp4vdepay->adapter, pbuf);
static gboolean gst_rtp_mpa_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
static GstBuffer *gst_rtp_mpa_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static void
gst_rtp_mpa_depay_class_init (GstRtpMPADepayClass * klass)
"Wim Taymans <wim.taymans@gmail.com>");
gstrtpbasedepayload_class->set_caps = gst_rtp_mpa_depay_setcaps;
- gstrtpbasedepayload_class->process = gst_rtp_mpa_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_mpa_depay_process;
}
static void
}
static GstBuffer *
-gst_rtp_mpa_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_mpa_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstRtpMPADepay *rtpmpadepay;
GstBuffer *outbuf;
- GstRTPBuffer rtp = { NULL };
gint payload_len;
#if 0
guint8 *payload;
rtpmpadepay = GST_RTP_MPA_DEPAY (depayload);
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
-
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
if (payload_len <= 4)
goto empty_packet;
#endif
/* subbuffer skipping the 4 header bytes */
- outbuf = gst_rtp_buffer_get_payload_subbuffer (&rtp, 4, -1);
- marker = gst_rtp_buffer_get_marker (&rtp);
+ outbuf = gst_rtp_buffer_get_payload_subbuffer (rtp, 4, -1);
+ marker = gst_rtp_buffer_get_marker (rtp);
if (marker) {
/* mark start of talkspurt with RESYNC */
"gst_rtp_mpa_depay_chain: pushing buffer of size %" G_GSIZE_FORMAT "",
gst_buffer_get_size (outbuf));
- gst_rtp_buffer_unmap (&rtp);
-
/* FIXME, we can push half mpeg frames when they are split over multiple
* RTP packets */
return outbuf;
{
GST_ELEMENT_WARNING (rtpmpadepay, STREAM, DECODE,
("Empty Payload."), (NULL));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
}
static gboolean gst_rtp_mpa_robust_depay_setcaps (GstRTPBaseDepayload *
depayload, GstCaps * caps);
static GstBuffer *gst_rtp_mpa_robust_depay_process (GstRTPBaseDepayload *
- depayload, GstBuffer * buf);
+ depayload, GstRTPBuffer * rtp);
static void
gst_rtp_mpa_robust_depay_finalize (GObject * object)
"Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>");
gstrtpbasedepayload_class->set_caps = gst_rtp_mpa_robust_depay_setcaps;
- gstrtpbasedepayload_class->process = gst_rtp_mpa_robust_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet =
+ gst_rtp_mpa_robust_depay_process;
}
static void
static GstBuffer *
gst_rtp_mpa_robust_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf)
+ GstRTPBuffer * rtp)
{
GstRtpMPARobustDepay *rtpmpadepay;
gint payload_len, offset;
gboolean cont, dtype;
guint av, size;
GstClockTime timestamp;
- GstRTPBuffer rtp = { NULL };
+ GstBuffer *buf;
rtpmpadepay = GST_RTP_MPA_ROBUST_DEPAY (depayload);
- timestamp = GST_BUFFER_PTS (buf);
-
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
+ timestamp = GST_BUFFER_PTS (rtp->buffer);
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
if (payload_len <= 1)
goto short_read;
- payload = gst_rtp_buffer_get_payload (&rtp);
+ payload = gst_rtp_buffer_get_payload (rtp);
offset = 0;
GST_LOG_OBJECT (rtpmpadepay, "payload_len: %d", payload_len);
GST_LOG_OBJECT (rtpmpadepay, "offset %d has cont: %d, dtype: %d, size: %d",
offset, cont, dtype, size);
- buf = gst_rtp_buffer_get_payload_subbuffer (&rtp, offset,
+ buf = gst_rtp_buffer_get_payload_subbuffer (rtp, offset,
MIN (size, payload_len));
if (cont) {
/* timestamp applies to first payload, no idea for subsequent ones */
timestamp = GST_CLOCK_TIME_NONE;
}
- gst_rtp_buffer_unmap (&rtp);
return NULL;
{
GST_ELEMENT_WARNING (rtpmpadepay, STREAM, DECODE,
(NULL), ("Packet contains invalid data"));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
}
static gboolean gst_rtp_mpv_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
static GstBuffer *gst_rtp_mpv_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static void
gst_rtp_mpv_depay_class_init (GstRtpMPVDepayClass * klass)
"Wim Taymans <wim.taymans@gmail.com>");
gstrtpbasedepayload_class->set_caps = gst_rtp_mpv_depay_setcaps;
- gstrtpbasedepayload_class->process = gst_rtp_mpv_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_mpv_depay_process;
GST_DEBUG_CATEGORY_INIT (rtpmpvdepay_debug, "rtpmpvdepay", 0,
"MPEG Video RTP Depayloader");
}
static GstBuffer *
-gst_rtp_mpv_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_mpv_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstRtpMPVDepay *rtpmpvdepay;
GstBuffer *outbuf = NULL;
- GstRTPBuffer rtp = { NULL };
rtpmpvdepay = GST_RTP_MPV_DEPAY (depayload);
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
-
{
gint payload_len, payload_header;
guint8 *payload;
guint8 T;
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
- payload = gst_rtp_buffer_get_payload (&rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
+ payload = gst_rtp_buffer_get_payload (rtp);
payload_header = 0;
if (payload_len <= 4)
payload += 4;
}
- outbuf = gst_rtp_buffer_get_payload_subbuffer (&rtp, payload_header, -1);
+ outbuf = gst_rtp_buffer_get_payload_subbuffer (rtp, payload_header, -1);
if (outbuf) {
GST_DEBUG_OBJECT (rtpmpvdepay,
}
}
- gst_rtp_buffer_unmap (&rtp);
-
return outbuf;
/* ERRORS */
{
GST_ELEMENT_WARNING (rtpmpvdepay, STREAM, DECODE,
(NULL), ("Empty payload."));
- gst_rtp_buffer_unmap (&rtp);
- gst_buffer_unref (buf);
return NULL;
}
}
);
static GstBuffer *gst_rtp_pcma_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static gboolean gst_rtp_pcma_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
"Extracts PCMA audio from RTP packets",
"Edgard Lima <edgard.lima@indt.org.br>, Zeeshan Ali <zeenix@gmail.com>");
- gstrtpbasedepayload_class->process = gst_rtp_pcma_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_pcma_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_pcma_depay_setcaps;
}
}
static GstBuffer *
-gst_rtp_pcma_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_pcma_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstBuffer *outbuf = NULL;
gboolean marker;
guint len;
- GstRTPBuffer rtp = { NULL };
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
-
- marker = gst_rtp_buffer_get_marker (&rtp);
+ marker = gst_rtp_buffer_get_marker (rtp);
GST_DEBUG ("process : got %" G_GSIZE_FORMAT " bytes, mark %d ts %u seqn %d",
- gst_buffer_get_size (buf), marker,
- gst_rtp_buffer_get_timestamp (&rtp), gst_rtp_buffer_get_seq (&rtp));
+ gst_buffer_get_size (rtp->buffer), marker,
+ gst_rtp_buffer_get_timestamp (rtp), gst_rtp_buffer_get_seq (rtp));
- len = gst_rtp_buffer_get_payload_len (&rtp);
- outbuf = gst_rtp_buffer_get_payload_buffer (&rtp);
- gst_rtp_buffer_unmap (&rtp);
+ len = gst_rtp_buffer_get_payload_len (rtp);
+ outbuf = gst_rtp_buffer_get_payload_buffer (rtp);
if (outbuf) {
GST_BUFFER_DURATION (outbuf) =
}
}
-
return outbuf;
}
);
static GstBuffer *gst_rtp_pcmu_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static gboolean gst_rtp_pcmu_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
"Extracts PCMU audio from RTP packets",
"Edgard Lima <edgard.lima@indt.org.br>, Zeeshan Ali <zeenix@gmail.com>");
- gstrtpbasedepayload_class->process = gst_rtp_pcmu_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_pcmu_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_pcmu_depay_setcaps;
}
}
static GstBuffer *
-gst_rtp_pcmu_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_pcmu_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstBuffer *outbuf = NULL;
guint len;
gboolean marker;
- GstRTPBuffer rtp = { NULL };
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
-
- marker = gst_rtp_buffer_get_marker (&rtp);
+ marker = gst_rtp_buffer_get_marker (rtp);
GST_DEBUG ("process : got %" G_GSIZE_FORMAT " bytes, mark %d ts %u seqn %d",
- gst_buffer_get_size (buf), marker,
- gst_rtp_buffer_get_timestamp (&rtp), gst_rtp_buffer_get_seq (&rtp));
+ gst_buffer_get_size (rtp->buffer), marker,
+ gst_rtp_buffer_get_timestamp (rtp), gst_rtp_buffer_get_seq (rtp));
- len = gst_rtp_buffer_get_payload_len (&rtp);
- outbuf = gst_rtp_buffer_get_payload_buffer (&rtp);
- gst_rtp_buffer_unmap (&rtp);
+ len = gst_rtp_buffer_get_payload_len (rtp);
+ outbuf = gst_rtp_buffer_get_payload_buffer (rtp);
if (outbuf) {
GST_BUFFER_DURATION (outbuf) =
static gboolean gst_rtp_qcelp_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
static GstBuffer *gst_rtp_qcelp_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
#define gst_rtp_qcelp_depay_parent_class parent_class
G_DEFINE_TYPE (GstRtpQCELPDepay, gst_rtp_qcelp_depay,
gobject_class->finalize = gst_rtp_qcelp_depay_finalize;
- gstrtpbasedepayload_class->process = gst_rtp_qcelp_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_qcelp_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_qcelp_depay_setcaps;
gst_element_class_add_pad_template (gstelement_class,
}
static GstBuffer *
-gst_rtp_qcelp_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_qcelp_depay_process (GstRTPBaseDepayload * depayload,
+ GstRTPBuffer * rtp)
{
GstRtpQCELPDepay *depay;
GstBuffer *outbuf;
guint payload_len, offset, index;
guint8 *payload;
guint LLL, NNN;
- GstRTPBuffer rtp = { NULL };
depay = GST_RTP_QCELP_DEPAY (depayload);
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
-
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
if (payload_len < 2)
goto too_small;
- timestamp = GST_BUFFER_PTS (buf);
+ timestamp = GST_BUFFER_PTS (rtp->buffer);
- payload = gst_rtp_buffer_get_payload (&rtp);
+ payload = gst_rtp_buffer_get_payload (rtp);
/* 0 1 2 3 4 5 6 7
* +-+-+-+-+-+-+-+-+
outbuf = create_erasure_buffer (depay);
} else {
/* each frame goes into its buffer */
- outbuf = gst_rtp_buffer_get_payload_subbuffer (&rtp, offset, frame_len);
+ outbuf = gst_rtp_buffer_get_payload_subbuffer (rtp, offset, frame_len);
}
GST_BUFFER_PTS (outbuf) = timestamp;
flush_packets (depay);
}
- gst_rtp_buffer_unmap (&rtp);
return NULL;
/* ERRORS */
{
GST_ELEMENT_WARNING (depay, STREAM, DECODE,
(NULL), ("QCELP RTP payload too small (%d)", payload_len));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
invalid_lll:
{
GST_ELEMENT_WARNING (depay, STREAM, DECODE,
(NULL), ("QCELP RTP invalid LLL received (%d)", LLL));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
invalid_nnn:
{
GST_ELEMENT_WARNING (depay, STREAM, DECODE,
(NULL), ("QCELP RTP invalid NNN received (%d)", NNN));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
invalid_frame:
{
GST_ELEMENT_WARNING (depay, STREAM, DECODE,
(NULL), ("QCELP RTP invalid frame received"));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
}
element, GstStateChange transition);
static GstBuffer *gst_rtp_qdm2_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
gboolean gst_rtp_qdm2_depay_setcaps (GstRTPBaseDepayload * filter,
GstCaps * caps);
gstelement_class = (GstElementClass *) klass;
gstrtpbasedepayload_class = (GstRTPBaseDepayloadClass *) klass;
- gstrtpbasedepayload_class->process = gst_rtp_qdm2_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_qdm2_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_qdm2_depay_setcaps;
gobject_class->finalize = gst_rtp_qdm2_depay_finalize;
}
static GstBuffer *
-gst_rtp_qdm2_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_qdm2_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstRtpQDM2Depay *rtpqdm2depay;
GstBuffer *outbuf = NULL;
guint16 seq;
- GstRTPBuffer rtp = { NULL };
rtpqdm2depay = GST_RTP_QDM2_DEPAY (depayload);
guint avail;
guint pos = 0;
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
if (payload_len < 3)
goto bad_packet;
- payload = gst_rtp_buffer_get_payload (&rtp);
- seq = gst_rtp_buffer_get_seq (&rtp);
+ payload = gst_rtp_buffer_get_payload (rtp);
+ seq = gst_rtp_buffer_get_seq (rtp);
if (G_UNLIKELY (seq != rtpqdm2depay->nextseq)) {
GST_DEBUG ("GAP in sequence number, Resetting data !");
/* Flush previous data */
flush_data (rtpqdm2depay);
/* And store new timestamp */
rtpqdm2depay->ptimestamp = rtpqdm2depay->timestamp;
- rtpqdm2depay->timestamp = GST_BUFFER_PTS (buf);
+ rtpqdm2depay->timestamp = GST_BUFFER_PTS (rtp->buffer);
/* And that previous data will be pushed at the bottom */
}
rtpqdm2depay->nextseq = seq + 1;
GST_DEBUG ("Headers");
/* Store the incoming timestamp */
rtpqdm2depay->ptimestamp = rtpqdm2depay->timestamp;
- rtpqdm2depay->timestamp = GST_BUFFER_PTS (buf);
+ rtpqdm2depay->timestamp = GST_BUFFER_PTS (rtp->buffer);
/* flush the internal data if needed */
flush_data (rtpqdm2depay);
if (G_UNLIKELY (!rtpqdm2depay->configured)) {
}
}
- gst_rtp_buffer_unmap (&rtp);
return outbuf;
/* ERRORS */
{
GST_ELEMENT_WARNING (rtpqdm2depay, STREAM, DECODE,
(NULL), ("Packet was too short"));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
}
static gboolean gst_rtp_sbc_depay_setcaps (GstRTPBaseDepayload * base,
GstCaps * caps);
static GstBuffer *gst_rtp_sbc_depay_process (GstRTPBaseDepayload * base,
- GstBuffer * in);
+ GstRTPBuffer * rtp);
static void
gst_rtp_sbc_depay_class_init (GstRtpSbcDepayClass * klass)
gobject_class->finalize = gst_rtp_sbc_depay_finalize;
gstbasertpdepayload_class->set_caps = gst_rtp_sbc_depay_setcaps;
- gstbasertpdepayload_class->process = gst_rtp_sbc_depay_process;
+ gstbasertpdepayload_class->process_rtp_packet = gst_rtp_sbc_depay_process;
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_rtp_sbc_depay_src_template));
}
static GstBuffer *
-gst_rtp_sbc_depay_process (GstRTPBaseDepayload * base, GstBuffer * in)
+gst_rtp_sbc_depay_process (GstRTPBaseDepayload * base, GstRTPBuffer * rtp)
{
GstRtpSbcDepay *depay = GST_RTP_SBC_DEPAY (base);
GstBuffer *data = NULL;
- GstRTPBuffer rtp = { NULL };
gboolean fragment, start, last;
guint8 nframes;
guint8 *payload;
guint payload_len;
- gst_rtp_buffer_map (in, GST_MAP_READ, &rtp);
-
GST_LOG_OBJECT (depay, "Got %" G_GSIZE_FORMAT " bytes",
- gst_buffer_get_size (in));
+ gst_buffer_get_size (rtp->buffer));
- if (gst_rtp_buffer_get_marker (&rtp)) {
+ if (gst_rtp_buffer_get_marker (rtp)) {
/* Marker isn't supposed to be set */
GST_WARNING_OBJECT (depay, "Marker bit was set");
goto bad_packet;
}
- payload = gst_rtp_buffer_get_payload (&rtp);
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
+ payload = gst_rtp_buffer_get_payload (rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
fragment = payload[0] & 0x80;
start = payload[0] & 0x40;
payload += 1;
payload_len -= 1;
- data = gst_rtp_buffer_get_payload_subbuffer (&rtp, 1, -1);
+ data = gst_rtp_buffer_get_payload_subbuffer (rtp, 1, -1);
if (fragment) {
/* Got a packet with a fragment */
}
out:
- gst_rtp_buffer_unmap (&rtp);
return data;
bad_packet:
);
static GstBuffer *gst_rtp_siren_depay_process (GstRTPBaseDepayload *
- depayload, GstBuffer * buf);
+ depayload, GstRTPBuffer * rtp);
static gboolean gst_rtp_siren_depay_setcaps (GstRTPBaseDepayload *
depayload, GstCaps * caps);
gstelement_class = (GstElementClass *) klass;
gstrtpbasedepayload_class = (GstRTPBaseDepayloadClass *) klass;
- gstrtpbasedepayload_class->process = gst_rtp_siren_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_siren_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_siren_depay_setcaps;
gst_element_class_add_pad_template (gstelement_class,
}
static GstBuffer *
-gst_rtp_siren_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_siren_depay_process (GstRTPBaseDepayload * depayload,
+ GstRTPBuffer * rtp)
{
GstBuffer *outbuf;
- GstRTPBuffer rtp = { NULL };
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
- outbuf = gst_rtp_buffer_get_payload_buffer (&rtp);
- gst_rtp_buffer_unmap (&rtp);
+ outbuf = gst_rtp_buffer_get_payload_buffer (rtp);
return outbuf;
}
);
static GstBuffer *gst_rtp_speex_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static gboolean gst_rtp_speex_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
gstelement_class = (GstElementClass *) klass;
gstrtpbasedepayload_class = (GstRTPBaseDepayloadClass *) klass;
- gstrtpbasedepayload_class->process = gst_rtp_speex_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_speex_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_speex_depay_setcaps;
gst_element_class_add_pad_template (gstelement_class,
}
static GstBuffer *
-gst_rtp_speex_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_speex_depay_process (GstRTPBaseDepayload * depayload,
+ GstRTPBuffer * rtp)
{
GstBuffer *outbuf = NULL;
- GstRTPBuffer rtp = { NULL };
-
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
GST_DEBUG ("process : got %" G_GSIZE_FORMAT " bytes, mark %d ts %u seqn %d",
- gst_buffer_get_size (buf),
- gst_rtp_buffer_get_marker (&rtp),
- gst_rtp_buffer_get_timestamp (&rtp), gst_rtp_buffer_get_seq (&rtp));
+ gst_buffer_get_size (rtp->buffer),
+ gst_rtp_buffer_get_marker (rtp),
+ gst_rtp_buffer_get_timestamp (rtp), gst_rtp_buffer_get_seq (rtp));
/* nothing special to be done */
- outbuf = gst_rtp_buffer_get_payload_buffer (&rtp);
- gst_rtp_buffer_unmap (&rtp);
+ outbuf = gst_rtp_buffer_get_payload_buffer (rtp);
if (outbuf)
GST_BUFFER_DURATION (outbuf) = 20 * GST_MSECOND;
element, GstStateChange transition);
static GstBuffer *gst_rtp_sv3v_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
gboolean gst_rtp_sv3v_depay_setcaps (GstRTPBaseDepayload * filter,
GstCaps * caps);
gstelement_class = (GstElementClass *) klass;
gstrtpbasedepayload_class = (GstRTPBaseDepayloadClass *) klass;
- gstrtpbasedepayload_class->process = gst_rtp_sv3v_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_sv3v_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_sv3v_depay_setcaps;
gobject_class->finalize = gst_rtp_sv3v_depay_finalize;
}
static GstBuffer *
-gst_rtp_sv3v_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_sv3v_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
{
GstRtpSV3VDepay *rtpsv3vdepay;
static struct
gboolean C, S, E;
GstBuffer *outbuf = NULL;
guint16 seq;
- GstRTPBuffer rtp = { NULL };
rtpsv3vdepay = GST_RTP_SV3V_DEPAY (depayload);
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
/* flush on sequence number gaps */
- seq = gst_rtp_buffer_get_seq (&rtp);
+ seq = gst_rtp_buffer_get_seq (rtp);
GST_DEBUG ("timestamp %" GST_TIME_FORMAT ", sequence number:%d",
- GST_TIME_ARGS (GST_BUFFER_PTS (buf)), seq);
+ GST_TIME_ARGS (GST_BUFFER_PTS (rtp->buffer)), seq);
if (seq != rtpsv3vdepay->nextseq) {
GST_DEBUG ("Sequence discontinuity, clearing adapter");
}
rtpsv3vdepay->nextseq = seq + 1;
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
if (payload_len < 3)
goto bad_packet;
- payload = gst_rtp_buffer_get_payload (&rtp);
+ payload = gst_rtp_buffer_get_payload (rtp);
- M = gst_rtp_buffer_get_marker (&rtp);
+ M = gst_rtp_buffer_get_marker (rtp);
/* This is all a guess:
* 1 1 1 1 1 1
GST_DEBUG ("Storing incoming payload");
/* store data in adapter, stip off 2 bytes header */
- tmpbuf = gst_rtp_buffer_get_payload_subbuffer (&rtp, 2, -1);
+ tmpbuf = gst_rtp_buffer_get_payload_subbuffer (rtp, 2, -1);
gst_adapter_push (rtpsv3vdepay->adapter, tmpbuf);
if (G_UNLIKELY (M)) {
}
beach:
- gst_rtp_buffer_unmap (&rtp);
return outbuf;
/* ERRORS */
{
GST_ELEMENT_WARNING (rtpsv3vdepay, STREAM, DECODE,
(NULL), ("Packet was too short"));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
}
static gboolean gst_rtp_theora_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
static GstBuffer *gst_rtp_theora_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static gboolean gst_rtp_theora_depay_packet_lost (GstRTPBaseDepayload *
depayload, GstEvent * event);
gobject_class->finalize = gst_rtp_theora_depay_finalize;
- gstrtpbasedepayload_class->process = gst_rtp_theora_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_theora_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_theora_depay_setcaps;
gstrtpbasedepayload_class->packet_lost = gst_rtp_theora_depay_packet_lost;
}
static GstBuffer *
-gst_rtp_theora_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_theora_depay_process (GstRTPBaseDepayload * depayload,
+ GstRTPBuffer * rtp)
{
GstRtpTheoraDepay *rtptheoradepay;
GstBuffer *outbuf;
guint8 *payload, *to_free = NULL;
guint32 header, ident;
guint8 F, TDT, packets;
- GstRTPBuffer rtp = { NULL };
guint length;
rtptheoradepay = GST_RTP_THEORA_DEPAY (depayload);
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
-
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
GST_DEBUG_OBJECT (depayload, "got RTP packet of size %d", payload_len);
if (G_UNLIKELY (payload_len < 4))
goto packet_short;
- payload = gst_rtp_buffer_get_payload (&rtp);
+ payload = gst_rtp_buffer_get_payload (rtp);
header = GST_READ_UINT32_BE (payload);
/*
/* first assembled packet, reuse 2 bytes to store the length */
headerskip = (F == 1 ? 4 : 6);
/* skip header and length. */
- vdata = gst_rtp_buffer_get_payload_subbuffer (&rtp, headerskip, -1);
+ vdata = gst_rtp_buffer_get_payload_subbuffer (rtp, headerskip, -1);
GST_DEBUG_OBJECT (depayload, "assemble theora packet");
gst_adapter_push (rtptheoradepay->adapter, vdata);
out:
no_output:
- gst_rtp_buffer_unmap (&rtp);
g_free (to_free);
return NULL;
static gboolean gst_rtp_vorbis_depay_setcaps (GstRTPBaseDepayload * depayload,
GstCaps * caps);
static GstBuffer *gst_rtp_vorbis_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static void gst_rtp_vorbis_depay_finalize (GObject * object);
gstelement_class->change_state = gst_rtp_vorbis_depay_change_state;
- gstrtpbasedepayload_class->process = gst_rtp_vorbis_depay_process;
+ gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_vorbis_depay_process;
gstrtpbasedepayload_class->set_caps = gst_rtp_vorbis_depay_setcaps;
gst_element_class_add_pad_template (gstelement_class,
}
static GstBuffer *
-gst_rtp_vorbis_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
+gst_rtp_vorbis_depay_process (GstRTPBaseDepayload * depayload,
+ GstRTPBuffer * rtp)
{
GstRtpVorbisDepay *rtpvorbisdepay;
GstBuffer *outbuf;
guint8 *payload, *to_free = NULL;
guint32 header, ident;
guint8 F, VDT, packets;
- GstRTPBuffer rtp = { NULL };
guint length;
rtpvorbisdepay = GST_RTP_VORBIS_DEPAY (depayload);
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
-
- payload_len = gst_rtp_buffer_get_payload_len (&rtp);
+ payload_len = gst_rtp_buffer_get_payload_len (rtp);
GST_DEBUG_OBJECT (depayload, "got RTP packet of size %d", payload_len);
if (G_UNLIKELY (payload_len < 4))
goto packet_short;
- payload = gst_rtp_buffer_get_payload (&rtp);
+ payload = gst_rtp_buffer_get_payload (rtp);
header = GST_READ_UINT32_BE (payload);
/*
/* first assembled packet, reuse 2 bytes to store the length */
headerskip = (F == 1 ? 4 : 6);
/* skip header and length. */
- vdata = gst_rtp_buffer_get_payload_subbuffer (&rtp, headerskip, -1);
+ vdata = gst_rtp_buffer_get_payload_subbuffer (rtp, headerskip, -1);
GST_DEBUG_OBJECT (depayload, "assemble vorbis packet");
gst_adapter_push (rtpvorbisdepay->adapter, vdata);
g_free (to_free);
- gst_rtp_buffer_unmap (&rtp);
-
return NULL;
no_output:
{
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
/* ERORRS */
{
GST_ELEMENT_WARNING (rtpvorbisdepay, STREAM, DECODE,
(NULL), ("Could not switch codebooks"));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
packet_short:
{
GST_ELEMENT_WARNING (rtpvorbisdepay, STREAM, DECODE,
(NULL), ("Packet was too short (%d < 4)", payload_len));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
ignore_reserved:
{
GST_WARNING_OBJECT (rtpvorbisdepay, "reserved VDT ignored");
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
length_short:
{
GST_ELEMENT_WARNING (rtpvorbisdepay, STREAM, DECODE,
(NULL), ("Packet contains invalid data"));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
invalid_configuration:
/* fatal, as we otherwise risk carrying on without output */
GST_ELEMENT_ERROR (rtpvorbisdepay, STREAM, DECODE,
(NULL), ("Packet contains invalid configuration"));
- gst_rtp_buffer_unmap (&rtp);
return NULL;
}
}
static void gst_rtp_vp8_depay_dispose (GObject * object);
static GstBuffer *gst_rtp_vp8_depay_process (GstRTPBaseDepayload * depayload,
- GstBuffer * buf);
+ GstRTPBuffer * rtp);
static GstStateChangeReturn gst_rtp_vp8_depay_change_state (GstElement *
element, GstStateChange transition);
static gboolean gst_rtp_vp8_depay_handle_event (GstRTPBaseDepayload * depay,
element_class->change_state = gst_rtp_vp8_depay_change_state;
- depay_class->process = gst_rtp_vp8_depay_process;
+ depay_class->process_rtp_packet = gst_rtp_vp8_depay_process;
depay_class->handle_event = gst_rtp_vp8_depay_handle_event;
GST_DEBUG_CATEGORY_INIT (gst_rtp_vp8_depay_debug, "rtpvp8depay", 0,
}
static GstBuffer *
-gst_rtp_vp8_depay_process (GstRTPBaseDepayload * depay, GstBuffer * buf)
+gst_rtp_vp8_depay_process (GstRTPBaseDepayload * depay, GstRTPBuffer * rtp)
{
GstRtpVP8Depay *self = GST_RTP_VP8_DEPAY (depay);
GstBuffer *payload;
guint8 *data;
guint hdrsize;
guint size;
- GstRTPBuffer rtpbuffer = GST_RTP_BUFFER_INIT;
- if (G_UNLIKELY (GST_BUFFER_IS_DISCONT (buf))) {
+ if (G_UNLIKELY (GST_BUFFER_IS_DISCONT (rtp->buffer))) {
GST_LOG_OBJECT (self, "Discontinuity, flushing adapter");
gst_adapter_clear (self->adapter);
self->started = FALSE;
}
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtpbuffer);
- size = gst_rtp_buffer_get_payload_len (&rtpbuffer);
+ size = gst_rtp_buffer_get_payload_len (rtp);
/* At least one header and one vp8 byte */
if (G_UNLIKELY (size < 2))
goto too_small;
- data = gst_rtp_buffer_get_payload (&rtpbuffer);
+ data = gst_rtp_buffer_get_payload (rtp);
if (G_UNLIKELY (!self->started)) {
/* Check if this is the start of a VP8 frame, otherwise bail */
if (G_UNLIKELY (hdrsize >= size))
goto too_small;
- payload = gst_rtp_buffer_get_payload_subbuffer (&rtpbuffer, hdrsize, -1);
+ payload = gst_rtp_buffer_get_payload_subbuffer (rtp, hdrsize, -1);
gst_adapter_push (self->adapter, payload);
/* Marker indicates that it was the last rtp packet for this frame */
- if (gst_rtp_buffer_get_marker (&rtpbuffer)) {
+ if (gst_rtp_buffer_get_marker (rtp)) {
GstBuffer *out;
guint8 header[10];
gst_adapter_available (self->adapter));
self->started = FALSE;
- gst_rtp_buffer_unmap (&rtpbuffer);
/* mark keyframes */
out = gst_buffer_make_writable (out);
}
done:
- gst_rtp_buffer_unmap (&rtpbuffer);
return NULL;
too_small: