[libcamera-devel] [PATCH v1 5/5] gstreamer: Change the colorSpace in the Stream configuration.

Rishikesh Donadkar rishikeshdonadkar at gmail.com
Sun Jul 3 09:33:58 CEST 2022


Get the colorimetry if requested in the gstreamer pipeline and pass
that to the function colorspace_form_colorimetry() which will set
the colorspace corresponding to the requested colorimetry in the
stream configuration.

Signed-off-by: Rishikesh Donadkar <rishikeshdonadkar at gmail.com>
---
 src/gstreamer/gstlibcamerasrc.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp
index 120319b3..91668e81 100644
--- a/src/gstreamer/gstlibcamerasrc.cpp
+++ b/src/gstreamer/gstlibcamerasrc.cpp
@@ -387,6 +387,13 @@ gst_libcamera_src_task_enter(GstTask *task, [[maybe_unused]] GThread *thread,
 	for (gsize i = 0; i < state->srcpads_.size(); i++) {
 		GstPad *srcpad = state->srcpads_[i];
 		StreamConfiguration &stream_cfg = state->config_->at(i);
+		gchar *colorimetry;
+
+		g_object_get(self, "colorimetry", &colorimetry, NULL);
+		if (colorimetry != nullptr) {
+			std::optional<ColorSpace> &colorSpace = stream_cfg.colorSpace;
+			colorspace_form_colorimetry(colorSpace, colorimetry);
+		}
 
 		/* Retrieve the supported caps. */
 		g_autoptr(GstCaps) filter = gst_libcamera_stream_formats_to_caps(stream_cfg.formats());
-- 
2.25.1



More information about the libcamera-devel mailing list