libcamera: v4l2_controls: Cache query control information
Cache the V4L2 control info retrieved with VIDIOC_QUERY_EXT_CTRL at control listing time for later use. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
parent
8daf20485b
commit
2c6e6fbc96
2 changed files with 3 additions and 0 deletions
|
@ -48,6 +48,7 @@ private:
|
|||
const struct v4l2_ext_control *v4l2Ctrls,
|
||||
unsigned int count);
|
||||
|
||||
std::map<unsigned int, struct v4l2_query_ext_ctrl> controlInfo_;
|
||||
std::vector<std::unique_ptr<V4L2ControlId>> controlIds_;
|
||||
ControlInfoMap controls_;
|
||||
std::string deviceNode_;
|
||||
|
|
|
@ -381,6 +381,8 @@ void V4L2Device::listControls()
|
|||
}
|
||||
|
||||
controlIds_.emplace_back(std::make_unique<V4L2ControlId>(ctrl));
|
||||
controlInfo_.emplace(ctrl.id, ctrl);
|
||||
|
||||
ctrls.emplace(controlIds_.back().get(), V4L2ControlInfo(ctrl));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue