v4l2: handle return value -ENOTTY for unimplemented VIDIOC_G_PARM
authorPhilipp Zabel <p.zabel@pengutronix.de>
Thu, 5 Jul 2012 16:02:27 +0000 (18:02 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 1 May 2013 13:34:50 +0000 (15:34 +0200)
Newer kernels return -ENOTTY, older kernels return -EINVAL if the ioctl
is not implemented. With this patch, GStreamer handles both cases.

https://bugzilla.gnome.org/show_bug.cgi?id=698825

sys/v4l2/gstv4l2object.c

index 1479b41..dd9f79b 100644 (file)
@@ -2461,7 +2461,7 @@ invalid_pixelformat:
 get_parm_failed:
   {
     /* it's possible that this call is not supported */
-    if (errno != EINVAL) {
+    if (errno != EINVAL && errno != ENOTTY) {
       GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS,
           (_("Could not get parameters on device '%s'"),
               v4l2object->videodev), GST_ERROR_SYSTEM);