[PATCH 3/4] gstreamer: Enable bayer formats with 10/12/14/16 bits

Jaslo Ziska jaslo at ziska.de
Tue Apr 22 16:11:00 CEST 2025


GStreamer supports 10/12/14/16-bit bayer formats since version 1.24.

Signed-off-by: Jaslo Ziska <jaslo at ziska.de>
---
 src/gstreamer/gstlibcamera-utils.cpp | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/gstreamer/gstlibcamera-utils.cpp b/src/gstreamer/gstlibcamera-utils.cpp
index 41eea7d8..ddbeb578 100644
--- a/src/gstreamer/gstlibcamera-utils.cpp
+++ b/src/gstreamer/gstlibcamera-utils.cpp
@@ -20,7 +20,7 @@ static struct {
 	/* Compressed */
 	{ GST_VIDEO_FORMAT_ENCODED, formats::MJPEG },
 
-	/* Bayer formats, gstreamer only supports 8-bit */
+	/* Bayer formats */
 	{ GST_VIDEO_FORMAT_ENCODED, formats::SBGGR8 },
 	{ GST_VIDEO_FORMAT_ENCODED, formats::SGBRG8 },
 	{ GST_VIDEO_FORMAT_ENCODED, formats::SGRBG8 },
@@ -325,6 +325,22 @@ bare_structure_from_format(const PixelFormat &format)
 	case formats::SGBRG8:
 	case formats::SGRBG8:
 	case formats::SRGGB8:
+	case formats::SBGGR10:
+	case formats::SGBRG10:
+	case formats::SGRBG10:
+	case formats::SRGGB10:
+	case formats::SBGGR12:
+	case formats::SGBRG12:
+	case formats::SGRBG12:
+	case formats::SRGGB12:
+	case formats::SBGGR14:
+	case formats::SGBRG14:
+	case formats::SGRBG14:
+	case formats::SRGGB14:
+	case formats::SBGGR16:
+	case formats::SGBRG16:
+	case formats::SGRBG16:
+	case formats::SRGGB16:
 		return gst_structure_new("video/x-bayer", "format", G_TYPE_STRING,
 					 bayer_format_to_string(format), nullptr);
 
-- 
2.49.0



More information about the libcamera-devel mailing list