mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-17 22:06:41 +00:00
v4l2bufferpool: Cleanly handle v4l2_allocator_new failure
This commit is contained in:
parent
25c26a4c4c
commit
0fb59dbdba
1 changed files with 7 additions and 0 deletions
|
@ -1418,6 +1418,8 @@ gst_v4l2_buffer_pool_new (GstV4l2Object * obj, GstCaps * caps)
|
|||
|
||||
pool->vallocator =
|
||||
gst_v4l2_allocator_new (GST_OBJECT (pool), obj->video_fd, &obj->format);
|
||||
if (pool->vallocator == NULL)
|
||||
goto allocator_failed;
|
||||
|
||||
gst_object_ref (obj->element);
|
||||
|
||||
|
@ -1435,6 +1437,11 @@ dup_failed:
|
|||
GST_ERROR ("failed to dup fd %d (%s)", errno, g_strerror (errno));
|
||||
return NULL;
|
||||
}
|
||||
allocator_failed:
|
||||
{
|
||||
GST_ERROR_OBJECT (pool, "Failed to create V4L2 allocator");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static GstFlowReturn
|
||||
|
|
Loading…
Reference in a new issue