diff options
Diffstat (limited to 'src/libcamera/ipa_controls.cpp')
-rw-r--r-- | src/libcamera/ipa_controls.cpp | 55 |
1 files changed, 47 insertions, 8 deletions
diff --git a/src/libcamera/ipa_controls.cpp b/src/libcamera/ipa_controls.cpp index b1d14190..12d92ebe 100644 --- a/src/libcamera/ipa_controls.cpp +++ b/src/libcamera/ipa_controls.cpp @@ -2,10 +2,10 @@ /* * Copyright (C) 2019, Google Inc. * - * ipa_controls.cpp - IPA control handling + * IPA control handling */ -#include <ipa/ipa_controls.h> +#include <libcamera/ipa/ipa_controls.h> /** * \file ipa_controls.h @@ -108,17 +108,19 @@ * +-------------------------+ . * / | ... | | entry[n].offset * | +-------------------------+ <-----ยด - * Data | | minimum value (#n) | \ - * section | +-------------------------+ | Entry #n - * | | maximum value (#n) | / + * | | minimum value (#n) | \ + * Data | +-------------------------+ | + * section | | maximum value (#n) | | Entry #n + * | +-------------------------+ | + * | | default value (#n) | / * | +-------------------------+ * \ | ... | * +-------------------------+ * ~~~~ * - * The minimum and maximum value are stored in the platform's native data - * format. The ipa_control_info_entry::offset field stores the offset from the - * beginning of the data section to the info data. + * The minimum, maximum and default values are stored in the platform's native + * data format. The ipa_control_info_entry::offset field stores the offset from + * the beginning of the data section to the info data. * * Info data in the data section shall be stored in the same order as the * entries array, shall be aligned to a multiple of 8 bytes, and shall be @@ -129,12 +131,41 @@ * shall be ignored when parsing the packet. */ +namespace libcamera { + /** * \def IPA_CONTROLS_FORMAT_VERSION * \brief The current control serialization format version */ /** + * \var ipa_controls_id_map_type + * \brief Enumerates the different control id map types + * + * Each ControlInfoMap and ControlList refers to a control id map that + * associates the ControlId references to a numerical identifier. + * During the serialization procedure the raw pointers to the ControlId + * instances cannot be transported on the wire, hence their numerical id is + * used to identify them in the serialized data buffer. At deserialization time + * it is required to associate back to the numerical id the ControlId instance + * it represents. This enumeration describes which ControlIdMap should be + * used to perform such operation. + * + * \var ipa_controls_id_map_type::IPA_CONTROL_ID_MAP_CONTROLS + * \brief The numerical control identifier are resolved to a ControlId * using + * the global controls::controls id map + * \var ipa_controls_id_map_type::IPA_CONTROL_ID_MAP_PROPERTIES + * \brief The numerical control identifier are resolved to a ControlId * using + * the global properties::properties id map + * \var ipa_controls_id_map_type::IPA_CONTROL_ID_MAP_V4L2 + * \brief ControlId for V4L2 defined controls are created by the video device + * that enumerates them, and are not available across the IPC boundaries. The + * deserializer shall create new ControlId instances for them as well as store + * them in a dedicated ControlIdMap. Only lookup by numerical id can be + * performed on de-serialized ControlInfoMap that represents V4L2 controls. + */ + +/** * \struct ipa_controls_header * \brief Serialized control packet header * \var ipa_controls_header::version @@ -149,6 +180,8 @@ * The total packet size in bytes * \var ipa_controls_header::data_offset * Offset in bytes from the beginning of the packet of the data section start + * \var ipa_controls_header::id_map_type + * The id map type as defined by the ipa_controls_id_map_type enumeration * \var ipa_controls_header::reserved * Reserved for future extensions */ @@ -187,9 +220,15 @@ static_assert(sizeof(ipa_control_value_entry) == 16, * \var ipa_control_info_entry::offset * The offset in bytes from the beginning of the data section to the control * info data (shall be a multiple of 8 bytes) + * \var ipa_control_info_entry::direction + * The directions in which the control is allowed to be sent. This is a flags + * value, where 0x1 signifies input (as controls), and 0x2 signifies output (as + * metadata). \sa ControlId::Direction * \var ipa_control_info_entry::padding * Padding bytes (shall be set to 0) */ static_assert(sizeof(ipa_control_info_entry) == 16, "Invalid ABI size change for struct ipa_control_info_entry"); + +} /* namespace libcamera */ |