[libcamera-devel] [PATCH v2] gstreamer: Provide colorimetry <> ColorSpace mappings

Nicolas Dufresne nicolas.dufresne at collabora.com
Mon Aug 15 15:03:48 CEST 2022


Slowly catching up ;-P

Le lundi 01 août 2022 à 18:01 +0530, Umang Jain a écrit :
> > 
> > > +	default:
> > > +		g_error("Unsupported colorimetry primaries: %d",
> > > colorimetry.primaries);
> > g_error() seems very harsh, do we really need to abort() if the user
> > asks for unsupported primaries (or other colorimetry fields below) ?
> 
> 
> I agree it's harsh - initially I kept as 'warning' but then it was 
> advised that 'warnings' always come with mitigation steps.
> 
> I guess the only mitigation technique here is, making sure mappings exists!

The colorimetry.primaries is being set by gst_video_colorimetry_from_string()
which ensure a valid value exists. The reduces the "unsupported" surface to
newly added colorspace in GStreamer itself, something that only occurs perhaps
once every 3 years.

Perhaps to make this less harsh (and aligned with the caller g_critical("Invalid
colorimetry %s", colorimetry_caps);), we could change
colorspace_from_colorimetry() to return a boolean (success/failure) and have the
colorSpace a return parameter ? We could then consistently use g_criticical and
ignore the GstCaps colorimetry field like we'd do if the user had set an invalid
string.

Nicolas


More information about the libcamera-devel mailing list