mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 00:06:36 +00:00
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:
parent
75d33dbd43
commit
fa436c0799
2 changed files with 4 additions and 19 deletions
|
@ -277,8 +277,7 @@ gst_v4l2_buffer_pool_set_config (GstBufferPool * bpool, GstStructure * config)
|
||||||
GST_DEBUG_OBJECT (pool, "config %" GST_PTR_FORMAT, config);
|
GST_DEBUG_OBJECT (pool, "config %" GST_PTR_FORMAT, config);
|
||||||
|
|
||||||
pool->size = size;
|
pool->size = size;
|
||||||
pool->max_buffers = MAX (min_buffers, max_buffers);
|
pool->max_buffers = max_buffers;
|
||||||
pool->min_buffers = MIN (pool->max_buffers, min_buffers);
|
|
||||||
pool->params = params;
|
pool->params = params;
|
||||||
|
|
||||||
gst_buffer_pool_config_set_params (config, caps, size, min_buffers,
|
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);
|
GstV4l2BufferPool *pool = GST_V4L2_BUFFER_POOL (bpool);
|
||||||
GstV4l2Object *obj = pool->obj;
|
GstV4l2Object *obj = pool->obj;
|
||||||
gint n;
|
|
||||||
struct v4l2_requestbuffers breq;
|
struct v4l2_requestbuffers breq;
|
||||||
gint min_buffers, max_buffers;
|
gint max_buffers;
|
||||||
|
|
||||||
min_buffers = pool->min_buffers;
|
|
||||||
max_buffers = pool->max_buffers;
|
max_buffers = pool->max_buffers;
|
||||||
|
|
||||||
switch (obj->mode) {
|
switch (obj->mode) {
|
||||||
|
@ -392,14 +389,8 @@ gst_v4l2_buffer_pool_start (GstBufferPool * bpool)
|
||||||
pool->num_allocated = 0;
|
pool->num_allocated = 0;
|
||||||
|
|
||||||
/* now, allocate the buffers: */
|
/* now, allocate the buffers: */
|
||||||
for (n = 0; n < min_buffers; n++) {
|
if (!GST_BUFFER_POOL_CLASS (parent_class)->start (bpool))
|
||||||
GstBuffer *buffer;
|
goto start_failed;
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* we can start capturing now, we wait for the playback case until we queued
|
/* we can start capturing now, we wait for the playback case until we queued
|
||||||
* the first buffer */
|
* the first buffer */
|
||||||
|
@ -425,11 +416,6 @@ no_buffers:
|
||||||
breq.count, obj->videodev, GST_V4L2_MIN_BUFFERS);
|
breq.count, obj->videodev, GST_V4L2_MIN_BUFFERS);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
buffer_new_failed:
|
|
||||||
{
|
|
||||||
GST_ERROR_OBJECT (pool, "failed to create a buffer");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
start_failed:
|
start_failed:
|
||||||
{
|
{
|
||||||
GST_ERROR_OBJECT (pool, "failed to start streaming");
|
GST_ERROR_OBJECT (pool, "failed to start streaming");
|
||||||
|
|
|
@ -54,7 +54,6 @@ struct _GstV4l2BufferPool
|
||||||
GstAllocator *allocator;
|
GstAllocator *allocator;
|
||||||
GstAllocationParams params;
|
GstAllocationParams params;
|
||||||
guint size;
|
guint size;
|
||||||
guint min_buffers;
|
|
||||||
guint max_buffers;
|
guint max_buffers;
|
||||||
gboolean add_videometa;
|
gboolean add_videometa;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue