summaryrefslogtreecommitdiff
path: root/src/libcamera/gen-controls.py
AgeCommit message (Collapse)Author
2020-03-20libcamera: controls: Add support for string controlsLaurent Pinchart
String controls are stored internally as an array of char, but the ControlValue constructor, get() and set() functions operate on an std::string for convenience. Array of strings are thus not supported. Unlike for other control types, the ControlInfo range reports the minimum and maximum allowed lengths of the string (the minimum will usually be 0), not the minimum and maximum value of each element. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-03-06libcamera: controls: Add a 'size' yaml propertyJacopo Mondi
Add a 'size' property to the control yaml description, to convey the size constraints of array controls. The semantics of the property contents is currently unspecified, but its presence triggers the generation of an array control (Control<Span<const T>>). Example: - BayerGains: type: float description: Gains to apply to the four Bayer colour components for white balance size: [4] Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-03-06libcamera: gen-controls: Fix documentation issue with <<Jacopo Mondi
Doxygen fails to parse entries with multiple << signs as, in example, \var extern const Control<Span<int32_t>> Remove the type from the control documentation as unique control and property names should not need any additional information specified for Doxygen to correctly identify them. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-02-14libcamera: controls: Parse 'enum' in gen-controls.pyJacopo Mondi
In preparation to add libcamera Camera properties definitions by re-using the control generation framework, augment the gen_controls.py script to support parsing the 'enum' yaml tag and generate documentation and definition of possible values associated with a Control or a Property and defined through an enumeration of supported values. Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-01-14libcamera: gen-controls.py: Don't hardcode path to python interpreterLaurent Pinchart
The gen-controls.py script hardcodes the path to the python interpreter to /usr/bin/python3 in the first line of the script. This hardcodes usage of the host python3, even when building in cross-compilation environments that may ship their own version of python. Fix it by setting the interpreter to '/usr/bin/env python3'. Reported-by: Madhavan Krishnan <madhavan.krishnan@linaro.org> Suggested-by: Nicolas Dufresne <nicolas@ndufresne.ca> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-10-13libcamera: control_ids: Generate map of all supported controlsLaurent Pinchart
In order to deserialise a ControlList, we will need to lookup ControlId instances based on their numerical ID. Generate a global map from the controls definitions to support such a lookup. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-13libcamera: control_ids: Fix documentation for controls namespaceLaurent Pinchart
The controls namespace isn't documenting, making it impossible to reference the variables it contains. Furthermore, within the documentation page for the control_ids.h file, links from overview to detailed variable documentation are broken for the same reason. Both issues can be fixed by documenting the controls namespace. Unfortunately doxygen then fails to parse the initialisers for the controls global variables correctly and considers them as functions. To work around this, modify the control_ids.cpp generation script to hide the variables from doxygen, but still expose their documentation. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-05libcamera: controls: Auto-generate control_ids.h and control_ids.cppLaurent Pinchart
Bring back auto-generation of control ids. In this version, both the header and the source files are generated from a single YAML file that stores all control definitions. This allows centralising controls in a single file, while the previous version required keeping both declarations (in a header) and documentation (in a the source) in sync manually. Using YAML as a format to store control definitions is a trade-off between ease of use (there are many YAML parsers available) and simplicity (XML was considered, but would have lead to more complex processing). A new build time dependency is added on python3-yaml, which should be available as a package in all distributions and build environments. The YAML format is likely to change over time as we improve documentation of controls, the first version simply copies the information currently available. Future improvements should also include a YAML schema to validate the YAML source file. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>