gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
- if (!gst_rtp_buffer_validate (buf))
- goto bad_packet;
-
if (GST_BUFFER_IS_DISCONT (buf)) {
/* discont, clear adapter and try to find a new packet start */
gst_adapter_clear (rtpxqtdepay->adapter);
gst_rtp_buffer_unmap (&rtp);
return outbuf;
-bad_packet:
- {
- GST_ELEMENT_WARNING (rtpxqtdepay, STREAM, DECODE,
- ("Packet did not validate."), (NULL));
- goto done;
- }
need_resync:
{
GST_DEBUG_OBJECT (rtpxqtdepay, "waiting for marker");
asteriskh263 = GST_ASTERISK_H263 (parent);
- if (!gst_rtp_buffer_validate (buf))
- goto bad_packet;
-
{
gint payload_len;
guint8 *payload;
GstRTPBuffer rtp = { NULL };
GstMapInfo map;
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
+ if (!gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp))
+ goto bad_packet;
payload_len = gst_rtp_buffer_get_payload_len (&rtp);
payload = gst_rtp_buffer_get_payload (&rtp);
jitterbuffer = GST_RTP_JITTER_BUFFER (parent);
- if (G_UNLIKELY (!gst_rtp_buffer_validate (buffer)))
- goto invalid_buffer;
-
priv = jitterbuffer->priv;
- gst_rtp_buffer_map (buffer, GST_MAP_READ, &rtp);
+ if (G_UNLIKELY (!gst_rtp_buffer_map (buffer, GST_MAP_READ, &rtp)))
+ goto invalid_buffer;
+
pt = gst_rtp_buffer_get_payload_type (&rtp);
seqnum = gst_rtp_buffer_get_seq (&rtp);
gst_rtp_buffer_unmap (&rtp);
guint64 ext_time, elapsed;
guint32 rtp_time;
GstRtpJitterBufferPrivate *priv;
- GstRTPBuffer rtp = { NULL, };
+ GstRTPBuffer rtp = GST_RTP_BUFFER_INIT;
priv = jitterbuffer->priv;
gst_rtp_buffer_map (outbuf, GST_MAP_READ, &rtp);
rtpdemux = GST_RTP_PT_DEMUX (parent);
- if (!gst_rtp_buffer_validate (buf))
+ if (!gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp))
goto invalid_buffer;
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
pt = gst_rtp_buffer_get_payload_type (&rtp);
gst_rtp_buffer_unmap (&rtp);
demux = GST_RTP_SSRC_DEMUX (parent);
- if (!gst_rtp_buffer_validate (buf))
+ if (!gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp))
goto invalid_payload;
- gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp);
ssrc = gst_rtp_buffer_get_ssrc (&rtp);
gst_rtp_buffer_unmap (&rtp);
g_return_val_if_fail (RTP_IS_SESSION (sess), GST_FLOW_ERROR);
g_return_val_if_fail (GST_IS_BUFFER (buffer), GST_FLOW_ERROR);
- if (!gst_rtp_buffer_validate (buffer))
+ if (!gst_rtp_buffer_map (buffer, GST_MAP_READ, &rtp))
goto invalid_packet;
RTP_SESSION_LOCK (sess);
- /* update arrival stats */
- update_arrival_stats (sess, &arrival, TRUE, buffer, current_time,
- running_time, -1);
-
/* ignore more RTP packets when we left the session */
if (sess->source->received_bye)
goto ignore;
+ /* update arrival stats */
+ update_arrival_stats (sess, &arrival, TRUE, buffer, current_time,
+ running_time, -1);
+
/* get SSRC and look up in session database */
- gst_rtp_buffer_map (buffer, GST_MAP_READ, &rtp);
ssrc = gst_rtp_buffer_get_ssrc (&rtp);
source = obtain_source (sess, ssrc, &created, &arrival, TRUE);
- if (!source) {
- gst_rtp_buffer_unmap (&rtp);
+ if (!source)
goto collision;
- }
/* copy available csrc for later */
count = gst_rtp_buffer_get_csrc_count (&rtp);
ignore:
{
RTP_SESSION_UNLOCK (sess);
+ gst_rtp_buffer_unmap (&rtp);
gst_buffer_unref (buffer);
- clean_arrival_stats (&arrival);
GST_DEBUG ("ignoring RTP packet because we are leaving");
return GST_FLOW_OK;
}
collision:
{
RTP_SESSION_UNLOCK (sess);
+ gst_rtp_buffer_unmap (&rtp);
gst_buffer_unref (buffer);
clean_arrival_stats (&arrival);
GST_DEBUG ("ignoring packet because its collisioning");
GstFlowReturn result;
RTPSource *source;
gboolean prevsender;
- gboolean valid_packet;
guint64 oldrate;
g_return_val_if_fail (RTP_IS_SESSION (sess), GST_FLOW_ERROR);
g_return_val_if_fail (is_list || GST_IS_BUFFER (data), GST_FLOW_ERROR);
- if (is_list) {
- GstBufferList *blist = GST_BUFFER_LIST_CAST (data);
- gint i, len = gst_buffer_list_length (blist);
-
- valid_packet = TRUE;
- for (i = 0; i < len; i++)
- valid_packet &= gst_rtp_buffer_validate (gst_buffer_list_get (blist, i));
- } else {
- valid_packet = gst_rtp_buffer_validate (GST_BUFFER_CAST (data));
- }
-
- if (!valid_packet)
- goto invalid_packet;
-
GST_LOG ("received RTP %s for sending", is_list ? "list" : "packet");
RTP_SESSION_LOCK (sess);
RTP_SESSION_UNLOCK (sess);
return result;
-
- /* ERRORS */
-invalid_packet:
- {
- gst_mini_object_unref (GST_MINI_OBJECT_CAST (data));
- GST_DEBUG ("invalid RTP packet received");
- return GST_FLOW_OK;
- }
}
static void
GST_DEBUG_OBJECT (rtpdec, "got rtp packet");
- if (!gst_rtp_buffer_validate (buffer))
+ if (!gst_rtp_buffer_map (buffer, GST_MAP_READ, &rtp))
goto bad_packet;
-
- gst_rtp_buffer_map (buffer, GST_MAP_READ, &rtp);
ssrc = gst_rtp_buffer_get_ssrc (&rtp);
pt = gst_rtp_buffer_get_payload_type (&rtp);
gst_rtp_buffer_unmap (&rtp);