rtpmp4gdepay: 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-10 19:06:35 +02:00 committed by GStreamer Marge Bot
parent 75849c63c8
commit 5d1d0cf9a5
2 changed files with 14 additions and 1 deletions

View file

@ -182,6 +182,8 @@ gst_rtp_mp4g_depay_class_init (GstRtpMP4GDepayClass * klass)
static void static void
gst_rtp_mp4g_depay_init (GstRtpMP4GDepay * rtpmp4gdepay) gst_rtp_mp4g_depay_init (GstRtpMP4GDepay * rtpmp4gdepay)
{ {
gst_rtp_base_depayload_set_aggregate_hdrext_enabled (GST_RTP_BASE_DEPAYLOAD
(rtpmp4gdepay), TRUE);
rtpmp4gdepay->adapter = gst_adapter_new (); rtpmp4gdepay->adapter = gst_adapter_new ();
rtpmp4gdepay->packets = g_queue_new (); rtpmp4gdepay->packets = g_queue_new ();
} }
@ -348,7 +350,11 @@ gst_rtp_mp4g_depay_push_outbuf (GstRtpMP4GDepay * rtpmp4gdepay,
discont ? "" : "expected ", AU_index); discont ? "" : "expected ", AU_index);
gst_rtp_drop_meta (GST_ELEMENT_CAST (rtpmp4gdepay), outbuf, 0); gst_rtp_drop_meta (GST_ELEMENT_CAST (rtpmp4gdepay), outbuf, 0);
gst_rtp_base_depayload_push (GST_RTP_BASE_DEPAYLOAD (rtpmp4gdepay), outbuf); if (!rtpmp4gdepay->outbufs) {
rtpmp4gdepay->outbufs =
gst_buffer_list_new_sized (g_queue_get_length (rtpmp4gdepay->packets));
}
gst_buffer_list_add (rtpmp4gdepay->outbufs, outbuf);
rtpmp4gdepay->next_AU_index = AU_index + 1; rtpmp4gdepay->next_AU_index = AU_index + 1;
} }
@ -727,6 +733,11 @@ gst_rtp_mp4g_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
payload_AU += AU_size; payload_AU += AU_size;
payload_AU_size -= AU_size; payload_AU_size -= AU_size;
} }
if (rtpmp4gdepay->outbufs) {
gst_rtp_base_depayload_push_list (depayload,
g_steal_pointer (&rtpmp4gdepay->outbufs));
}
} else { } else {
/* push complete buffer in adapter */ /* 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);
@ -755,6 +766,7 @@ short_payload:
{ {
GST_ELEMENT_WARNING (rtpmp4gdepay, STREAM, DECODE, GST_ELEMENT_WARNING (rtpmp4gdepay, STREAM, DECODE,
("Packet payload was too short."), (NULL)); ("Packet payload was too short."), (NULL));
gst_rtp_base_depayload_dropped (depayload);
return NULL; return NULL;
} }
} }

View file

@ -73,6 +73,7 @@ struct _GstRtpMP4GDepay
GQueue *packets; GQueue *packets;
GstAdapter *adapter; GstAdapter *adapter;
GstBufferList *outbufs;
}; };
struct _GstRtpMP4GDepayClass struct _GstRtpMP4GDepayClass