Commit c00d4cae authored by Nicolas Dufresne's avatar Nicolas Dufresne

v4l2object: Fix try/s_fmt errors

According to the spec,TRY_FMT cannot return EBUSY, though it can
return EINVAL if it was not possible to update the format to
something supported.

https://bugzilla.gnome.org/show_bug.cgi?id=785156
parent 558e9f4e
......@@ -3552,9 +3552,16 @@ invalid_caps:
}
try_fmt_failed:
{
if (errno == EBUSY) {
GST_V4L2_ERROR (error, RESOURCE, BUSY,
(_("Device '%s' is busy"), v4l2object->videodev),
if (errno == EINVAL) {
GST_V4L2_ERROR (error, RESOURCE, SETTINGS,
(_("Device '%s' has no supported format"), v4l2object->videodev),
("Call to TRY_FMT failed for %" GST_FOURCC_FORMAT " @ %dx%d: %s",
GST_FOURCC_ARGS (pixelformat), width, height,
g_strerror (errno)));
} else {
GST_V4L2_ERROR (error, RESOURCE, FAILED,
(_("Device '%s' failed during initialization"),
v4l2object->videodev),
("Call to TRY_FMT failed for %" GST_FOURCC_FORMAT " @ %dx%d: %s",
GST_FOURCC_ARGS (pixelformat), width, height,
g_strerror (errno)));
......@@ -3569,10 +3576,16 @@ set_fmt_failed:
("Call to S_FMT failed for %" GST_FOURCC_FORMAT " @ %dx%d: %s",
GST_FOURCC_ARGS (pixelformat), width, height,
g_strerror (errno)));
} else {
} else if (errno == EINVAL) {
GST_V4L2_ERROR (error, RESOURCE, SETTINGS,
(_("Device '%s' cannot capture at %dx%d"),
v4l2object->videodev, width, height),
(_("Device '%s' has no supported format"), v4l2object->videodev),
("Call to S_FMT failed for %" GST_FOURCC_FORMAT " @ %dx%d: %s",
GST_FOURCC_ARGS (pixelformat), width, height,
g_strerror (errno)));
} else {
GST_V4L2_ERROR (error, RESOURCE, FAILED,
(_("Device '%s' failed during initialization"),
v4l2object->videodev),
("Call to S_FMT failed for %" GST_FOURCC_FORMAT " @ %dx%d: %s",
GST_FOURCC_ARGS (pixelformat), width, height,
g_strerror (errno)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment