[Bug 750039] Keeping buffers with shared memory alive

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Thu May 28 07:48:57 PDT 2015


https://bugzilla.gnome.org/show_bug.cgi?id=750039

Nicolas Dufresne (stormer) <nicolas.dufresne at collabora.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nicolas.dufresne at collabora.
                   |                            |co.uk

--- Comment #2 from Nicolas Dufresne (stormer) <nicolas.dufresne at collabora.co.uk> ---
(In reply to Jan Schmidt from comment #0)
> We had a problem recently with sharing GstMemory to another buffer. The
> memory gains an extra ref and stays alive fine, but the original parent can
> still be unreffed and returned to a bufferpool (and hence reused) while the
> child buffer is still using it.

This is because your pool is only checking "gst_buffer_is_writable()". It
should check for gst_buffer_is_all_memory_writable() writable and discard. That
definitely need fixing in that pool implementation. Is it a known one ? Maybe
we could add this to the base class ?

Though, I agree a mechanism that would make this more pool friendly would be
nice. Right now, a gst_buffer_copy() or any reuse of a memory coming from
another buffer, will cause the original buffer to be discarded and reallocated.
All this may have the side effect to keep few possibly "unused" memory alive
for longer then needed (specially in the case where the buffer has no pool). I
would make use of this mechanism conditional to buffer from pool.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list