1 From dfd619eb2e3415681d726f749984ab5ecf355736 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dsteve@broadcom.com>
3 Date: Thu, 2 Jan 2014 15:57:06 +0000
4 Subject: [PATCH 147/174] V4L2: Correct flag settings for compressed formats
6 Set flags field correctly on enum_fmt_vid_cap for compressed
9 Signed-off-by: Dave Stevenson <dsteve@broadcom.com>
11 drivers/media/platform/bcm2835/bcm2835-camera.c | 9 +++++++++
12 drivers/media/platform/bcm2835/mmal-common.h | 1 +
13 2 files changed, 10 insertions(+)
15 --- a/drivers/media/platform/bcm2835/bcm2835-camera.c
16 +++ b/drivers/media/platform/bcm2835/bcm2835-camera.c
17 @@ -69,6 +69,7 @@ static struct mmal_fmt formats[] = {
19 .name = "4:2:0, packed YUV",
20 .fourcc = V4L2_PIX_FMT_YUV420,
22 .mmal = MMAL_ENCODING_I420,
24 .mmal_component = MMAL_COMPONENT_CAMERA,
25 @@ -76,6 +77,7 @@ static struct mmal_fmt formats[] = {
27 .name = "4:2:2, packed, YUYV",
28 .fourcc = V4L2_PIX_FMT_YUYV,
30 .mmal = MMAL_ENCODING_YUYV,
32 .mmal_component = MMAL_COMPONENT_CAMERA,
33 @@ -83,6 +85,7 @@ static struct mmal_fmt formats[] = {
36 .fourcc = V4L2_PIX_FMT_BGR24,
38 .mmal = MMAL_ENCODING_BGR24,
40 .mmal_component = MMAL_COMPONENT_CAMERA,
41 @@ -90,6 +93,7 @@ static struct mmal_fmt formats[] = {
44 .fourcc = V4L2_PIX_FMT_JPEG,
45 + .flags = V4L2_FMT_FLAG_COMPRESSED,
46 .mmal = MMAL_ENCODING_JPEG,
48 .mmal_component = MMAL_COMPONENT_IMAGE_ENCODE,
49 @@ -97,6 +101,7 @@ static struct mmal_fmt formats[] = {
52 .fourcc = V4L2_PIX_FMT_H264,
53 + .flags = V4L2_FMT_FLAG_COMPRESSED,
54 .mmal = MMAL_ENCODING_H264,
56 .mmal_component = MMAL_COMPONENT_VIDEO_ENCODE,
57 @@ -104,6 +109,7 @@ static struct mmal_fmt formats[] = {
60 .fourcc = V4L2_PIX_FMT_MJPEG,
61 + .flags = V4L2_FMT_FLAG_COMPRESSED,
62 .mmal = MMAL_ENCODING_MJPEG,
64 .mmal_component = MMAL_COMPONENT_VIDEO_ENCODE,
65 @@ -555,6 +561,7 @@ static int vidioc_enum_fmt_vid_overlay(s
67 strlcpy(f->description, fmt->name, sizeof(f->description));
68 f->pixelformat = fmt->fourcc;
69 + f->flags = fmt->flags;
73 @@ -750,6 +757,8 @@ static int vidioc_enum_fmt_vid_cap(struc
75 strlcpy(f->description, fmt->name, sizeof(f->description));
76 f->pixelformat = fmt->fourcc;
77 + f->flags = fmt->flags;
82 --- a/drivers/media/platform/bcm2835/mmal-common.h
83 +++ b/drivers/media/platform/bcm2835/mmal-common.h
87 u32 fourcc; /* v4l2 format id */
88 + int flags; /* v4l2 flags field */
91 u32 mmal_component; /* MMAL component index to be used to encode */