mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
v4l2: unref copied buffer
After we copy the incomming buffer to one of our bufferpool buffers, unref the target buffer after rendering so that it is put back in the pool.
This commit is contained in:
parent
b1378f159a
commit
c807bfb693
1 changed files with 2 additions and 21 deletions
|
@ -2717,28 +2717,9 @@ gst_v4l2_object_output_buffer (GstV4l2Object * v4l2object, GstBuffer * buf)
|
|||
return GST_FLOW_ERROR;
|
||||
}
|
||||
}
|
||||
if (!newbuf)
|
||||
gst_buffer_ref (buf);
|
||||
if (newbuf)
|
||||
gst_buffer_unref (newbuf);
|
||||
|
||||
#if 0
|
||||
/* if the driver has more than one buffer, ie. more than just the one we
|
||||
* just queued, then dequeue one immediately to make it available via
|
||||
* _buffer_alloc():
|
||||
*/
|
||||
if (gst_v4l2_buffer_pool_available_buffers (v4l2object->pool) >
|
||||
v4l2object->min_queued_bufs) {
|
||||
GstBuffer *v4l2buf = gst_v4l2_buffer_pool_dqbuf (v4l2object->pool);
|
||||
|
||||
/* note: if we get a buf, we don't want to use it directly (because
|
||||
* someone else could still hold a ref).. but instead we release our
|
||||
* reference to it, and if no one else holds a ref it will be returned
|
||||
* to the pool of available buffers.. and if not, we keep looping.
|
||||
*/
|
||||
if (v4l2buf) {
|
||||
gst_buffer_unref (v4l2buf);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return GST_FLOW_OK;
|
||||
|
||||
/* ERRORS */
|
||||
|
|
Loading…
Reference in a new issue