[RFC 3/9] libcamera: converter: Allow registering with feature
Jacopo Mondi
jacopo.mondi at ideasonboard.com
Wed Jul 17 12:09:06 CEST 2024
Provide a way to overload the REGISTER_CONVERTER() macro to allow
it to be called with or without an optional set of features.
Signed-off-by: Jacopo Mondi <jacopo.mondi at ideasonboard.com>
---
include/libcamera/internal/converter.h | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/include/libcamera/internal/converter.h b/include/libcamera/internal/converter.h
index ead465170d01..035e6ffff135 100644
--- a/include/libcamera/internal/converter.h
+++ b/include/libcamera/internal/converter.h
@@ -116,8 +116,17 @@ public:
}
};
-#define REGISTER_CONVERTER(name, converter, compatibles) \
+#define __REGISTER_CONVERTER(name, converter, compatibles, features) \
static ConverterFactory<converter> global_##converter##Factory(name, compatibles, \
- Converter::Feature::None);
+ features);
+#define __REGISTER_CONVERTER_NO_FEAT(name, converter, compatibles) \
+ __REGISTER_CONVERTER(name, converter, compatibles, Converter::Feature::None);
+
+#define __register_converter_expand(_1, _2, _3, _4, EXT, ...) \
+ __REGISTER_CONVERTER ## EXT
+
+#define REGISTER_CONVERTER(name, converter, compatibles, ...) \
+ __register_converter_expand(name, converter, compatibles, ##__VA_ARGS__, , _NO_FEAT) \
+ (name, converter, compatibles, ##__VA_ARGS__)
} /* namespace libcamera */
--
2.45.2
More information about the libcamera-devel
mailing list