From af0ac2c50aa14d1a0cb8aad8aa3820ee70acd7a5 Mon Sep 17 00:00:00 2001 From: Hugues Fruchet Date: Tue, 10 Oct 2023 15:48:35 +0200 Subject: [PATCH 3/4] v4l2codecs: add support of encoding from RGB Add support of encoding from RGB in 16 bits and 32 bits formats: - RGB16 - BGRx - RGBx - xBGR - xRGB Upstream-Status: Pending --- sys/v4l2codecs/gstv4l2format.c | 7 +++++++ sys/v4l2codecs/gstv4l2format.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/v4l2codecs/gstv4l2format.c b/sys/v4l2codecs/gstv4l2format.c index bc20d68..604876e 100644 --- a/sys/v4l2codecs/gstv4l2format.c +++ b/sys/v4l2codecs/gstv4l2format.c @@ -40,6 +40,13 @@ static struct FormatEntry format_map[] = { {V4L2_PIX_FMT_MM21, 2, GST_VIDEO_FORMAT_NV12_16L32S, 8, 420}, {V4L2_PIX_FMT_YUV420M, 3, GST_VIDEO_FORMAT_I420, 8, 420}, {V4L2_PIX_FMT_P010, 1, GST_VIDEO_FORMAT_P010_10LE, 16, 420}, + {V4L2_PIX_FMT_RGB565, 1, GST_VIDEO_FORMAT_RGB16, 16, 0}, + {V4L2_PIX_FMT_XBGR32, 1, GST_VIDEO_FORMAT_BGRx, 32, 0}, + {V4L2_PIX_FMT_BGR32, 1, GST_VIDEO_FORMAT_BGRx, 32, 0}, + {V4L2_PIX_FMT_RGBX32, 1, GST_VIDEO_FORMAT_RGBx, 32, 0}, + {V4L2_PIX_FMT_BGRX32, 1, GST_VIDEO_FORMAT_xBGR, 32, 0}, + {V4L2_PIX_FMT_XRGB32, 1, GST_VIDEO_FORMAT_xRGB, 32, 0}, + {V4L2_PIX_FMT_RGB32, 1, GST_VIDEO_FORMAT_xRGB, 32, 0}, {0,} }; diff --git a/sys/v4l2codecs/gstv4l2format.h b/sys/v4l2codecs/gstv4l2format.h index b579248..dd1e1ea 100644 --- a/sys/v4l2codecs/gstv4l2format.h +++ b/sys/v4l2codecs/gstv4l2format.h @@ -24,7 +24,7 @@ #include #include "linux/videodev2.h" -#define GST_V4L2_DEFAULT_VIDEO_FORMATS "{ NV12, YUY2, NV12_4L4, NV12_32L32, NV12_16L32S, I420, P010_10LE}" +#define GST_V4L2_DEFAULT_VIDEO_FORMATS "{ NV12, YUY2, NV12_4L4, NV12_32L32, NV12_16L32S, I420, P010_10LE, RGB16, BGRx, RGBx, xBGR, xRGB}" gboolean gst_v4l2_format_to_video_info (struct v4l2_format * fmt, GstVideoInfo * out_info); -- 2.25.1