miniobject: Add parent pointers to the miniobject to influence writability
authorSebastian Dröge <sebastian@centricular.com>
Tue, 3 Jul 2018 17:07:31 +0000 (20:07 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Mon, 9 Jul 2018 07:45:45 +0000 (09:45 +0200)
commit6fa351407a06593ace25e64602b7703d282bd5c7
tree29d034081d2e03bf054e134f289665a69956bdda
parent8f76257ac03ffaf281352067b8b1b7547f94b641
miniobject: Add parent pointers to the miniobject to influence writability

Every container of miniobjects now needs to store itself as parent in
the child object, and remove itself again at a later time.

A miniobject is only writable if there is at most one parent, and that
parent is writable itself, and if the reference count of the miniobject
is 1.

GstBuffer (for memories), GstBufferList (for buffers) and GstSample (for
caps, buffer, bufferlist) was updated accordingly.

Without this it was possible to have e.g. a bufferlist with refcount 2
in two places, modifying the same buffer with refcount 1 at the same
time.

https://bugzilla.gnome.org/show_bug.cgi?id=796692
docs/gst/gstreamer-sections.txt
gst/gstbuffer.c
gst/gstbufferlist.c
gst/gstminiobject.c
gst/gstminiobject.h
gst/gstsample.c
win32/common/libgstreamer.def