summaryrefslogtreecommitdiff
path: root/src/libcamera/controls.cpp
AgeCommit message (Collapse)Author
2019-10-04libcamera: controls: Make ControlValue get/set accessors template methodsLaurent Pinchart
The ControlValue get accessors are implemented with functions of different names, whlie the set accessors use polymorphism to support different control types. This isn't very consistent and intuitive. Make the API clearer by using template methods. This will also have the added advantage that support for the new types will only require adding template specialisations, without adding new methods. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-04libcamera: controls: Rename ControlValueType to ControlTypeLaurent Pinchart
The type of a control value is also the type of the control. Shorten the ControlValueType enumeration to ControlType, and rename ControlValue* to ControlType* for better clarity. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-07-15libcamera: Fix spellings and grammarKieran Bingham
Fix a number of spelling errors and word duplications throughout the comments within libcamera. These were picked up with spellintian. Also one capitalisation of the first word of a \return statement picked up by checkstyle.py while creating this patch. Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-07-02libcamera: controls: Add a set of initial controlsLaurent Pinchart
Add an initial set of controls to demonstrate how controls are defined. Proper documentation for each control is missing. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-07-02libcamera: controls: Extend ControlList to access controls by IDLaurent Pinchart
The ControlList class implements a map from control specifier to control ID. To avoid constant lookups of ControlInfo when using the class in the libcamera core or in pipeline handlers, the map uses ControlInfo pointers instead of ControlId values. This is however not very convenient for applications or pipeline handlers, as they would be forced to first look up the ControlInfo pointers for the controls they want to access. Facilitate ease of use of ControlLists by implementing an internal lookup of the ControlInfo from the controls provided by the Camera. 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>
2019-07-02libcamera: camera: Provide a list of ControlInfoKieran Bingham
Extend the Camera class to expose the controls it supports. Each pipeline should generate a list of controls supported by each camera it creates. These are represented by a ControlInfoMap, and an associated ControlList of default values. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> 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>
2019-07-02libcamera: controls: Introduce control-related data typesKieran Bingham
Add a set of data types to support controls: - ControlValue stores a control type and value in a generic way - ControlId enumerates all the control identifiers - ControlIdentifier declares the types of a control and map their names - ControlInfo stores runtime information for controls - ControlList contains a set of control info and value pairs The control definitions map is generated from the controls documentation to ensure that the two will always be synchronised. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>