summaryrefslogtreecommitdiff
path: root/include/libcamera/controls.h
AgeCommit message (Collapse)Author
2021-08-02controls: Add boolean constructors for ControlInfoPaul Elder
It would be convenient to be able to iterate over available boolean values, for example for controls that designate if some function can be enabled/disabled. The current min/max/def constructor is insufficient, as .values() is empty, so the values cannot be easily iterated over, and creating a Span of booleans does not work for the values constructor. Add new constructors to ControlInfo that takes a set of booleans (if both booleans are valid values) plus a default, and another that takes only one boolean (if only one boolean is a valid value). Update the ControlInfo test accordingly. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2021-06-25libcamera/base: Move span to base libraryKieran Bingham
Move span, and adjust the Doxygen exclusion as well. Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-06-25libcamera/base: Move class helpers to the base libraryKieran Bingham
Move the class support infrastructure to the base library. Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-05-06libcamera: controls: Add a function to merge two control listsLaurent Pinchart
Add a new ControlList::merge() function to merge two control lists by copying in the values in the list passed as parameters. This can be used by pipeline handlers to merge metadata they populate with metadata received from an IPA. Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [reimplement the function by not using std::unordered_map::merge()] Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2021-02-12libcamera: controls: Utilise LIBCAMERA_DISABLE_COPY_AND_MOVEKieran Bingham
The ControlId and Control classes disable the copy constructor and assignment operator, but they should also prevent move construction and assignment. Utilise LIBCAMERA_DISABLE_COPY_AND_MOVE to fully disable these functions. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-01-31Revert "libcamera: Use helper variable template for type traits"Jean-Michel Hautbois
Some applications may not be compliant with C++17 (Chromium, as an example). Keep the C++17 features for libcamera internals, and C++14 compliance for public API. This reverts commit 6cbdc2859963e17bc897a4022f1d68170477d888. Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-01-31Revert "libcamera: span: Provide and use helper variable templates for type ↵Jean-Michel Hautbois
traits" Some applications may not be compliant with C++17 (Chromium, as an example). Keep the C++17 features for libcamera internals, and C++14 compliance for public API. This reverts commit 8e42c2feb7ff7c350ffbbf97dd963dfd54e21faa. Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-28libcamera: span: Provide and use helper variable templates for type traitsLaurent Pinchart
Following the C++17 practice, provide is_array_v<T> and is_span_v<T> helper variable templates as shorter versions of is_array<T>::value and is_span<T>::value, and use them through the code. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-10-28libcamera: Use helper variable template for type traitsLaurent Pinchart
C++17 introduces helper variable templates for type traits, allowing shortening std::is_foo<T>::value to std::is_foo_v<T>. Use them through the code base. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-10-26libcamera: controls: Construct from valid valuesJacopo Mondi
Add a new constructor to the ControlInfo class that allows creating a class instance from the list of the control valid values with an optional default one. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-10-26libcamera: controls: Disable ControlValue<T> construction from unsupported TLaurent Pinchart
The ControlValue<T> constructor for non-array values is a template function that participates in overload resolution for all T types that are not Span or std::string. Other T types that are not supported then result in a compilation error. This causes issues when calling an overloaded function that can accept both a ControlValue and a Span with an std::array<U> parameter. The first overload will be resolved using implicit construction of a ControlValue from the std::array<U>, while the second overload will be resolved using implicit construction of a Span<U> from the std::array<U>. This results in a compilation error due to an ambiguous function call. The first overload is invalid, selecting it would result in a compilation error in the ControlValue constructor, as the ControlValue<T> constructor doesn't support std::array<U> for type T. The compiler can't know about that, as overload resolution happens earlier. To fix it, we can disable the ControlValue<T> constructor for unsupported types T, moving the type check from compilation of the function to overload resolution. The constructor will not participate in overload resolution, and the call won't be ambiguous. The end result is the same for unsupported types, compilation will fail. Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-04-28libcamera: controls: Add rectangle and size control typesLaurent Pinchart
Add two control types to store rectangles and sizes. These will be useful for the properties related to the pixel array. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-03-23libcamera: controls: Add zero-copy set API for ControlValueLaurent Pinchart
Extend the ControlValue class with a reserve() function to set the value without actually copying data, and a non-const data() function that allows writing data directly to the ControlValue storage. This allows allocating memory directly in ControlValue, potentially removing a data copy. Note that this change was implemented before ByteStreamBuffer gained the zero-copy read() variant, and doesn't actually save a copy in the control serializer. It however still simplifies ControlSerializer::loadControlValue(). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-03-20libcamera: controls: Don't over-optimize ControlValue layoutLaurent Pinchart
The ControlValue class size should be minimized to save space, as it can be instantiated in large numbers. The current implementation does so by specifying several members as bitfields, but does so too aggressively, resulting in fields being packed in an inefficient to access way on some platforms. For instance, on 32-bit x86, the numElements_ field is offset by 7 bits in a 32-bit word. This additionally causes a static assert that checks the size of the class to fail. Relax the constraints on the isArray_ and numElements_ fields to avoid inefficient access, and to ensure that the class size is identical across all platforms. This will need to be revisited anyway when stabilizing the ABI, so add a \todo comment as a reminder. Fixes: 1fa4b43402a0 ("libcamera: controls: Support array controls in ControlValue") Reported-by: Jan Engelhardt <jengelh@inai.de> 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>
2020-03-20libcamera: controls: Move ControlValue size check to controls.cppLaurent Pinchart
The size of the ControlValue class is checked by a static_assert() to avoid accidental ABI breakages. There's no need to perform the check every time controls.h is included, move it to controls.cpp. 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>
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-20libcamera: controls: Rename ControlRange to ControlInfoLaurent Pinchart
To prepare for storage of additional information in the ControlRange structure, rename it to ControlInfo. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-03-20libcamera: controls: Name all ControlInfoMap instance variables infoMapLaurent Pinchart
To prepare for the rename of ControlRange to ControlInfo, rename all the ControlInfoMap instance variables currently named info to infoMap. This will help avoiding namespace clashes. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-03-08libcamera: controls: Fix strict aliasing violationLaurent Pinchart
gcc 8.3.0 for ARM complains about strict aliasing violations: ../../src/libcamera/controls.cpp: In member function ‘void libcamera::ControlValue::release()’: ../../src/libcamera/controls.cpp:111:13: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] delete[] *reinterpret_cast<char **>(&storage_); Fix it and simplify the code at the same time. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-03-06libcamera: controls: Add support for byte controlsJacopo Mondi
Add support for byte values to the control framework and to the control serializer. 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: controls: Add support for float controlsJacopo Mondi
Add support for float values in Control<> and ControlValue classes. 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: controls: Allow passing an std::initializer list to set()Laurent Pinchart
For array controls, the ControlList::set() function takes a value as a type convertible to Span<T>. This allows passing an std::array or an std::vector in addition to an explicit Span, but doesn't accept an std::initializer list as Span has no constructor that takes an initializer list. Callers are thus forced to create temporary objects explicitly, which isn't nice. Fix the issue by providing a ControlList::set() function that takes an std::initializer_list, and convert it to a Span internally. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-03-06libcamera: controls: Support array controls in ControlValueJacopo Mondi
Add array controls support to the ControlValue class. The polymorphic class can now store more than a single element and supports access and creation through the use of Span<>. 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: controls: Expose raw data in ControlValueLaurent Pinchart
Add a data() function to the ControlValue class to expose the raw data stored by the class as a Span<const uint8_t>. This will be useful to simplify the serialization of ControlValue instances. The size computation for the raw data is moved from the ControlSerializer, which is updated accordingly to use the data() function in order to access the size. Simplification of the ControlSerializer will happen in a subsequent change. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-03-06libcamera: controls: Move Control constructor to controls.hLaurent Pinchart
To avoid defining all specializations of the Control constructor manually, move the definition of those functions to controls.h and turn them into a single template function. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-03-06libcamera: controls: Move ControlValue constructor to controls.hLaurent Pinchart
To avoid defining all specializations of the ControlValue constructor manually, move the definition of those functions to controls.h and turn them into a single template function. The default constructor is still kept in controls.cpp. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-03-06libcamera: controls: Move ControlValue get() and set() to controls.hLaurent Pinchart
To avoid defining all specializations of ControlValue::get() and ControlValue::set() manually, move the definition of those functions to controls.h and turn them into single template functions. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-03-06libcamera: controls: Add templates to convert a type T to a ControlTypeLaurent Pinchart
These will be used to implement ControlValue::get() and set() as template functions. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-03-06libcamera: controls: Return control by valueLaurent Pinchart
The ControlList::get() and ControlValue::get() methods return the control value by reference. This requires the ControlValue class to store the control value in the same form as the one returned by those functions. For the array controls that are soon to be added, the ControlValue class would need to store a span<> instance in addition to the control value itself, which would increase the required storage space. Prepare for support of array controls by returning from get() by value. As all control values are 8 bytes at most, this doesn't affect efficiency negatively. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-03-06libcamera: controls: Decouple control and value type in ControlList::set()Laurent Pinchart
The ControlList::set() method takes a reference to a Control<T>, and requires the value to be a reference to T. This prevents the set() method from being used with value types that are convertible to T, and in particular with std::array or std::vector value types when the Control type is a Span<> to support array controls. Fix this by decoupling the control type and value type in the template parameters. The compiler will still catch invalid conversions, including cases where the constructor of type T from the value type is explicit. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-03-06libcamera: controls: Reorder ControlValue methodsJacopo Mondi
Reorder functions in ControlValue class to group const methods together. Cosmetic change only. 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: Add default to ControlRangeJacopo Mondi
Augment the the ControlRange class to store the control default value. This is particularly relevant for v4l2 controls used to create Camera properties, which are constructed using immutable video device properties, whose value won't change at runtime. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-11-20libcamera: controls: Store reference to the InfoMapJacopo Mondi
Store a reference to the ControlInfoMap used to create a ControlList and provide an operation to retrieve it. This will be used to implement serialization of ControlList. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-11-20libcamera: controls: Make ControList constructor publicLaurent Pinchart
We need to construct empty ControlList objects to serialization. Make the constructor public. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-11-20libcamera: controls: Make ControlId constructor publicJacopo Mondi
In order to be able to create a ControlId from serialized data, make its constructor public. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-11-20libcamera: controls: Add move constructor to ControlInfoMapLaurent Pinchart
The ControlInfoMap class has a move assignment operator from a plain map, but no corresponding move constructor. Add one. 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> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-11-20libcamera: controls: Index ControlList by unsigned intLaurent Pinchart
In preparation for serialization, index the ControlList by unsigned int. This will allow deserializing a ControlList without requiring external information. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-11-20libcamera: controls: Add operator== and operator!= to ControlRangeLaurent Pinchart
Allow comparision of control ranges by adding the required operators. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-10-23libcamera: controls: Remove rogue ';'Jacopo Mondi
The ';' at the end of an inline method declaration is not required. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-10-15libcamera: v4l2_controls: Remove V4L2ControlList classLaurent Pinchart
The V4L2ControlList class only provides a convenience constructor for the ControlList, which can easily be moved to the ControlList class and may benefit it later (to construct a ControlList from controls supported by a camera). Move the constructor and remove V4L2ControlList. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-10-15libcamera: controls: Merge ControlInfoMap and V4L2ControlInfoMapLaurent Pinchart
The ControlInfoMap and V4L2ControlInfoMap classes are very similar, with the latter adding convenience accessors based on numerical IDs for the former, as well as a cached idmap. Both features can be useful for ControlInfoMap in the context of serialisation, and merging the two classes will further simplify the IPA API. Import all the features of V4L2ControlInfoMap into ControlInfoMap, turning the latter into a real class. A few new constructors and assignment operators are added for completeness. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-10-15libcamera: controls: Prevent copies of ControlId classLaurent Pinchart
Now that the V4L2ControlId embedded in V4L2ControlInfo has been moved out and doesn't require to be copied anymore, the base ControlId class doesn't need to be copyable either. Delete the ControlId copy constructor and copy assignment operator. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-10-13libcamera: v4l2_controls: Add V4L2ControlIdLaurent Pinchart
Add a V4L2 specialisation of the ControlId class, in order to construct a ControlId from a v4l2_query_ext_ctrl. The V4L2ControlId is embedded in V4L2ControlInfo, and thus needs to be copyable to allow for V4L2ControlInfo to be passed to IPAs. The ControlId copy constructor and assignment operators are thus restored, but made protected to avoid the Control class being copyable. This is needed in order to use ControlList for V4L2 controls, as ControlList requires ControlId instances for all controls. 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: controls: Support accessing controls by numerical IDLaurent Pinchart
The ControlList class has template get() and set() methods to get and set control values. The methods require a reference to a Control instance, which is only available when calling them with a hardcoded control. In order to support usage of ControlList for V4L2 controls, as well as serialisation and deserialisation of ControlList, we need a way to get and set control values based on a control numerical ID. Add new contains(), get() and set() overload methods to do so. As this change prepares the ControlList to be used for other objects than camera, update its documentation accordingly. 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: controls: Store control name in ControlIdLaurent Pinchart
The ControlId class stores a pointer to the control name. This works fine for statically-defined controls, but requires code that allocates controls dynamically (for instance based on control discovery on a V4L2 device) to keep a list of control names in separate storage. To ease usage of dynamically allocated controls, store a copy of the control name string in the ControlId class. 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: controls: Default ControlList validator argument to nullptrLaurent Pinchart
The ControlList constructor takes a validator pointer that can be null. Set its default value to nullptr to simplify code in users of ControlList. 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: controls: Add comparison operators for ControlValueLaurent Pinchart
Add equality and non equality comparison operators for the ControlValue class. This simplifies code that deals with control values. 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: 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-05libcamera: controls: Use ControlValidator to validate ControlListLaurent Pinchart
Replace the manual validation of controls against a Camera with usage of the new ControlValidator interface. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-05libcamera: controls: Rename ControlInfo to ControlRangeLaurent Pinchart
The ControlInfo class stores a range of valid values for a control. Its name is vague, as "info" has multiple meanings. Rename it to ControlRange. 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>