gst-plugins-good: v4l2: Improve buffer management
wtay at kemper.freedesktop.org
Tue Apr 24 00:04:53 PDT 2012
Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date: Mon Apr 23 18:01:31 2012 +0200
v4l2: Improve buffer management
Query the amount of available buffers when doing set_config(). This allows us to
configure the parent bufferpool with the number of buffers to preallocate.
Keep track of the provided allocator and use it when we need to allocate a
buffer in RW mode.
When we are can not allocate the requested max_buffers amount of buffers, make
sure we keep 2 buffers around in the pool and copy them into an output buffer.
This makes sure that we always have a buffer to capture into. We also need to
detect those copied buffers and unref them when they return to the pool.
sys/v4l2/gstv4l2bufferpool.c | 178 ++++++++++++++++++++++++++----------------
sys/v4l2/gstv4l2bufferpool.h | 3 +-
sys/v4l2/gstv4l2src.c | 8 +-
3 files changed, 118 insertions(+), 71 deletions(-)
More information about the gstreamer-commits