@@ -36,6 +36,7 @@ public:
const ControlInfoMap &controls() const { return controls_; }
+ std::vector<uint32_t> getVolatileControlIds();
ControlList getControls(const std::vector<uint32_t> &ids);
int setControls(ControlList *ctrls);
@@ -147,6 +147,21 @@ void V4L2Device::close()
fd_.reset();
}
+std::vector<uint32_t> V4L2Device::getVolatileControlIds()
+{
+ std::vector<uint32_t> ids;
+
+ for (auto &[controlId, controlInfo] : controls_) {
+ uint32_t id = controlId->id();
+ const struct v4l2_query_ext_ctrl &info = controlInfo_[id];
+
+ if (info.flags & V4L2_CTRL_FLAG_VOLATILE)
+ ids.push_back(id);
+ }
+
+ return ids;
+}
+
/**
* \fn V4L2Device::isOpen()
* \brief Check if the V4L2 device node is open
This method returns all IDs of the v4l2 controls that are marked as volatile. Signed-off-by: Matthias Fend <matthias.fend@emfend.at> --- include/libcamera/internal/v4l2_device.h | 1 + src/libcamera/v4l2_device.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+)