[libcamera-devel] [PATCH] gstreamer: Add support for additional RGB formats

Umang Jain umang.jain at ideasonboard.com
Wed Aug 24 00:36:40 CEST 2022


Hi Laurent,

Thank you for the patch.

On 8/24/22 12:08 AM, Laurent Pinchart via libcamera-devel wrote:
> libcamerasrc only supports three RGB formats. Adding the other RGB
> formats supported by libcamera is trivial, do so.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
> I haven't tested this yet as I don't have a board hooked up that can
> capture these formats. If someone can test it with an OV5640 sensor on
> an i.MX8MP, that would be great, otherwise I'll get to it in the not too
> distant future.
> ---
>   src/gstreamer/gstlibcamera-utils.cpp | 14 +++++++++++++-
>   1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/src/gstreamer/gstlibcamera-utils.cpp b/src/gstreamer/gstlibcamera-utils.cpp
> index c97c0d438de2..5a21a391c698 100644
> --- a/src/gstreamer/gstlibcamera-utils.cpp
> +++ b/src/gstreamer/gstlibcamera-utils.cpp
> @@ -19,9 +19,21 @@ static struct {
>   	/* Compressed */
>   	{ GST_VIDEO_FORMAT_ENCODED, formats::MJPEG },
>   
> -	/* RGB */
> +	/* RGB16 */
> +	{ GST_VIDEO_FORMAT_RGB16, formats::RGB565 },
> +
> +	/* RGB24 */
>   	{ GST_VIDEO_FORMAT_RGB, formats::BGR888 },
>   	{ GST_VIDEO_FORMAT_BGR, formats::RGB888 },
> +
> +	/* RGB32 */
> +	{ GST_VIDEO_FORMAT_BGRx, formats::XRGB8888 },
> +	{ GST_VIDEO_FORMAT_RGBx, formats::XBGR8888 },
> +	{ GST_VIDEO_FORMAT_xBGR, formats::RGBX8888 },
> +	{ GST_VIDEO_FORMAT_xRGB, formats::BGRX8888 },
> +	{ GST_VIDEO_FORMAT_BGRA, formats::ARGB8888 },
> +	{ GST_VIDEO_FORMAT_RGBA, formats::ABGR8888 },
> +	{ GST_VIDEO_FORMAT_ABGR, formats::RGBA8888 },

I have individually cross referenced each entry with V4L2 pixel format 
and seems correct to me,

Reviewed-by: Umang Jain <umang.jain at ideasonboard.com>
>   	{ GST_VIDEO_FORMAT_ARGB, formats::BGRA8888 },
>   
>   	/* YUV Semiplanar */



More information about the libcamera-devel mailing list