From 0dcc36e29637762a35c6ca4ca29f93e06dfd3d77 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Wed, 18 Jan 2023 14:42:41 +0100 Subject: libcamera: imx8-isi: Split Bayer/YUV config generation The ISI can: - produce any processed (YUV/RGB) stream format from a non-Raw media bus format - produce Bayer Raw stream formats from a Bayer RAW media bus format At generateConfiguration() a YUV/RGB pixel format is preferred for the StillCapture/VideoRecording/Viewfinder roles, but currently there are no guarantees in place that the sensor provide a non-Bayer bus format from which YUV/RGB an be generated. This makes the default configuration generated for those roles not to work if the sensor is a RAW-only one. To improve the situation split the configuration generation in two: - One for YUV modes - One for Raw Bayer mode StreamRoles assigned to a YUV mode will try to first generate a YUV configuration and then fallback to RAW if that's what the sensor can provide. As an additional requirement, for YUV streams, the generated mode has to be validated with the sensor to confirm the desired sizes can be generated. In order to test a format on the sensor introduce CameraSensor::tryFormat(). Reported-by: Laurent Pinchart Signed-off-by: Jacopo Mondi --- include/libcamera/internal/camera_sensor.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/libcamera/internal/camera_sensor.h') diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h index b9f4d786..ce3a790f 100644 --- a/include/libcamera/internal/camera_sensor.h +++ b/include/libcamera/internal/camera_sensor.h @@ -54,6 +54,7 @@ public: V4L2SubdeviceFormat getFormat(const std::vector &mbusCodes, const Size &size) const; int setFormat(V4L2SubdeviceFormat *format); + int tryFormat(V4L2SubdeviceFormat *format) const; const ControlInfoMap &controls() const; ControlList getControls(const std::vector &ids); -- cgit v1.2.1