rtpxqtdepay: Enabled header extension aggregation

Because this depayloader may build several output buffers within one
process run we push them all into a GstBufferList and push them out at
once to make sure that each buffer gets notified about each header
extension.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5378>
This commit is contained in:
Jochen Henneberg 2023-09-17 18:48:13 +02:00 committed by GStreamer Marge Bot
parent 4788a3da0d
commit 6608b89977

View file

@ -146,6 +146,9 @@ gst_rtp_xqt_depay_class_init (GstRtpXQTDepayClass * klass)
static void static void
gst_rtp_xqt_depay_init (GstRtpXQTDepay * rtpxqtdepay) gst_rtp_xqt_depay_init (GstRtpXQTDepay * rtpxqtdepay)
{ {
gst_rtp_base_depayload_set_aggregate_hdrext_enabled (GST_RTP_BASE_DEPAYLOAD
(rtpxqtdepay), TRUE);
rtpxqtdepay->adapter = gst_adapter_new (); rtpxqtdepay->adapter = gst_adapter_new ();
} }
@ -551,6 +554,7 @@ gst_rtp_xqt_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
case 2: case 2:
{ {
guint slen; guint slen;
GstBufferList *outbufs = NULL;
/* multiple samples per packet. /* multiple samples per packet.
* 1 2 3 * 1 2 3
@ -571,6 +575,7 @@ gst_rtp_xqt_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
* . ...... . * . ...... .
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/ */
outbufs = gst_buffer_list_new ();
while (payload_len > 8) { while (payload_len > 8) {
s = (payload[0] & 0x80) != 0; /* contains sync sample */ s = (payload[0] & 0x80) != 0; /* contains sync sample */
slen = (payload[2] << 8) | payload[3]; slen = (payload[2] << 8) | payload[3];
@ -590,7 +595,7 @@ gst_rtp_xqt_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
if (!s) if (!s)
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DELTA_UNIT); GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DELTA_UNIT);
gst_rtp_base_depayload_push (depayload, outbuf); gst_buffer_list_add (outbufs, outbuf);
/* aligned on 32 bit boundary */ /* aligned on 32 bit boundary */
slen = GST_ROUND_UP_4 (slen); slen = GST_ROUND_UP_4 (slen);
@ -598,6 +603,8 @@ gst_rtp_xqt_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
payload += slen; payload += slen;
payload_len -= slen; payload_len -= slen;
} }
gst_rtp_base_depayload_push_list (depayload, outbufs);
outbuf = NULL;
break; break;
} }
case 3: case 3:
@ -630,30 +637,35 @@ done:
need_resync: need_resync:
{ {
GST_DEBUG_OBJECT (rtpxqtdepay, "waiting for marker"); GST_DEBUG_OBJECT (rtpxqtdepay, "waiting for marker");
gst_rtp_base_depayload_dropped (depayload);
goto done; goto done;
} }
wrong_version: wrong_version:
{ {
GST_ELEMENT_WARNING (rtpxqtdepay, STREAM, DECODE, GST_ELEMENT_WARNING (rtpxqtdepay, STREAM, DECODE,
("Unknown payload version."), (NULL)); ("Unknown payload version."), (NULL));
gst_rtp_base_depayload_dropped (depayload);
goto done; goto done;
} }
pck_reserved: pck_reserved:
{ {
GST_ELEMENT_WARNING (rtpxqtdepay, STREAM, DECODE, GST_ELEMENT_WARNING (rtpxqtdepay, STREAM, DECODE,
("PCK reserved 0."), (NULL)); ("PCK reserved 0."), (NULL));
gst_rtp_base_depayload_dropped (depayload);
goto done; goto done;
} }
wrong_length: wrong_length:
{ {
GST_ELEMENT_WARNING (rtpxqtdepay, STREAM, DECODE, GST_ELEMENT_WARNING (rtpxqtdepay, STREAM, DECODE,
("Wrong payload length."), (NULL)); ("Wrong payload length."), (NULL));
gst_rtp_base_depayload_dropped (depayload);
goto done; goto done;
} }
unknown_format: unknown_format:
{ {
GST_ELEMENT_WARNING (rtpxqtdepay, STREAM, DECODE, GST_ELEMENT_WARNING (rtpxqtdepay, STREAM, DECODE,
("Unknown payload format."), (NULL)); ("Unknown payload format."), (NULL));
gst_rtp_base_depayload_dropped (depayload);
goto done; goto done;
} }
} }