From 91122dea978c880b9bb03a78641ff5585e20be8c Mon Sep 17 00:00:00 2001 From: David Plowman Date: Wed, 5 May 2021 14:53:07 +0100 Subject: libcamera: camera_sensor: Fix frame lengths calculated by sensorInfo() The minimum and maximum vblanking can change when a new format is applied to the sensor subdevice, so be sure to retrieve up-to-date values. The V4L2Device acquires the new updateControlInfo() method to perform this function, and which the CameraSensor calls automatically if its setFormat method is used to update the sensor. However, not all pipeline handlers invoke the setFormat method directly, so the new method must be made publicly available for pipeline handlers to call if they need to. Signed-off-by: David Plowman Reviewed-by: Jacopo Mondi Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- include/libcamera/internal/camera_sensor.h | 2 ++ include/libcamera/internal/v4l2_device.h | 2 ++ 2 files changed, 4 insertions(+) (limited to 'include') diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h index 3fa3a419..2a5c51a1 100644 --- a/include/libcamera/internal/camera_sensor.h +++ b/include/libcamera/internal/camera_sensor.h @@ -68,6 +68,8 @@ public: const ControlList &properties() const { return properties_; } int sensorInfo(CameraSensorInfo *info) const; + void updateControlInfo(); + protected: std::string logPrefix() const override; diff --git a/include/libcamera/internal/v4l2_device.h b/include/libcamera/internal/v4l2_device.h index 087f07e7..5ba9b23b 100644 --- a/include/libcamera/internal/v4l2_device.h +++ b/include/libcamera/internal/v4l2_device.h @@ -42,6 +42,8 @@ public: int setFrameStartEnabled(bool enable); Signal frameStart; + void updateControlInfo(); + protected: V4L2Device(const std::string &deviceNode); ~V4L2Device(); -- cgit v1.2.1