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 <david.plowman@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
David Plowman 2021-05-05 14:53:07 +01:00 committed by Laurent Pinchart
parent 45c6a7e6e8
commit 91122dea97
4 changed files with 71 additions and 1 deletions

View file

@ -68,6 +68,8 @@ public:
const ControlList &properties() const { return properties_; }
int sensorInfo(CameraSensorInfo *info) const;
void updateControlInfo();
protected:
std::string logPrefix() const override;

View file

@ -42,6 +42,8 @@ public:
int setFrameStartEnabled(bool enable);
Signal<uint32_t> frameStart;
void updateControlInfo();
protected:
V4L2Device(const std::string &deviceNode);
~V4L2Device();