buffer: drop parent meta in deep copy/foreach_metadata
authorPhilipp Zabel <p.zabel@pengutronix.de>
Wed, 28 Mar 2018 15:54:15 +0000 (17:54 +0200)
committerJames Hilliard <james.hilliard1@gmail.com>
Wed, 28 Sep 2022 18:34:44 +0000 (12:34 -0600)
commit3b900e1fa4fd888012dc005fa26ae2532a89b7a7
tree1e5e258148e32a209b679e78cd5506e1a5908271
parent8a2edc6581c0f34a0e9efba146c520cce1410d29
buffer: drop parent meta in deep copy/foreach_metadata

The purpose of a deep buffer copy is to be able to release the source
buffer and all its dependencies. Attaching the parent buffer meta to
the newly created deep copy needlessly keeps holding a reference to the
parent buffer.

The issue this solves is the fact you need to allocate more
buffers, as you have free buffers being held for no reason. In the good
cases it will use more memory, in the bad case it will stall your
pipeline (since codecs often need a minimum number of buffers to
actually work).

Fixes #283

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2928>
subprojects/gst-plugins-base/gst-libs/gst/audio/gstaudiodecoder.c
subprojects/gst-plugins-base/gst-libs/gst/audio/gstaudioencoder.c
subprojects/gst-plugins-base/gst-libs/gst/video/gstvideodecoder.c
subprojects/gst-plugins-base/gst-libs/gst/video/gstvideoencoder.c
subprojects/gstreamer/gst/gstbuffer.c
subprojects/gstreamer/gst/gstmeta.c
subprojects/gstreamer/gst/gstmeta.h
subprojects/gstreamer/libs/gst/base/gstadapter.c
subprojects/gstreamer/libs/gst/base/gstbasetransform.c