GstTagList retrieved from a tag event can be writable even if the event is not
GstTagList *tags1, *tags2; GstEvent *ev; tags1 = gst_tag_list_new(GST_TAG_TITLE, "foo", NULL); ev = gst_event_new_tag(g_steal_pointer(&tags1)); // Takes ownership of tags1 gst_event_ref(ev); // event is not writable anymore because refcount == 2 gst_event_parse_tag(event, &tags2); // is transfer none for the tags g_assert(!gst_tag_list_is_writable(tags2)); // asserts
The taglist should not be writable because the event might be in use in multiple places but unfortunately it is. The reason for that is that the taglist doesn't know about the event as its parent (
gst_mini_object_add_parent()). It's stored inside the event
GstStructure (which itself is not writable anymore because
gst_structure_set_parent_refcount() points to the event refcount), but this information is not forwarded (and can't!) to the taglist itself.
As the structure does not know that its parent is a miniobject (and which!), it can't keep the parent as a parent of all miniobjects stored in it. And even if it could then this would need to be done for all values recursively (say a structure containing a structure containing an array containing miniobjects).