Skip to content

Commit

Permalink
[media] v4l2-mediabus: improve colorspace support
Browse files Browse the repository at this point in the history
Add and copy the new ycbcr_enc and quantization fields.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  • Loading branch information
Hans Verkuil authored and mchehab committed Dec 1, 2014
1 parent d5735d6 commit 11ff030
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions include/media/v4l2-mediabus.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ static inline void v4l2_fill_pix_format(struct v4l2_pix_format *pix_fmt,
pix_fmt->height = mbus_fmt->height;
pix_fmt->field = mbus_fmt->field;
pix_fmt->colorspace = mbus_fmt->colorspace;
pix_fmt->ycbcr_enc = mbus_fmt->ycbcr_enc;
pix_fmt->quantization = mbus_fmt->quantization;
}

static inline void v4l2_fill_mbus_format(struct v4l2_mbus_framefmt *mbus_fmt,
Expand All @@ -104,6 +106,8 @@ static inline void v4l2_fill_mbus_format(struct v4l2_mbus_framefmt *mbus_fmt,
mbus_fmt->height = pix_fmt->height;
mbus_fmt->field = pix_fmt->field;
mbus_fmt->colorspace = pix_fmt->colorspace;
mbus_fmt->ycbcr_enc = pix_fmt->ycbcr_enc;
mbus_fmt->quantization = pix_fmt->quantization;
mbus_fmt->code = code;
}

Expand Down
6 changes: 5 additions & 1 deletion include/uapi/linux/v4l2-mediabus.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,18 @@
* @code: data format code (from enum v4l2_mbus_pixelcode)
* @field: used interlacing type (from enum v4l2_field)
* @colorspace: colorspace of the data (from enum v4l2_colorspace)
* @ycbcr_enc: YCbCr encoding of the data (from enum v4l2_ycbcr_encoding)
* @quantization: quantization of the data (from enum v4l2_quantization)
*/
struct v4l2_mbus_framefmt {
__u32 width;
__u32 height;
__u32 code;
__u32 field;
__u32 colorspace;
__u32 reserved[7];
__u32 ycbcr_enc;
__u32 quantization;
__u32 reserved[5];
};

#ifndef __KERNEL__
Expand Down

0 comments on commit 11ff030

Please sign in to comment.