]> git.baikalelectronics.ru Git - kernel.git/commit
media: v4l2-common: add pixel encoding support
authorBenoit Parrot <bparrot@ti.com>
Mon, 7 Oct 2019 15:10:07 +0000 (12:10 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 10 Oct 2019 16:53:23 +0000 (13:53 -0300)
commitf701b8b6d95c64e15028abc255f34682ae001b26
tree8bace6f29690239033d79df365846340162ac627
parent90138ade53b17cc4a2e374a1984e063e72114669
media: v4l2-common: add pixel encoding support

It is often useful to figure out if a pixel_format is either YUV or RGB
especially for driver who can perform the pixel encoding conversion.

Instead of having each driver implement its own "is_this_yuv/rgb"
function based on a restricted set of pixel value, it is better to do
this in centralized manner.

We therefore add a pixel_enc member to the v4l2_format_info structure to
quickly identify the related pixel encoding.
And add helper functions to check pixel encoding.

Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/v4l2-core/v4l2-common.c
include/media/v4l2-common.h