summaryrefslogtreecommitdiff
path: root/src/libcamera/include
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2019-10-12 11:35:51 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-10-15 22:33:27 +0300
commit75e7452fc50b9b45f04500b1e1d2c358b937df9c (patch)
tree3bd31818b0869267dbee64800b19033c876d3a94 /src/libcamera/include
parent35e6319b35729ea1671da8516502dd1ee4212082 (diff)
libcamera: v4l2_controls: Move V4L2ControlId out of V4L2ControlInfo
In order to reconcile the libcamera and V4L2 control info maps, we need to move the V4L2ControlId embedded in V4L2ControlInfo map out of the class. Store the V4L2ControlId instances in the V4L2Device that creates them, and only reference them from V4L2ControlInfo. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/libcamera/include')
-rw-r--r--src/libcamera/include/v4l2_controls.h7
-rw-r--r--src/libcamera/include/v4l2_device.h4
2 files changed, 7 insertions, 4 deletions
diff --git a/src/libcamera/include/v4l2_controls.h b/src/libcamera/include/v4l2_controls.h
index 133f5262..4d7ac1a1 100644
--- a/src/libcamera/include/v4l2_controls.h
+++ b/src/libcamera/include/v4l2_controls.h
@@ -28,13 +28,14 @@ public:
class V4L2ControlInfo
{
public:
- V4L2ControlInfo(const struct v4l2_query_ext_ctrl &ctrl);
+ V4L2ControlInfo(const V4L2ControlId &id,
+ const struct v4l2_query_ext_ctrl &ctrl);
- const ControlId &id() const { return id_; }
+ const ControlId &id() const { return *id_; }
const ControlRange &range() const { return range_; }
private:
- V4L2ControlId id_;
+ const V4L2ControlId *id_;
ControlRange range_;
};
diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h
index daa762d5..5a5b8582 100644
--- a/src/libcamera/include/v4l2_device.h
+++ b/src/libcamera/include/v4l2_device.h
@@ -8,7 +8,8 @@
#define __LIBCAMERA_V4L2_DEVICE_H__
#include <map>
-#include <string>
+#include <memory>
+#include <vector>
#include <linux/videodev2.h>
@@ -48,6 +49,7 @@ private:
const struct v4l2_ext_control *v4l2Ctrls,
unsigned int count);
+ std::vector<std::unique_ptr<V4L2ControlId>> controlIds_;
V4L2ControlInfoMap controls_;
std::string deviceNode_;
int fd_;