[media] zr364xx: fix querycap and fill in colorspace
authorHans Verkuil <hans.verkuil@cisco.com>
Sat, 2 Jun 2012 10:50:30 +0000 (07:50 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 21 Jun 2012 14:25:37 +0000 (11:25 -0300)
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/zr364xx.c

index 974515dd19d63b31d4bb4d232494146ab15c1f62..a1729b39a85b5468ab88c981d0d2ef09f496b19e 100644 (file)
@@ -731,9 +731,10 @@ static int zr364xx_vidioc_querycap(struct file *file, void *priv,
        strlcpy(cap->card, cam->udev->product, sizeof(cap->card));
        strlcpy(cap->bus_info, dev_name(&cam->udev->dev),
                sizeof(cap->bus_info));
-       cap->capabilities = V4L2_CAP_VIDEO_CAPTURE |
+       cap->device_caps = V4L2_CAP_VIDEO_CAPTURE |
                            V4L2_CAP_READWRITE |
                            V4L2_CAP_STREAMING;
+       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
 
        return 0;
 }
@@ -828,7 +829,7 @@ static int zr364xx_vidioc_try_fmt_vid_cap(struct file *file, void *priv,
        f->fmt.pix.field = V4L2_FIELD_NONE;
        f->fmt.pix.bytesperline = f->fmt.pix.width * 2;
        f->fmt.pix.sizeimage = f->fmt.pix.height * f->fmt.pix.bytesperline;
-       f->fmt.pix.colorspace = 0;
+       f->fmt.pix.colorspace = V4L2_COLORSPACE_JPEG;
        f->fmt.pix.priv = 0;
        DBG("%s: V4L2_PIX_FMT_%s (%d) ok!\n", __func__,
            decode_fourcc(f->fmt.pix.pixelformat, pixelformat_name),
@@ -851,7 +852,7 @@ static int zr364xx_vidioc_g_fmt_vid_cap(struct file *file, void *priv,
        f->fmt.pix.height = cam->height;
        f->fmt.pix.bytesperline = f->fmt.pix.width * 2;
        f->fmt.pix.sizeimage = f->fmt.pix.height * f->fmt.pix.bytesperline;
-       f->fmt.pix.colorspace = 0;
+       f->fmt.pix.colorspace = V4L2_COLORSPACE_JPEG;
        f->fmt.pix.priv = 0;
        return 0;
 }
@@ -888,7 +889,7 @@ static int zr364xx_vidioc_s_fmt_vid_cap(struct file *file, void *priv,
                 cam->width, cam->height);
        f->fmt.pix.bytesperline = f->fmt.pix.width * 2;
        f->fmt.pix.sizeimage = f->fmt.pix.height * f->fmt.pix.bytesperline;
-       f->fmt.pix.colorspace = 0;
+       f->fmt.pix.colorspace = V4L2_COLORSPACE_JPEG;
        f->fmt.pix.priv = 0;
        cam->vb_vidq.field = f->fmt.pix.field;