[libcamera-devel] [PATCH v3 01/22] libcamera: formats: Add NV24 and NV42, and reorder NV formats

Kieran Bingham kieran.bingham at ideasonboard.com
Tue Jul 7 10:42:59 CEST 2020


Hi Paul,

On 04/07/2020 14:31, Paul Elder wrote:
> Add formats for NV24 and NV42. While at it, reorder the NV formats so
> that NV12 and NV21 come first, followed by NV16, NV61, NV24, and NV42.
> 
> Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>


> ---
> No change in v3
> ---
>  src/libcamera/formats.cpp | 36 ++++++++++++++++++++++++++----------
>  1 file changed, 26 insertions(+), 10 deletions(-)
> 
> diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
> index 436672e..d3b722c 100644
> --- a/src/libcamera/formats.cpp
> +++ b/src/libcamera/formats.cpp
> @@ -256,6 +256,22 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
>  	} },
>  
>  	/* YUV planar formats. */
> +	{ formats::NV12, {
> +		.name = "NV12",
> +		.format = formats::NV12,
> +		.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_NV12),
> +		.bitsPerPixel = 12,
> +		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +		.packed = false,
> +	} },
> +	{ formats::NV21, {
> +		.name = "NV21",
> +		.format = formats::NV21,
> +		.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_NV21),
> +		.bitsPerPixel = 12,
> +		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +		.packed = false,
> +	} },
>  	{ formats::NV16, {
>  		.name = "NV16",
>  		.format = formats::NV16,
> @@ -272,19 +288,19 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
>  		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
>  		.packed = false,
>  	} },
> -	{ formats::NV12, {
> -		.name = "NV12",
> -		.format = formats::NV12,
> -		.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_NV12),
> -		.bitsPerPixel = 12,
> +	{ formats::NV24, {
> +		.name = "NV24",
> +		.format = formats::NV24,
> +		.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_NV24),
> +		.bitsPerPixel = 24,
>  		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
>  		.packed = false,
>  	} },
> -	{ formats::NV21, {
> -		.name = "NV21",
> -		.format = formats::NV21,
> -		.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_NV21),
> -		.bitsPerPixel = 12,
> +	{ formats::NV42, {
> +		.name = "NV42",
> +		.format = formats::NV42,
> +		.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_NV42),
> +		.bitsPerPixel = 24,
>  		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
>  		.packed = false,
>  	} },
> 

-- 
Regards
--
Kieran


More information about the libcamera-devel mailing list