[libcamera-devel,v2,2/2] libcamera: formats: add missing RGBX8888 info
diff mbox series

Message ID 20220519070620.10373-2-tomi.valkeinen@ideasonboard.com
State Accepted
Commit 4a7e5d3b8b1be4d8e9bbb00eaf00266f8c0aea9d
Headers show
Series
  • [libcamera-devel,v2,1/2] libcamera: formats: fix warning print
Related show

Commit Message

Tomi Valkeinen May 19, 2022, 7:06 a.m. UTC
Add missing RGBX8888 PixelFormatInfo.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---

Changes to v1:
* Fixed the wrong v4l2 format
* Added entry to v4l2_pixelformat.cpp

 src/libcamera/formats.cpp          | 13 +++++++++++++
 src/libcamera/v4l2_pixelformat.cpp |  2 ++
 2 files changed, 15 insertions(+)

Comments

Laurent Pinchart May 19, 2022, 10:43 a.m. UTC | #1
Hi Tomi,

Thank you for the patch.

On Thu, May 19, 2022 at 10:06:20AM +0300, Tomi Valkeinen wrote:
> Add missing RGBX8888 PixelFormatInfo.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> 
> Changes to v1:
> * Fixed the wrong v4l2 format
> * Added entry to v4l2_pixelformat.cpp
> 
>  src/libcamera/formats.cpp          | 13 +++++++++++++
>  src/libcamera/v4l2_pixelformat.cpp |  2 ++
>  2 files changed, 15 insertions(+)
> 
> diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
> index 3e60ec7d..a4f27cd4 100644
> --- a/src/libcamera/formats.cpp
> +++ b/src/libcamera/formats.cpp
> @@ -231,6 +231,19 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
>  		.pixelsPerGroup = 1,
>  		.planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},
>  	} },
> +	{ formats::RGBX8888, {
> +		.name = "RGBX8888",
> +		.format = formats::RGBX8888,
> +		.v4l2Formats = {
> +			.single = V4L2PixelFormat(V4L2_PIX_FMT_BGRX32),
> +			.multi = V4L2PixelFormat(),
> +		},
> +		.bitsPerPixel = 32,
> +		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> +		.packed = false,
> +		.pixelsPerGroup = 1,
> +		.planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},
> +	} },
>  	{ formats::BGRX8888, {
>  		.name = "BGRX8888",
>  		.format = formats::BGRX8888,
> diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp
> index 1dd93baa..0b980a97 100644
> --- a/src/libcamera/v4l2_pixelformat.cpp
> +++ b/src/libcamera/v4l2_pixelformat.cpp
> @@ -61,6 +61,8 @@ const std::map<V4L2PixelFormat, V4L2PixelFormat::Info> vpf2pf{
>  		{ formats::BGRX8888, "32-bit XRGB 8-8-8-8" } },
>  	{ V4L2PixelFormat(V4L2_PIX_FMT_RGBX32),
>  		{ formats::XBGR8888, "32-bit RGBX 8-8-8-8" } },
> +	{ V4L2PixelFormat(V4L2_PIX_FMT_BGRX32),
> +		{ formats::RGBX8888, "32-bit XBGR 8-8-8-8" } },
>  	{ V4L2PixelFormat(V4L2_PIX_FMT_RGBA32),
>  		{ formats::ABGR8888, "32-bit RGBA 8-8-8-8" } },
>  	{ V4L2PixelFormat(V4L2_PIX_FMT_ABGR32),

Patch
diff mbox series

diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
index 3e60ec7d..a4f27cd4 100644
--- a/src/libcamera/formats.cpp
+++ b/src/libcamera/formats.cpp
@@ -231,6 +231,19 @@  const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
 		.pixelsPerGroup = 1,
 		.planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},
 	} },
+	{ formats::RGBX8888, {
+		.name = "RGBX8888",
+		.format = formats::RGBX8888,
+		.v4l2Formats = {
+			.single = V4L2PixelFormat(V4L2_PIX_FMT_BGRX32),
+			.multi = V4L2PixelFormat(),
+		},
+		.bitsPerPixel = 32,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
+		.packed = false,
+		.pixelsPerGroup = 1,
+		.planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},
+	} },
 	{ formats::BGRX8888, {
 		.name = "BGRX8888",
 		.format = formats::BGRX8888,
diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp
index 1dd93baa..0b980a97 100644
--- a/src/libcamera/v4l2_pixelformat.cpp
+++ b/src/libcamera/v4l2_pixelformat.cpp
@@ -61,6 +61,8 @@  const std::map<V4L2PixelFormat, V4L2PixelFormat::Info> vpf2pf{
 		{ formats::BGRX8888, "32-bit XRGB 8-8-8-8" } },
 	{ V4L2PixelFormat(V4L2_PIX_FMT_RGBX32),
 		{ formats::XBGR8888, "32-bit RGBX 8-8-8-8" } },
+	{ V4L2PixelFormat(V4L2_PIX_FMT_BGRX32),
+		{ formats::RGBX8888, "32-bit XBGR 8-8-8-8" } },
 	{ V4L2PixelFormat(V4L2_PIX_FMT_RGBA32),
 		{ formats::ABGR8888, "32-bit RGBA 8-8-8-8" } },
 	{ V4L2PixelFormat(V4L2_PIX_FMT_ABGR32),