libcamera: v4l2_device: Add method to retrieve all supported controls
Add a new controls() method to the V4L2Device class to retrieve the map of all supported controls. This is needed in order to dynamically query the supported controls, for instance for drivers that support different sets of controls depending on the device model. To make the API easier to use, create a type alias for the control ID to ControlInfo and use it. Remove the getControlInfo() method that is not used externally, as it can now be replaced by accessing the full list of controls. Update the CameraSensor API accordingly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
@@ -8,11 +8,11 @@
|
||||
#ifndef __LIBCAMERA_V4L2_CONTROLS_H__
|
||||
#define __LIBCAMERA_V4L2_CONTROLS_H__
|
||||
|
||||
#include <map>
|
||||
#include <stdint.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <linux/v4l2-controls.h>
|
||||
#include <linux/videodev2.h>
|
||||
|
||||
@@ -41,6 +41,8 @@ private:
|
||||
int64_t max_;
|
||||
};
|
||||
|
||||
using V4L2ControlInfoMap = std::map<unsigned int, V4L2ControlInfo>;
|
||||
|
||||
class V4L2Control
|
||||
{
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user