diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-02-08 01:33:11 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-03-03 22:52:00 +0200 |
commit | 96aecfe36508f3c2a2b1be621b3fbe4f72ef1fe6 (patch) | |
tree | a90780ffb82acac62df50f9ba72afaab37547158 /include | |
parent | 87194982ebd282a23b894d002df49cd86c37bfcb (diff) |
libcamera: camera_sensor: Use active area size as resolution
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 <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/internal/camera_sensor.h | 3 |
1 files changed, 1 insertions, 2 deletions
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<unsigned int> &mbusCodes() const { return mbusCodes_; } const std::vector<Size> &sizes() const { return sizes_; } - const Size &resolution() const { return resolution_; } + Size resolution() const { return activeArea_.size(); } V4L2SubdeviceFormat getFormat(const std::vector<unsigned int> &mbusCodes, const Size &size) const; @@ -87,7 +87,6 @@ private: std::string id_; V4L2Subdevice::Formats formats_; - Size resolution_; std::vector<unsigned int> mbusCodes_; std::vector<Size> sizes_; |