libv4l1: move VIDIOCCAPTURE to libv4l1
authorHuzaifa Sidhpurwala <huzaifas@redhat.com>
Fri, 4 Jun 2010 07:40:14 +0000 (13:10 +0530)
committerHans de Goede <hdegoede@redhat.com>
Mon, 7 Jun 2010 07:39:33 +0000 (09:39 +0200)
move VIDIOCCAPTURE to libv4l1

Signed-of-by: Huzaifa Sidhpurwala <huzaifas@redhat.com>
lib/libv4l1/libv4l1.c

index 579f13b..2981c40 100644 (file)
@@ -967,6 +967,22 @@ int v4l1_ioctl(int fd, unsigned long int request, ...)
 
                break;
        }
+
+       case VIDIOCCAPTURE: {
+               int *on = arg;
+               enum v4l2_buf_type captype = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+
+               if (0 == *on) {
+               /* dirty hack time.  But v4l1 has no STREAMOFF
+               * equivalent in the API, and this one at
+               * least comes close ... */
+                       v4l2_ioctl(fd, VIDIOC_STREAMOFF, &captype);
+               }
+
+               result = v4l2_ioctl(fd, VIDIOC_OVERLAY, on);
+
+               break;
+       }
        default:
                /* Pass through libv4l2 for applications which are using v4l2 through
                   libv4l1 (this can happen with the v4l1compat.so wrapper preloaded */