By Date: <-- -->
By Thread: <-- -->

V4L2 *STD ioctls with webcam drivers



I would like to know what the correct implementation of the *STD ioctls
in V4L2 webcam drivers is.

Either they return -EINVAL or they get implemented like the attached
patch in the http://linux-uvc.berlios.de/ USB driver or like the
http://www.saillard.org/linux/pwc/ driver.

I'm asking because different USB webcam drivers implement different code
and I think a consensus should be reached if we want all the
applications working properly with different drivers.
--- uvcvideo.c
+++ uvcvideo.c
 (at)  (at)  -2148,12 +2148,34  (at)  (at) 
 		return uvc_video_enable(video, 0);
 	}
 
-	/* Analog video standards make no sense for digital cameras. */
-	case VIDIOC_ENUMSTD:
-	case VIDIOC_QUERYSTD:
 	case VIDIOC_G_STD:
+	{
+		v4l2_std_id *std = arg;
+		*std = V4L2_STD_UNKNOWN;
+		return 0;
+	}
+
 	case VIDIOC_S_STD:
+	{
+		v4l2_std_id *std = arg;
+		if (*std != V4L2_STD_UNKNOWN)
+			return -EINVAL;
+		return 0;
+	}
 
+	case VIDIOC_ENUMSTD:
+	{
+		struct v4l2_standard *std = arg;
+		if (std->index != 0)
+			return -EINVAL;
+		std->id = V4L2_STD_UNKNOWN;
+		strncpy(std->name, "webcam", sizeof(std->name));
+		return 0;
+	}
+
+	/* Analog video standards make no sense for digital cameras. */
+	case VIDIOC_QUERYSTD:
+
 	case VIDIOC_OVERLAY:
 
 	case VIDIOC_ENUMAUDIO:
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request (at) redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list