From 96aecfe36508f3c2a2b1be621b3fbe4f72ef1fe6 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 8 Feb 2021 01:33:11 +0200 Subject: libcamera: camera_sensor: Use active area size as resolution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a sensor can upscale the image, the native sensor resolution isn't equal to the largest size reported by the sensor. Use the active area size instead, and default it to the largest enumerated size if the crop rectangle targets are not supported. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Reviewed-by: Jacopo Mondi --- include/libcamera/internal/camera_sensor.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include/libcamera/internal') diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h index f22ffbfe..71d012f7 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_; } - const Size &resolution() const { return resolution_; } + Size resolution() const { return activeArea_.size(); } V4L2SubdeviceFormat getFormat(const std::vector &mbusCodes, const Size &size) const; @@ -87,7 +87,6 @@ private: std::string id_; V4L2Subdevice::Formats formats_; - Size resolution_; std::vector mbusCodes_; std::vector sizes_; -- cgit v1.2.1