From 06c65418d7aeadb7db3880cf815b7d0ff8d36b83 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 8 Sep 2011 13:28:24 +0200 Subject: [PATCH] v4l2: use GST_RESOURCE_ERROR_BUSY if v4l2_ioctl fails with EBUSY https://bugzilla.gnome.org/show_bug.cgi?id=658543 --- sys/v4l2/gstv4l2object.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index 24a4123..e361970 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -2175,11 +2175,20 @@ get_fmt_failed: } set_fmt_failed: { - GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS, - (_("Device '%s' cannot capture at %dx%d"), - v4l2object->videodev, width, height), - ("Call to S_FMT failed for %" GST_FOURCC_FORMAT " @ %dx%d: %s", - GST_FOURCC_ARGS (pixelformat), width, height, g_strerror (errno))); + if (errno == EBUSY) { + GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, BUSY, + (_("Device '%s' is busy"), 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_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS, + (_("Device '%s' cannot capture at %dx%d"), + v4l2object->videodev, width, height), + ("Call to S_FMT failed for %" GST_FOURCC_FORMAT " @ %dx%d: %s", + GST_FOURCC_ARGS (pixelformat), width, height, + g_strerror (errno))); + } return FALSE; } invalid_dimensions: -- 2.7.4