[Bug 724481] bufferpool: Doesn't reset buffers when releasing them to the pool

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue Feb 25 06:14:47 PST 2014


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

--- Comment #4 from Wim Taymans <wim.taymans at gmail.com> 2014-02-25 14:36:03 UTC ---
IMO, each pool implementation should

1) reset the buffer to a good state (flags, timestamps, offsets, metadata) in
the
  reset_buffer method
2) check if all buffer properties are acceptable (memory, memory size,
metadata) in release_buffer

1) can always happen (unfortunately the API does not allow us to remove the
buffer there)..
If 2) determines that the buffer is not acceptable, it should be discarded and
not be released into the pool.

Usually, memory is also pooled (like v4l2 or xvimagesink) in the allocator so
it will be released  independently of the buffer later.

If a new buffer is needed and an old one is available in the pool, it can be
used directly, else the alloc_buffer vmethod makes a new one.

The idea is that the normal case is that a buffer+meta+memory is made in the
pool once and can be reused directly so that you don't have the overhead of
making a buffer + memory + meta. If that turns out to be impossible, you need
to fall back to creating a buffer every time as outlined above. In any case,
you want to optimize for reuse.

-- 
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