meta: Set the parent refcount of the GstStructure correctly
authorNirbheek Chauhan <nirbheek@centricular.com>
Mon, 15 Aug 2022 14:37:09 +0000 (20:07 +0530)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 15 Aug 2022 19:58:26 +0000 (19:58 +0000)
commita14df98ff41d80d7695e8637d0931f7a90a95c64
treec767428f9753390a5e10b4546b0af9d83a14765d
parentdf64226e7114b377bc39da0a26f56f4a73ba8669
meta: Set the parent refcount of the GstStructure correctly

The parent refcount is of the *transformed* buffer, not the input
buffer.

Also update the docs to clarify that @transbuf is the transformed
buffer, and not the buffer on which a transformation is being
performed.

Due to this bug, modifying the structure of a meta that has been
copied to another buffer fails with:

gst_structure_set: assertion 'IS_MUTABLE (structure) || field == NULL' failed

Add a test for the same.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2890>
subprojects/gstreamer/gst/gstmeta.c
subprojects/gstreamer/gst/gstmeta.h
subprojects/gstreamer/tests/check/gst/gstmeta.c