Modifying CustomMeta in python seems still broken

Hi,

From the following REGRESSION: pygobject 3.13 now copies the GstStructure when getting them from a GstCaps, making it impossible to properly modify structures from caps in place (#76) · Issues · GStreamer / gstreamer · GitLab it looks like the bug has been solved.

Nevertheless I still encounter the issue that modifying the structure of a CustomMeta does nothing, like it is in fact a copy of the underlying structure.

My Gstreamer version is 1.28.4. I’m working on a custom python plugin on version 3.14.5 of python.

I tried a lot of variations, but basically

algometa = buffer.add_custom_meta(“algometa”)
algometa.structure.set_value(“data”, message.encode())

does not work.

Is there something i missed?

Thanks in advance!

I added a new function to handle this issue: gst_buffer_add_custom_meta_with_structure
It enables the python caller to also pass a pre-populated structure, thus bypassing the issue.

Do you think this would be a nice method?

I tried implementing a custom_meta.set_structure function but it seems that it is not possible to get the required parent refcount pointer to properly call gst_structure_set_parent_refcount.

The original implementation sets it during custom_meta creation where the buffer’s pointer is available. Do you know a way to retrieve this pointer from the structure itself?