libv4l2: Support output devices too
authorHans de Goede <hdegoede@redhat.com>
Sun, 17 Jul 2011 20:40:41 +0000 (22:40 +0200)
committerHans de Goede <hdegoede@redhat.com>
Sun, 17 Jul 2011 20:43:57 +0000 (22:43 +0200)
Now that we support plugins it makes sense to also wrap output devices,
so that we can use plugins with them too.

Remark, we should probably add a write() callback to the dev_ops,
and a libv4l2_write function too ?

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
lib/libv4l2/libv4l2.c

index e975a65..04689b8 100644 (file)
@@ -617,13 +617,6 @@ int v4l2_fd_open(int fd, int v4l2_flags)
                return -1;
        }
 
-       /* we only add functionality for video capture devices */
-       if (!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE) ||
-           !(cap.capabilities & (V4L2_CAP_STREAMING | V4L2_CAP_READWRITE))) {
-               v4l2_plugin_cleanup(plugin_library, dev_ops_priv, dev_ops);
-               return fd;
-       }
-
        /* Get current cam format */
        fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
        if (dev_ops->ioctl(dev_ops_priv, fd, VIDIOC_G_FMT, &fmt)) {