libcamera/test/controls
Laurent Pinchart a8c40942b9 libcamera: controls: Improve the API towards applications
Rework the control-related classes to improve the API towards
applications. The goal is to enable writing code similar to

	Request *req = ...;
	ControlList &controls = req->controls();
	controls->set(controls::AwbEnable, false);
	controls->set(controls::ManualExposure, 1000);

	...

	int32_t exposure = controls->get(controls::ManualExposure);

with the get and set operations ensuring type safety for the control
values. This is achieved by creating the following classes:

- Control defines controls and is the main way to reference a control.
  It is a template class to allow methods using it to refer to the
  control type.

- ControlId is the base class of Control. It stores the control ID, name
  and type, and can be used in contexts where a control needs to be
  referenced regardless of its type (for instance in lists of controls).
  This class replaces ControlIdentifier.

- ControlValue is kept as-is.

The ControlList class now exposes two template get() and set() methods
that replace the operator[]. They ensure type safety by infering the
value type from the Control reference that they receive.

The main way to refer to a control is now through the Control class, and
optionally through its base ControlId class. The ControlId enumeration
is removed, replaced by a list of global Control instances. Numerical
control IDs are turned into macros, and are still exposed as they are
required to communicate with IPAs (especially to deserialise control
lists). They should however not be used by applications.

Auto-generation of header and source files is removed for now to keep
the change simple. It will be added back in the future in a more
elaborate form.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-04 19:33:08 +03:00
..
control_info.cpp libcamera: controls: Improve the API towards applications 2019-10-04 19:33:08 +03:00
control_list.cpp libcamera: controls: Improve the API towards applications 2019-10-04 19:33:08 +03:00
control_value.cpp libcamera: controls: Use explicit 32-bit integer types 2019-10-04 19:33:08 +03:00
meson.build libcamera: test: Add ControlList tests 2019-07-02 16:59:53 +03:00