diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2017-07-19 22:03:29 -0400 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2017-07-21 15:29:10 -0400 |
commit | c00d4cae3c265e097bf2dde52e18ec741d6460c3 (patch) | |
tree | f030db4e492e5d13870df70eda1ad094b30350e0 /sys | |
parent | 558e9f4e574d8e1268d2d8d8fbccb1f13ecc391f (diff) |
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
Diffstat (limited to 'sys')
-rw-r--r-- | sys/v4l2/gstv4l2object.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index 835070107..df0963253 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -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))); |