mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
v4l2: fix error messages
This commit is contained in:
parent
549a4ddc8f
commit
47816e1155
2 changed files with 24 additions and 20 deletions
|
@ -276,23 +276,20 @@ gst_v4l2_buffer_pool_start (GstBufferPool * bpool)
|
|||
/* ERRORS */
|
||||
reqbufs_failed:
|
||||
{
|
||||
GST_ELEMENT_ERROR (pool, RESOURCE, READ,
|
||||
(_("Could not get buffers from device '%s'."),
|
||||
obj->videodev),
|
||||
("error requesting %d buffers: %s", num_buffers, g_strerror (errno)));
|
||||
GST_ERROR_OBJECT (pool,
|
||||
"error requesting %d buffers: %s", num_buffers, g_strerror (errno));
|
||||
return FALSE;
|
||||
}
|
||||
no_buffers:
|
||||
{
|
||||
GST_ELEMENT_ERROR (pool, RESOURCE, READ,
|
||||
(_("Could not get enough buffers from device '%s'."),
|
||||
obj->videodev),
|
||||
("we received %d from device '%s', we want at least %d",
|
||||
breq.count, obj->videodev, GST_V4L2_MIN_BUFFERS));
|
||||
GST_ERROR_OBJECT (pool,
|
||||
"we received %d from device '%s', we want at least %d",
|
||||
breq.count, obj->videodev, GST_V4L2_MIN_BUFFERS);
|
||||
return FALSE;
|
||||
}
|
||||
buffer_new_failed:
|
||||
{
|
||||
GST_ERROR_OBJECT (pool, "failed to create a buffer");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -381,14 +378,14 @@ error:
|
|||
" no buffer was in the outgoing queue. device %s", obj->videodev);
|
||||
break;
|
||||
case EINVAL:
|
||||
GST_ELEMENT_ERROR (pool, RESOURCE, FAILED,
|
||||
(_("Failed trying to get video frames from device '%s'."),
|
||||
obj->videodev),
|
||||
(_("The buffer type is not supported, or the index is out of bounds," " or no buffers have been allocated yet, or the userptr" " or length are invalid. device %s"), obj->videodev));
|
||||
GST_ERROR_OBJECT (pool,
|
||||
"The buffer type is not supported, or the index is out of bounds, "
|
||||
"or no buffers have been allocated yet, or the userptr "
|
||||
"or length are invalid. device %s", obj->videodev);
|
||||
break;
|
||||
case ENOMEM:
|
||||
GST_ELEMENT_ERROR (pool, RESOURCE, FAILED,
|
||||
(_("Failed trying to get video frames from device '%s'. Not enough memory."), obj->videodev), (_("insufficient memory to enqueue a user pointer buffer. device %s."), obj->videodev));
|
||||
GST_ERROR_OBJECT (pool,
|
||||
"insufficient memory to enqueue a user pointer buffer");
|
||||
break;
|
||||
case EIO:
|
||||
GST_INFO_OBJECT (pool,
|
||||
|
@ -417,10 +414,8 @@ error:
|
|||
}
|
||||
no_buffers:
|
||||
{
|
||||
GST_ELEMENT_ERROR (pool, RESOURCE, FAILED,
|
||||
(_("Failed trying to get video frames from device '%s'."),
|
||||
obj->videodev),
|
||||
(_("No free buffers found in the pool at index %d."), vbuffer.index));
|
||||
GST_ERROR_OBJECT (pool, "No free buffers found in the pool at index %d.",
|
||||
vbuffer.index);
|
||||
return GST_FLOW_ERROR;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2070,7 +2070,8 @@ gst_v4l2_object_setup_pool (GstV4l2Object * v4l2object)
|
|||
0, 0);
|
||||
gst_buffer_pool_set_config (v4l2object->pool, config);
|
||||
|
||||
gst_buffer_pool_set_active (v4l2object->pool, TRUE);
|
||||
if (!gst_buffer_pool_set_active (v4l2object->pool, TRUE))
|
||||
goto activate_failed;
|
||||
|
||||
} else if (v4l2object->vcap.capabilities & V4L2_CAP_READWRITE) {
|
||||
GST_INFO_OBJECT (v4l2object->element, "capturing buffers via read()");
|
||||
|
@ -2100,6 +2101,14 @@ no_supported_capture_method:
|
|||
"method."), v4l2object->videodev), (NULL));
|
||||
return FALSE;
|
||||
}
|
||||
activate_failed:
|
||||
{
|
||||
GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, READ,
|
||||
(_("Could not map buffers from device '%s'"),
|
||||
v4l2object->videodev),
|
||||
("Failed to activate buffer pool: %s", g_strerror (errno)));
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue