[libcamera-devel] [PATCH 1/2] properties: Support draft controls and properties
Jacopo Mondi
jacopo at jmondi.org
Thu Oct 8 14:32:04 CEST 2020
Hi Kieran,
On Wed, Oct 07, 2020 at 07:57:18PM +0100, Kieran Bingham wrote:
> Extend the control and property framework to support exposing draft
> controls and properties in a scoped namespace.
>
> The controls/properties themselves will retain the same ordering in the
> relevant enum/id maps - but the access to any draft control will require
> explicitly referencing through its' draft:: namespace prefix.
>
> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> ---
> include/libcamera/control_ids.h.in | 6 +++++
> include/libcamera/property_ids.h.in | 6 +++++
> src/libcamera/property_ids.cpp.in | 13 +++++++++++
> utils/gen-controls.py | 36 ++++++++++++++++++++++-------
> 4 files changed, 53 insertions(+), 8 deletions(-)
>
> diff --git a/include/libcamera/control_ids.h.in b/include/libcamera/control_ids.h.in
> index 95a7a7f1e260..baadca83b103 100644
> --- a/include/libcamera/control_ids.h.in
> +++ b/include/libcamera/control_ids.h.in
> @@ -26,6 +26,12 @@ ${controls}
>
> extern const ControlIdMap controls;
>
> +namespace draft {
> +
> +${draft_controls}
> +
> +} /* namespace draft */
> +
> } /* namespace controls */
>
> } /* namespace libcamera */
> diff --git a/include/libcamera/property_ids.h.in b/include/libcamera/property_ids.h.in
> index e4dea335cd3b..52646c1f78ae 100644
> --- a/include/libcamera/property_ids.h.in
> +++ b/include/libcamera/property_ids.h.in
> @@ -24,6 +24,12 @@ ${ids}
>
> ${controls}
>
> +namespace draft {
> +
> +${draft_controls}
> +
> +} /* namespace draft */
> +
> extern const ControlIdMap properties;
>
> } /* namespace properties */
> diff --git a/src/libcamera/property_ids.cpp.in b/src/libcamera/property_ids.cpp.in
> index bfdd823f63b0..275c1caff3ec 100644
> --- a/src/libcamera/property_ids.cpp.in
> +++ b/src/libcamera/property_ids.cpp.in
> @@ -23,12 +23,25 @@ namespace properties {
>
> ${controls_doc}
>
> +namespace draft {
> +
> +${draft_controls_doc}
> +
> +} /* namespace draft */
> +
> #ifndef __DOXYGEN__
> /*
> * Keep the properties definitions hidden from doxygen as it incorrectly parses
> * them as functions.
> */
> ${controls_def}
> +
> +namespace draft {
> +
> +${draft_controls_def}
> +
> +} /* namespace draft */
> +
> #endif
>
> /**
This same hunk shall be applied to control_ids.cpp.in
More information about the libcamera-devel
mailing list