mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
rtprtxreceive: allow passthrough and non-rtp buffers
To avoid mapping rtp buffers when RTX is not in use, and to not do a full error on receiving a non-rtp buffer, since you have no control of what a rouge sender might send you. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1874>
This commit is contained in:
parent
a475c93346
commit
86c7231dae
1 changed files with 9 additions and 2 deletions
|
@ -530,6 +530,9 @@ gst_rtp_rtx_receive_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
|
||||||
gboolean is_rtx;
|
gboolean is_rtx;
|
||||||
gboolean drop = FALSE;
|
gboolean drop = FALSE;
|
||||||
|
|
||||||
|
if (rtx->rtx_pt_map_structure == NULL)
|
||||||
|
goto no_map;
|
||||||
|
|
||||||
/* map current rtp packet to parse its header */
|
/* map current rtp packet to parse its header */
|
||||||
if (!gst_rtp_buffer_map (buffer, GST_MAP_READ, &rtp))
|
if (!gst_rtp_buffer_map (buffer, GST_MAP_READ, &rtp))
|
||||||
goto invalid_buffer;
|
goto invalid_buffer;
|
||||||
|
@ -679,10 +682,14 @@ gst_rtp_rtx_receive_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
no_map:
|
||||||
|
{
|
||||||
|
GST_DEBUG_OBJECT (pad, "No map set, passthrough");
|
||||||
|
return gst_pad_push (rtx->srcpad, buffer);
|
||||||
|
}
|
||||||
invalid_buffer:
|
invalid_buffer:
|
||||||
{
|
{
|
||||||
GST_ELEMENT_WARNING (rtx, STREAM, DECODE, (NULL),
|
GST_INFO_OBJECT (pad, "Received invalid RTP payload, dropping");
|
||||||
("Received invalid RTP payload, dropping"));
|
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (buffer);
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue