[gstreamer-bugs] [Bug 619500] It is not possible to "recycle" buffers without subclassing GstBuffer object

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue May 25 02:57:33 PDT 2010


https://bugzilla.gnome.org/show_bug.cgi?id=619500
  GStreamer | gstreamer (core) | 0.10.29

Mark Nauwelaerts <mnauw> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mnauw at users.sourceforge.net

--- Comment #1 from Mark Nauwelaerts <mnauw at users.sourceforge.net> 2010-05-25 09:57:27 UTC ---
With current code, it looks like the first problem could happen indeed.  On the
one hand, that need not be a real problem (might be suboptimal to believe
buffer has been destroyed while it has not, but it should not mess up stuff). 
On the other hand, that approach basically means buffers are snatched from the
originating (sink) pool and sort of collected into a source pool.

As for the second problem, I am not clear on where this would occur, since the
current code effectively gives "first turn" to the weak notification (before
the actual _finalize gets a chance to decide on recycling or not).

As an alternative approach, rather than trying to overload _finalize by all
sorts of recycling tricks behind-the-scenes that then compete with each other,
we could make this all more explicit.  That is, we could introduce a GstBuffer
subclass, say GstPooledBuffer, which could then be used as a basetype for the
pooled buffer implementations in e.g. xvimagesink and/or v4l2src.  It would
provide certain common 'services', most notably arranging for these buffers to
be recycled into a (say) GstBufferPool (= basically wrapping a collection/list
of buffers and whatever (e.g. locks) are needed).
Callbacks can arrange for subclass specific actions/notifications (e.g. when a
buffer is being recycled or being really destroyed).

In particular, this allows the owning pool to really release (finalize) the
buffer if needed (without interference) and thereby merely informing others
that they should "clean up any references".  Alternatively, if it does not mind
recycling, the notification could allow others to "claim" the buffer and carry
on using it (without the owning pool then ending up surprised by this).

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- 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