[libcamera-devel,v2,0/2] Add read-only flag to ControlInfo
mbox series

Message ID 20221202124005.3643-1-naush@raspberrypi.com
Headers show
  • Add read-only flag to ControlInfo
Related show


Naushir Patuck Dec. 2, 2022, 12:40 p.m. UTC

This small patch series adds a read-only flag to ControlInfo.  This is used
to test if a control, in particular V4L2_CID_HBLANK, can be written to by
userland.  It replaces the slightly fragile workaround we have right now where
we test if the min and max values of a control are the same to determine if
a control is read-only.

I've only modified the one ControlInfo constructor signature used by the
V4L2Device class to allow this flag to be set, as setting it for a non-v4l2
control probably does not make sense at this point.  If folks think this is
incorrect, please let me know.


Naushir Patuck (2):
  libcamera: controls: Add read-only flag to ControlInfo
  libcamera:camera_sensor, ipa: raspberrypi: Test readOnly() for HBLANK

 include/libcamera/controls.h        |  5 ++++-
 src/ipa/raspberrypi/raspberrypi.cpp | 12 +-----------
 src/libcamera/camera_sensor.cpp     | 14 ++------------
 src/libcamera/controls.cpp          | 17 +++++++++++++----
 src/libcamera/v4l2_device.cpp       | 12 ++++++++----
 5 files changed, 28 insertions(+), 32 deletions(-)