[libcamera-devel,v2,0/2] Fix CameraSensor::sensorInfo by updating VBLANK ControlInfo
mbox series

Message ID 20210406104050.23814-1-david.plowman@raspberrypi.com
Headers show
Series
  • Fix CameraSensor::sensorInfo by updating VBLANK ControlInfo
Related show

Message

David Plowman April 6, 2021, 10:40 a.m. UTC
Hi everyone

Here's a second version of the CameraSensor::sensorInfo() fix, taking
account of some of Jacopo's suggestions. The principal differences
are:

1. I renamed the new method to "updateControlInfos". It seems to me a
more accurate description of what the method is doing!
("refreshControls" was rather vague.)

2. CameraSensor::setFormat calls updateControlInfos directly, so it's
only pipeline handlers like the RPi one (which don't use
CameraSensor::setFormat) that must do so for themselves.

3. This (trivial) RPi pipeline handler update is in a separate commit,
to keep it separate from the "core" changes.

4. I didn't go with the "lazy" implementation, which would have a flag
in the CameraSensor that gets set, and checked before the controls are
used. But we could change our minds on that at any point, it's merely
an implementation detail of the CameraSensor class now.

I did try to add a ControlInfo::update (and V4L2ControlInfo::update)
method but, after being hounded by switch statements and casts, I
found it ended up all but identical to the assignment operator - so I
removed it again. But I'm still open to offers there...!

Thanks

David

David Plowman (2):
  libcamera: camera_sensor: Fix frame lengths calculated by sensorInfo()
  libcamera: pipeline: raspberrypi: Update ControlInfos after sensor
    format change

 include/libcamera/internal/camera_sensor.h    |  2 ++
 include/libcamera/internal/v4l2_device.h      |  2 ++
 src/libcamera/camera_sensor.cpp               | 31 ++++++++++++++++++-
 .../pipeline/raspberrypi/raspberrypi.cpp      |  6 ++++
 src/libcamera/v4l2_device.cpp                 | 26 ++++++++++++++++
 5 files changed, 66 insertions(+), 1 deletion(-)