mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 16:08:51 +00:00
v4l2bufferpool: check set_config return value in gst_v4l2_buffer_pool_new
https://bugzilla.gnome.org/show_bug.cgi?id=720568
This commit is contained in:
parent
b39c838ece
commit
55da3bc885
1 changed files with 13 additions and 4 deletions
|
@ -1298,7 +1298,8 @@ GstBufferPool *
|
||||||
gst_v4l2_buffer_pool_new (GstV4l2Object * obj, GstCaps * caps)
|
gst_v4l2_buffer_pool_new (GstV4l2Object * obj, GstCaps * caps)
|
||||||
{
|
{
|
||||||
GstV4l2BufferPool *pool;
|
GstV4l2BufferPool *pool;
|
||||||
GstStructure *s;
|
GstStructure *config;
|
||||||
|
gboolean res = FALSE;
|
||||||
gint fd;
|
gint fd;
|
||||||
|
|
||||||
fd = v4l2_dup (obj->video_fd);
|
fd = v4l2_dup (obj->video_fd);
|
||||||
|
@ -1310,9 +1311,12 @@ gst_v4l2_buffer_pool_new (GstV4l2Object * obj, GstCaps * caps)
|
||||||
pool->obj = obj;
|
pool->obj = obj;
|
||||||
pool->can_alloc = TRUE;
|
pool->can_alloc = TRUE;
|
||||||
|
|
||||||
s = gst_buffer_pool_get_config (GST_BUFFER_POOL_CAST (pool));
|
config = gst_buffer_pool_get_config (GST_BUFFER_POOL_CAST (pool));
|
||||||
gst_buffer_pool_config_set_params (s, caps, obj->sizeimage, 2, 0);
|
gst_buffer_pool_config_set_params (config, caps, obj->sizeimage, 2, 0);
|
||||||
gst_buffer_pool_set_config (GST_BUFFER_POOL_CAST (pool), s);
|
|
||||||
|
res = gst_buffer_pool_set_config (GST_BUFFER_POOL_CAST (pool), config);
|
||||||
|
if (!res)
|
||||||
|
goto config_failed;
|
||||||
|
|
||||||
gst_object_ref (obj->element);
|
gst_object_ref (obj->element);
|
||||||
|
|
||||||
|
@ -1324,6 +1328,11 @@ dup_failed:
|
||||||
GST_DEBUG ("failed to dup fd %d (%s)", errno, g_strerror (errno));
|
GST_DEBUG ("failed to dup fd %d (%s)", errno, g_strerror (errno));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
config_failed:
|
||||||
|
{
|
||||||
|
GST_WARNING ("failed to set pool config");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
|
|
Loading…
Reference in a new issue