summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2013-05-21 12:02:51 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2013-09-13 16:29:47 +0200
commit2d81f1a249f0c865e2326498078a032c4e1e58ff (patch)
treee0c92f620abf902a6e7e75b963c4638bfbd6ab37
parentf953d545c14638486c28c451bb82f80620856cee (diff)
downloadgst-plugins-good-2d81f1a249f0c865e2326498078a032c4e1e58ff.tar.gz
gst-plugins-good-2d81f1a249f0c865e2326498078a032c4e1e58ff.tar.xz
v4l2: keep a reference to all queued buffers
Without this, a queued buffer may be required, filled and queued before it is dequeued. Calling gst_buffer_pool_acquire_buffer() ensures that the buffer is set up correctly and gst_buffer_unref() calls buffer_release(). https://bugzilla.gnome.org/show_bug.cgi?id=700781
-rw-r--r--sys/v4l2/gstv4l2bufferpool.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c
index 918fadf9f..74dd3ff3b 100644
--- a/sys/v4l2/gstv4l2bufferpool.c
+++ b/sys/v4l2/gstv4l2bufferpool.c
@@ -1207,7 +1207,7 @@ gst_v4l2_buffer_pool_process (GstV4l2BufferPool * pool, GstBuffer * buf)
if (buf->pool == bpool) {
/* nothing, we can queue directly */
- to_queue = buf;
+ to_queue = gst_buffer_ref (buf);
GST_LOG_OBJECT (pool, "processing buffer from our pool");
} else {
GST_LOG_OBJECT (pool, "alloc buffer from our pool");
@@ -1229,8 +1229,7 @@ gst_v4l2_buffer_pool_process (GstV4l2BufferPool * pool, GstBuffer * buf)
/* this can block if all buffers are outstanding which would be
* strange because we would expect the upstream element to have
* allocated them and returned to us.. */
- ret = GST_BUFFER_POOL_CLASS (parent_class)->acquire_buffer (bpool,
- &to_queue, NULL);
+ ret = gst_buffer_pool_acquire_buffer (bpool, &to_queue, NULL);
if (ret != GST_FLOW_OK)
goto acquire_failed;
@@ -1257,7 +1256,7 @@ gst_v4l2_buffer_pool_process (GstV4l2BufferPool * pool, GstBuffer * buf)
/* release the rendered buffer back into the pool. This wakes up any
* thread waiting for a buffer in _acquire() */
- gst_v4l2_buffer_pool_release_buffer (bpool, to_queue);
+ gst_buffer_unref (to_queue);
}
break;
}