From 4e9ed14311c0b17cb77854bfd4a0288e790725e7 Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Fri, 26 Aug 2022 11:50:55 -0500 Subject: utils: ipc: Allow the skipHeader attribute on enums Currently, enums that are passed between pipeline handlers and their IPA must be defined in a mojom file. However, there is a use case for enum/flags to be defined in a C++ header, such that the enum can be used in a component other than the pipeline handler and its IPA. To support this, add support for the skipHeader attribute for enums. Like structs, it is only allowed in core.mojom. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- include/libcamera/ipa/core.mojom | 6 ++++-- include/libcamera/ipa/ipa_interface.h | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'include/libcamera/ipa') diff --git a/include/libcamera/ipa/core.mojom b/include/libcamera/ipa/core.mojom index 33b8abed..5cef340d 100644 --- a/include/libcamera/ipa/core.mojom +++ b/include/libcamera/ipa/core.mojom @@ -14,8 +14,8 @@ module libcamera; * - structs * * Attributes: - * - skipHeader - structs only, and only in core.mojom - * - Do not generate a C++ definition for the structure + * - skipHeader - allowed only for structs and enums in core.mojom + * - Do not generate a C++ definition for the structure or enum * - Any type used in a mojom interface definition must have a corresponding * definition in a mojom file for the code generator to accept it, except * for types solely used as map/array members for which a definition is not @@ -52,6 +52,8 @@ module libcamera; * then the type definition in the core.mojom file should have the * [skipHeader] attribute only * - A (de)serializer will be generated for the type + * - enums that are defined in a libcamera C++ header also fall in this + * category * - If a type definition has [skipHeader], then the header where the type is * defined must be included in ipa_interface.h * - Types that are solely used as array/map members do not require a mojom diff --git a/include/libcamera/ipa/ipa_interface.h b/include/libcamera/ipa/ipa_interface.h index 8afcfe21..8884f0ed 100644 --- a/include/libcamera/ipa/ipa_interface.h +++ b/include/libcamera/ipa/ipa_interface.h @@ -23,8 +23,8 @@ namespace libcamera { /* - * Structs that are defined in core.mojom and have the skipHeader tag must be - * #included here. + * Structs and enums that are defined in core.mojom that have the skipHeader + * tag must be #included here. */ class IPAInterface -- cgit v1.2.1