From fa436c0799039c15afb1ac3422241d3e3e2a24de Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 26 Mar 2012 15:30:00 +0200 Subject: [PATCH] v4l2: called base class start Chain up to the base class start method so that metadata is properly tagged. Remove an unused variable. fixes: https://bugzilla.gnome.org/show_bug.cgi?id=672813 --- sys/v4l2/gstv4l2bufferpool.c | 22 ++++------------------ sys/v4l2/gstv4l2bufferpool.h | 1 - 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c index 306814717c..5d6f59369f 100644 --- a/sys/v4l2/gstv4l2bufferpool.c +++ b/sys/v4l2/gstv4l2bufferpool.c @@ -277,8 +277,7 @@ gst_v4l2_buffer_pool_set_config (GstBufferPool * bpool, GstStructure * config) GST_DEBUG_OBJECT (pool, "config %" GST_PTR_FORMAT, config); pool->size = size; - pool->max_buffers = MAX (min_buffers, max_buffers); - pool->min_buffers = MIN (pool->max_buffers, min_buffers); + pool->max_buffers = max_buffers; pool->params = params; gst_buffer_pool_config_set_params (config, caps, size, min_buffers, @@ -338,11 +337,9 @@ gst_v4l2_buffer_pool_start (GstBufferPool * bpool) { GstV4l2BufferPool *pool = GST_V4L2_BUFFER_POOL (bpool); GstV4l2Object *obj = pool->obj; - gint n; struct v4l2_requestbuffers breq; - gint min_buffers, max_buffers; + gint max_buffers; - min_buffers = pool->min_buffers; max_buffers = pool->max_buffers; switch (obj->mode) { @@ -392,14 +389,8 @@ gst_v4l2_buffer_pool_start (GstBufferPool * bpool) pool->num_allocated = 0; /* now, allocate the buffers: */ - for (n = 0; n < min_buffers; n++) { - GstBuffer *buffer; - - if (gst_v4l2_buffer_pool_alloc_buffer (bpool, &buffer, NULL) != GST_FLOW_OK) - goto buffer_new_failed; - - gst_v4l2_buffer_pool_release_buffer (bpool, buffer); - } + if (!GST_BUFFER_POOL_CLASS (parent_class)->start (bpool)) + goto start_failed; /* we can start capturing now, we wait for the playback case until we queued * the first buffer */ @@ -425,11 +416,6 @@ no_buffers: breq.count, obj->videodev, GST_V4L2_MIN_BUFFERS); return FALSE; } -buffer_new_failed: - { - GST_ERROR_OBJECT (pool, "failed to create a buffer"); - return FALSE; - } start_failed: { GST_ERROR_OBJECT (pool, "failed to start streaming"); diff --git a/sys/v4l2/gstv4l2bufferpool.h b/sys/v4l2/gstv4l2bufferpool.h index 532a39b0c9..6a0d19ad34 100644 --- a/sys/v4l2/gstv4l2bufferpool.h +++ b/sys/v4l2/gstv4l2bufferpool.h @@ -54,7 +54,6 @@ struct _GstV4l2BufferPool GstAllocator *allocator; GstAllocationParams params; guint size; - guint min_buffers; guint max_buffers; gboolean add_videometa;