[media] vivi: fill in colorspace
authorHans Verkuil <hans.verkuil@cisco.com>
Fri, 29 Jul 2011 10:19:46 +0000 (07:19 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 6 Sep 2011 17:51:00 +0000 (14:51 -0300)
The colorspace was never filled in, causing complaints from v4l2-compliance.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/vivi.c

index a848bd2af97f0b704fbdf49216da85109ee874c2..b3ae1ba97fc653602fb852c8f01bb92f97a0c6c7 100644 (file)
@@ -852,6 +852,11 @@ static int vidioc_g_fmt_vid_cap(struct file *file, void *priv,
                (f->fmt.pix.width * dev->fmt->depth) >> 3;
        f->fmt.pix.sizeimage =
                f->fmt.pix.height * f->fmt.pix.bytesperline;
+       if (dev->fmt->fourcc == V4L2_PIX_FMT_YUYV ||
+           dev->fmt->fourcc == V4L2_PIX_FMT_UYVY)
+               f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M;
+       else
+               f->fmt.pix.colorspace = V4L2_COLORSPACE_SRGB;
        return 0;
 }
 
@@ -885,6 +890,11 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
                (f->fmt.pix.width * fmt->depth) >> 3;
        f->fmt.pix.sizeimage =
                f->fmt.pix.height * f->fmt.pix.bytesperline;
+       if (fmt->fourcc == V4L2_PIX_FMT_YUYV ||
+           fmt->fourcc == V4L2_PIX_FMT_UYVY)
+               f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M;
+       else
+               f->fmt.pix.colorspace = V4L2_COLORSPACE_SRGB;
        return 0;
 }