rtpbasedepayload: Drop redundant reference timestamp buffer meta in RTP depayloaders
authorMatt Crane <matt@standard.ai>
Wed, 16 Nov 2022 16:47:54 +0000 (11:47 -0500)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Sat, 19 Nov 2022 07:57:44 +0000 (07:57 +0000)
commitb11169bd32d16d4ec2e090a3f52bd6641cd71d61
tree44dac58cc156ed02df3aa228b67385ca1e63ecee
parent6538ebbaf3a64b607283e054e8bc3bf56b36be05
rtpbasedepayload: Drop redundant reference timestamp buffer meta in RTP depayloaders

Currently, when rtspsrc property add-reference-timestamp-metadata=true,
a downstream rtph264depay element will attach multiple copies of the
same GstReferenceTimestampMeta to the depayloaded media buffers. This
can have signficant performance impacts further downstream in a pipeline
like the following:

    rtspsrc add-reference-timestamp-metadata=true ! rtph264depay ! h264parse ! ... ! rtph264pay ! ...

For example, if there are 10 packet buffers for a frame of RTP H.264
video, each of those packet buffers will contain the same reference
timestamp meta. The rtph264depay element will then attach all 10
metadata to the depayloaded frame. And then later when we payload the
frame buffer again for proxying, we now have 10 more buffers each with
10 instance of the same metadata. Allocating/deallocating 100+ instances
of metadata @ 30fps for multiple streams has a pretty large performance
impact.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1578

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3431>
subprojects/gst-plugins-base/gst-libs/gst/rtp/gstrtpbasedepayload.c