mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 13:41:48 +00:00
rtpmp4gdepay: handle broken AU-Index in non-interleaved streams
In case of non-interleaved (= sequentially payloaded) streams, the AU-Index serves little purpose (that is not already covered by RTP fields). (Broken) Payloaders might consider this field then to be disregarded and have non spec compliant values, e.g. each RTP packet having AU-Index 2 (rather than 0). As such, ensure/force simple sequential sending of non-interleaved streams.
This commit is contained in:
parent
15fa7d33ed
commit
30efa405f3
2 changed files with 19 additions and 0 deletions
|
@ -276,6 +276,8 @@ gst_rtp_mp4g_depay_setcaps (GstBaseRTPDepayload * depayload, GstCaps * caps)
|
||||||
gst_rtp_mp4g_depay_parse_int (structure, "constantsize", 0);
|
gst_rtp_mp4g_depay_parse_int (structure, "constantsize", 0);
|
||||||
rtpmp4gdepay->constantDuration =
|
rtpmp4gdepay->constantDuration =
|
||||||
gst_rtp_mp4g_depay_parse_int (structure, "constantduration", 0);
|
gst_rtp_mp4g_depay_parse_int (structure, "constantduration", 0);
|
||||||
|
rtpmp4gdepay->maxDisplacement =
|
||||||
|
gst_rtp_mp4g_depay_parse_int (structure, "maxdisplacement", 0);
|
||||||
|
|
||||||
|
|
||||||
/* get config string */
|
/* get config string */
|
||||||
|
@ -547,6 +549,22 @@ gst_rtp_mp4g_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
/* a new interleave group started, flush */
|
/* a new interleave group started, flush */
|
||||||
gst_rtp_mp4g_depay_flush_queue (rtpmp4gdepay);
|
gst_rtp_mp4g_depay_flush_queue (rtpmp4gdepay);
|
||||||
}
|
}
|
||||||
|
if (G_UNLIKELY (!rtpmp4gdepay->maxDisplacement &&
|
||||||
|
rtpmp4gdepay->max_AU_index != -1
|
||||||
|
&& rtpmp4gdepay->max_AU_index >= AU_index)) {
|
||||||
|
GstBuffer *outbuf;
|
||||||
|
|
||||||
|
/* some broken non-interleaved streams have AU-index jumping around
|
||||||
|
* all over the place, apparently assuming receiver disregards */
|
||||||
|
GST_DEBUG_OBJECT (rtpmp4gdepay, "non-interleaved broken AU indices;"
|
||||||
|
" forcing continuous flush");
|
||||||
|
/* reset AU to avoid repeated DISCONT in such case */
|
||||||
|
outbuf = g_queue_peek_head (rtpmp4gdepay->packets);
|
||||||
|
if (G_LIKELY (outbuf)) {
|
||||||
|
rtpmp4gdepay->next_AU_index = GST_BUFFER_OFFSET (outbuf);
|
||||||
|
gst_rtp_mp4g_depay_flush_queue (rtpmp4gdepay);
|
||||||
|
}
|
||||||
|
}
|
||||||
rtpmp4gdepay->prev_rtptime = rtptime;
|
rtpmp4gdepay->prev_rtptime = rtptime;
|
||||||
} else {
|
} else {
|
||||||
AU_index_delta =
|
AU_index_delta =
|
||||||
|
|
|
@ -49,6 +49,7 @@ struct _GstRtpMP4GDepay
|
||||||
|
|
||||||
gint constantSize;
|
gint constantSize;
|
||||||
gint constantDuration;
|
gint constantDuration;
|
||||||
|
gint maxDisplacement;
|
||||||
|
|
||||||
gint sizelength;
|
gint sizelength;
|
||||||
gint indexlength;
|
gint indexlength;
|
||||||
|
|
Loading…
Reference in a new issue