[libcamera-devel,v1,5/5] gstreamer: Change the colorSpace in the Stream configuration.
diff mbox series

Message ID 20220703073358.76643-5-rishikeshdonadkar@gmail.com
State Superseded
Headers show
Series
  • [libcamera-devel,v1,1/5] gstreamer: Convert form colorspace to colorimetry.
Related show

Commit Message

Rishikesh Donadkar July 3, 2022, 7:33 a.m. UTC
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@gmail.com>
---
 src/gstreamer/gstlibcamerasrc.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

Patch
diff mbox series

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());