[libcamera-devel,RFC,6/7] libcamera: camera_lens: add method to get a list of volatile controls
diff mbox series

Message ID 20230202111252.3366729-7-matthias.fend@emfend.at
State New
Headers show
Series
  • add support for more complex optics
Related show

Commit Message

Matthias Fend Feb. 2, 2023, 11:12 a.m. UTC
This method reads all v4l2 controls marked as volatile from the underlying
v4l2 subdevice.

Signed-off-by: Matthias Fend <matthias.fend@emfend.at>
---
 include/libcamera/internal/camera_lens.h | 1 +
 src/libcamera/camera_lens.cpp            | 9 +++++++++
 2 files changed, 10 insertions(+)

Patch
diff mbox series

diff --git a/include/libcamera/internal/camera_lens.h b/include/libcamera/internal/camera_lens.h
index f5212ea7..9aa0b84a 100644
--- a/include/libcamera/internal/camera_lens.h
+++ b/include/libcamera/internal/camera_lens.h
@@ -34,6 +34,7 @@  public:
 	const ControlInfoMap &controls() const;
 
 	ControlList getControls(const std::vector<uint32_t> &ids);
+	ControlList getVolatileControls();
 protected:
 	std::string logPrefix() const override;
 
diff --git a/src/libcamera/camera_lens.cpp b/src/libcamera/camera_lens.cpp
index ddcda232..5bace1e7 100644
--- a/src/libcamera/camera_lens.cpp
+++ b/src/libcamera/camera_lens.cpp
@@ -165,4 +165,13 @@  ControlList CameraLens::getControls(const std::vector<uint32_t> &ids)
 	return subdev_->getControls(ids);
 }
 
+ControlList CameraLens::getVolatileControls()
+{
+	std::vector<uint32_t> ids;
+
+	ids = subdev_->getVolatileControlIds();
+
+	return subdev_->getControls(ids);
+}
+
 } /* namespace libcamera */