/* SPDX-License-Identifier: LGPL-2.1-or-later */ /* * Copyright (C) 2019, Google Inc. * * v4l2_controls.h - V4L2 Controls Support */ #ifndef __LIBCAMERA_V4L2_CONTROLS_H__ #define __LIBCAMERA_V4L2_CONTROLS_H__ #include #include #include #include #include #include namespace libcamera { class V4L2ControlId : public ControlId { public: V4L2ControlId(const struct v4l2_query_ext_ctrl &ctrl); }; class V4L2ControlInfo { public: V4L2ControlInfo(const struct v4l2_query_ext_ctrl &ctrl); const ControlId &id() const { return id_; } size_t size() const { return size_; } const ControlRange &range() const { return range_; } private: V4L2ControlId id_; size_t size_; ControlRange range_; }; class V4L2ControlInfoMap : private std::map { public: V4L2ControlInfoMap &operator=(std::map &&info); using std::map::begin; using std::map::cbegin; using std::map::end; using std::map::cend; using std::map::at; using std::map::empty; using std::map::size; using std::map::count; using std::map::find; const ControlIdMap &idmap() const { return idmap_; } private: ControlIdMap idmap_; }; class V4L2ControlList : public ControlList { public: V4L2ControlList(const V4L2ControlInfoMap &info) : ControlList(info.idmap()) { } }; } /* namespace libcamera */ #endif /* __LIBCAMERA_V4L2_CONTROLS_H__ */