aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2008-10-14 11:47:25 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-17 16:25:01 -0400
commitfca36bab973303fec01b367a5be644495e8b958d (patch)
tree4bd73b44ecfd329e70df6b2a7dbdfdd0df141068 /drivers/media/video
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')
-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[] = {
134 .fourcc = V4L2_PIX_FMT_YUYV, 134 .fourcc = V4L2_PIX_FMT_YUYV,
135 .depth = 16, 135 .depth = 16,
136 }, 136 },
137 {
138 .name = "4:2:2, packed, UYVY",
139 .fourcc = V4L2_PIX_FMT_UYVY,
140 .depth = 16,
141 },
137}; 142};
138 143
139static struct vivi_fmt *get_format(struct v4l2_format *f) 144static 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)
282 break; 287 break;
283 } 288 }
284 break; 289 break;
290 case V4L2_PIX_FMT_UYVY:
291 switch (color) {
292 case 1:
293 case 3:
294 *p = r_y;
295 break;
296 case 0:
297 *p = g_u;
298 break;
299 case 2:
300 *p = b_v;
301 break;
302 }
303 break;
285 } 304 }
286 } 305 }
287} 306}
@@ -756,6 +775,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
756 775
757 switch (fh->fmt->fourcc) { 776 switch (fh->fmt->fourcc) {
758 case V4L2_PIX_FMT_YUYV: 777 case V4L2_PIX_FMT_YUYV:
778 case V4L2_PIX_FMT_UYVY:
759 is_yuv = 1; 779 is_yuv = 1;
760 break; 780 break;
761 } 781 }