1 From 1f1d93391b9662de72187a5a709bacf2d25f6e86 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dsteve@broadcom.com>
3 Date: Wed, 12 Feb 2014 15:35:41 +0000
4 Subject: [PATCH 171/196] V4L2: Add additional pixel formats. Correct
7 Adds the other flavours of YUYV, and NV12.
8 Corrects the overlay advertised colourspace.
10 Signed-off-by: Dave Stevenson <dsteve@broadcom.com>
12 drivers/media/platform/bcm2835/bcm2835-camera.c | 36 +++++++++++++++++++++++--
13 1 file changed, 34 insertions(+), 2 deletions(-)
15 diff --git a/drivers/media/platform/bcm2835/bcm2835-camera.c b/drivers/media/platform/bcm2835/bcm2835-camera.c
16 index 8285e6a..3dea993 100644
17 --- a/drivers/media/platform/bcm2835/bcm2835-camera.c
18 +++ b/drivers/media/platform/bcm2835/bcm2835-camera.c
19 @@ -114,7 +114,39 @@ static struct mmal_fmt formats[] = {
20 .mmal = MMAL_ENCODING_MJPEG,
22 .mmal_component = MMAL_COMPONENT_VIDEO_ENCODE,
26 + .name = "4:2:2, packed, YVYU",
27 + .fourcc = V4L2_PIX_FMT_YVYU,
29 + .mmal = MMAL_ENCODING_YVYU,
31 + .mmal_component = MMAL_COMPONENT_CAMERA,
34 + .name = "4:2:2, packed, VYUY",
35 + .fourcc = V4L2_PIX_FMT_VYUY,
37 + .mmal = MMAL_ENCODING_VYUY,
39 + .mmal_component = MMAL_COMPONENT_CAMERA,
42 + .name = "4:2:2, packed, UYVY",
43 + .fourcc = V4L2_PIX_FMT_UYVY,
45 + .mmal = MMAL_ENCODING_UYVY,
47 + .mmal_component = MMAL_COMPONENT_CAMERA,
50 + .name = "4:2:0, packed, NV12",
51 + .fourcc = V4L2_PIX_FMT_NV12,
53 + .mmal = MMAL_ENCODING_NV12,
55 + .mmal_component = MMAL_COMPONENT_CAMERA,
59 static struct mmal_fmt *get_format(struct v4l2_format *f)
60 @@ -691,7 +723,7 @@ static int vidioc_g_fbuf(struct file *file, void *fh,
61 a->fmt.bytesperline = (preview_port->es.video.width * 3)>>1;
62 a->fmt.sizeimage = (preview_port->es.video.width *
63 preview_port->es.video.height * 3)>>1;
64 - a->fmt.colorspace = V4L2_COLORSPACE_SMPTE170M;
65 + a->fmt.colorspace = V4L2_COLORSPACE_JPEG;