From f484857994075d0e4d33f8897cb3b47c7cf3fd6a Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Thu, 4 Mar 2021 14:10:13 +0100 Subject: libcamera: camera_sensor: Cap resolution to max frame size Since commit 96aecfe36508 ("libcamera: camera_sensor: Use active area size as resolution") the CameraSensor::resolution() method returned the sensor's active pixel area size. As the CameraSensor::resolution() method is widely used in the library code base to retrieve the maximum frame size the sensor can produce, in case it is smaller than the pixel area size the returned size cannot be used to configure the sensor correctly. Fix this by returning the maximum frame resolution the sensor can produce, or the pixel area size in case the sensor embeds and ISP that can upscale and the supported maximum frame size is thus larger that the pixel array size. Reviewed-by: Laurent Pinchart Tested-by: Laurent Pinchart Signed-off-by: Jacopo Mondi --- include/libcamera/internal/camera_sensor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h index 71d012f7..3e98f71b 100644 --- a/include/libcamera/internal/camera_sensor.h +++ b/include/libcamera/internal/camera_sensor.h @@ -53,7 +53,7 @@ public: const MediaEntity *entity() const { return entity_; } const std::vector &mbusCodes() const { return mbusCodes_; } const std::vector &sizes() const { return sizes_; } - Size resolution() const { return activeArea_.size(); } + Size resolution() const; V4L2SubdeviceFormat getFormat(const std::vector &mbusCodes, const Size &size) const; -- cgit v1.2.1