@@ -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);
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@gmail.com> --- src/gstreamer/gstlibcamera-utils.cpp | 8 ++++++++ 1 file changed, 8 insertions(+)