aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/vivi.c
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2008-10-14 12:47:25 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-17 17:25:01 -0300
commitfca36bab973303fec01b367a5be644495e8b958d (patch)
tree4bd73b44ecfd329e70df6b2a7dbdfdd0df141068 /drivers/media/video/vivi.c
parentd891f475812bf849c2bb2b2ac60424f9fc8e1cc6 (diff)
V4L/DVB (9237): Add uyvy pixel format support to vivi
This patch simply adds UYVY pixel format support to the vivi driver. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/vivi.c')
-rw-r--r--drivers/media/video/vivi.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index 523f78c4847..2a6ebc126c0 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -134,6 +134,11 @@ static struct vivi_fmt formats[] = {
.fourcc = V4L2_PIX_FMT_YUYV,
.depth = 16,
},
+ {
+ .name = "4:2:2, packed, UYVY",
+ .fourcc = V4L2_PIX_FMT_UYVY,
+ .depth = 16,
+ },
};
static struct vivi_fmt *get_format(struct v4l2_format *f)
@@ -282,6 +287,20 @@ static void gen_twopix(struct vivi_fh *fh, unsigned char *buf, int colorpos)
break;
}
break;
+ case V4L2_PIX_FMT_UYVY:
+ switch (color) {
+ case 1:
+ case 3:
+ *p = r_y;
+ break;
+ case 0:
+ *p = g_u;
+ break;
+ case 2:
+ *p = b_v;
+ break;
+ }
+ break;
}
}
}
@@ -756,6 +775,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
switch (fh->fmt->fourcc) {
case V4L2_PIX_FMT_YUYV:
+ case V4L2_PIX_FMT_UYVY:
is_yuv = 1;
break;
}