[libcamera-devel] [PATCH v3 4/5] gstreamer: Configure the colorSpace in the Stream configuration.
Rishikesh Donadkar
rishikeshdonadkar at gmail.com
Mon Jul 11 17:37:10 CEST 2022
Get the colorimetry if requested in the gstreamer pipeline and
convert it to colorspace using the function colorspace_from_colorimetry()
Set the colorspace as a result of conversion in the StreamConfiguration.
Signed-off-by: Rishikesh Donadkar <rishikeshdonadkar at gmail.com>
---
src/gstreamer/gstlibcamera-utils.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/gstreamer/gstlibcamera-utils.cpp b/src/gstreamer/gstlibcamera-utils.cpp
index 5b3bfd70..b3fc9ff4 100644
--- a/src/gstreamer/gstlibcamera-utils.cpp
+++ b/src/gstreamer/gstlibcamera-utils.cpp
@@ -278,6 +278,14 @@ gst_libcamera_configure_stream_from_caps(StreamConfiguration &stream_cfg,
g_critical("Unsupported media type: %s", gst_structure_get_name(s));
}
+ /* Configure colorSpace */
+ if (gst_structure_has_field(s, "colorimetry")) {
+ const gchar *colorimetry_in_caps = gst_structure_get_string(s, "colorimetry");
+ std::optional<ColorSpace> colorSpace = colorspace_from_colorimetry(colorimetry_in_caps);
+ if (colorSpace)
+ stream_cfg.colorSpace = colorSpace;
+ }
+
gint width, height;
gst_structure_get_int(s, "width", &width);
gst_structure_get_int(s, "height", &height);
--
2.25.1
More information about the libcamera-devel
mailing list