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
This commit is contained in:
Wim Taymans 2012-03-26 15:30:00 +02:00
parent 75d33dbd43
commit fa436c0799
2 changed files with 4 additions and 19 deletions

View file

@ -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");

View file

@ -54,7 +54,6 @@ struct _GstV4l2BufferPool
GstAllocator *allocator;
GstAllocationParams params;
guint size;
guint min_buffers;
guint max_buffers;
gboolean add_videometa;