summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2008-10-14 15:47:25 +0000
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-14 15:47:25 +0000
commit365109dcd86d8e5f257bb1c2312255e0dcea0d89 (patch)
tree0b1c4279852e5475a5910c2b65ef0d149f8aadd1 /linux/drivers/media
parentfab6e0e98e9f4237c1fee25032b28158ead2383c (diff)
downloadmediapointer-dvb-s2-365109dcd86d8e5f257bb1c2312255e0dcea0d89.tar.gz
mediapointer-dvb-s2-365109dcd86d8e5f257bb1c2312255e0dcea0d89.tar.bz2
Add uyvy pixel format support to vivi
From: Magnus Damm <damm@igel.co.jp> 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 'linux/drivers/media')
-rw-r--r--linux/drivers/media/video/vivi.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/linux/drivers/media/video/vivi.c b/linux/drivers/media/video/vivi.c
index df558c51f..ec6c971d8 100644
--- a/linux/drivers/media/video/vivi.c
+++ b/linux/drivers/media/video/vivi.c
@@ -137,6 +137,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)
@@ -285,6 +290,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;
}
}
}
@@ -759,6 +778,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;
}