[libcamera-devel] [PATCH v2 4/4] gstreamer: Configure the colorSpace in the Stream configuration.
Vedant Paranjape
vedantparanjape160201 at gmail.com
Thu Jul 7 15:09:37 CEST 2022
Hello Rishikesh,
Thanks for the patch
On Thu, Jul 7, 2022 at 11:45 AM Rishikesh Donadkar
<rishikeshdonadkar at gmail.com> wrote:
>
> Get the colorimetry if requested in the gstreamer pipeline and pass
s/and pass that to the function colorspace_form_colorimetry()/and
convert it to colorspace using the function
colorspace_from_colorimetry()
> that to the function colorspace_form_colorimetry() which will set
s/form/from. Also, given the name of the function, and its usage don't
ally much. I mean to say, colorspace_from_colorimetry should simply
return the colorspace and not try to set it.
> the colorspace corresponding to the requested colorimetry in the
> stream configuration.
>
> Signed-off-by: Rishikesh Donadkar <rishikeshdonadkar at gmail.com>
> ---
> src/gstreamer/gstlibcamera-utils.cpp | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/src/gstreamer/gstlibcamera-utils.cpp b/src/gstreamer/gstlibcamera-utils.cpp
> index feefead9..229a29cd 100644
> --- a/src/gstreamer/gstlibcamera-utils.cpp
> +++ b/src/gstreamer/gstlibcamera-utils.cpp
> @@ -279,6 +279,13 @@ 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 = gst_structure_get_string(s, "colorimetry");
> + std::optional<ColorSpace> &colorSpace = stream_cfg.colorSpace;
> + colorspace_form_colorimetry(colorSpace, colorimetry);
> + }
> +
If you do the changes to the function discussed in the patch 3 thread,
this code snip will be simplified.
<snip>
if (gst_structure_has_field(s, "colorimetry")) {
const gchar *colorimetry = gst_structure_get_string(s, "colorimetry");
stream_cfg.colorSpace = colorspace_from_colorimetry(colorimetry);
}
</snip>
Regards,
Vedant Paranjape
> 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