Files
external_libcamera/src/libcamera/control_ids.cpp.in
Naushir Patuck bd6658943a controls: Add vendor control/property support to generation scripts
Add support for vendor-specific controls and properties to libcamera.
The controls/properties are defined by a "vendor" tag in the YAML
control description file, for example:

vendor: rpi
controls:
  - MyExampleControl:
      type: string
      description: |
        Test for libcamera vendor-specific controls.

This will now generate a control id in the libcamera::controls::rpi
namespace, ensuring no id conflict between different vendors, core or
draft libcamera controls. Similarly, a ControlIdMap control is generated
in the libcamera::controls::rpi namespace.

A #define LIBCAMERA_HAS_RPI_VENDOR_CONTROLS is also generated to allow
applications to conditionally compile code if the specific vendor
controls are present. For the python bindings, the control is available
with libcamera.controls.rpi.MyExampleControl. The above controls
example applies similarly to properties.

Existing libcamera controls defined in control_ids.yaml are given the
"libcamera" vendor tag.

A new --mode flag is added to gen-controls.py to specify the mode of
operation, either 'controls' or 'properties' to allow the code generator
to correctly set the #define string.

As a drive-by, sort and redefine the output command line argument in
gen-controls.py and gen-py-controls.py to ('--output', '-o') for
consistency.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-11-29 09:05:37 +00:00

68 lines
1.1 KiB
C++

/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2019, Google Inc.
*
* control_ids.cpp : Control ID list
*
* This file is auto-generated. Do not edit.
*/
#include <libcamera/control_ids.h>
#include <libcamera/controls.h>
/**
* \file control_ids.h
* \brief Camera control identifiers
*/
namespace libcamera {
/**
* \brief Namespace for libcamera controls
*/
namespace controls {
${controls_doc}
/**
* \brief Namespace for libcamera draft controls
*/
namespace draft {
${draft_controls_doc}
} /* namespace draft */
${vendor_controls_doc}
#ifndef __DOXYGEN__
/*
* Keep the controls definitions hidden from doxygen as it incorrectly parses
* them as functions.
*/
${controls_def}
namespace draft {
${draft_controls_def}
} /* namespace draft */
${vendor_controls_def}
#endif
/**
* \brief List of all supported libcamera controls
*
* Unless otherwise stated, all controls are bi-directional, i.e. they can be
* set through Request::controls() and returned out through Request::metadata().
*/
extern const ControlIdMap controls {
${controls_map}
};
} /* namespace controls */
} /* namespace libcamera */