diff options
author | Paul Elder <paul.elder@ideasonboard.com> | 2020-12-05 19:30:44 +0900 |
---|---|---|
committer | Paul Elder <paul.elder@ideasonboard.com> | 2021-02-16 19:21:00 +0900 |
commit | 7832e19a599ec10eb9cf75decbe3b03d6af5364c (patch) | |
tree | e8f4d8641eca68b7ce76441d9e4a0a7edf06163e /utils/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl | |
parent | 892c0f4c19f2d423560a1ab4d7498130816852c3 (diff) |
utils: ipc: add templates for code generation for IPC mechanism
Add templates to mojo to generate code for the IPC mechanism. These
templates generate:
- module header
- module serializer
- IPA proxy cpp, header, and worker
Given an input data definition mojom file for a pipeline.
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'utils/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl')
-rw-r--r-- | utils/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/utils/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl b/utils/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl new file mode 100644 index 00000000..37a784f1 --- /dev/null +++ b/utils/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl @@ -0,0 +1,47 @@ +{#- + # SPDX-License-Identifier: LGPL-2.1-or-later + # Copyright (C) 2020, Google Inc. +-#} +{%- import "serializer.tmpl" as serializer -%} + +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2020, Google Inc. + * + * core_ipa_serializer.h - Data serializer for core libcamera definitions for IPA + * + * This file is auto-generated. Do not edit. + */ + +#ifndef __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_CORE_H__ +#define __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_CORE_H__ + +#include <tuple> +#include <vector> + +#include <libcamera/ipa/core_ipa_interface.h> + +#include "libcamera/internal/control_serializer.h" +#include "libcamera/internal/ipa_data_serializer.h" + +namespace libcamera { + +LOG_DECLARE_CATEGORY(IPADataSerializer) +{% for struct in structs_gen_serializer %} +template<> +class IPADataSerializer<{{struct|name}}> +{ +public: +{{- serializer.serializer(struct, "")}} +{%- if struct|has_fd %} +{{serializer.deserializer_fd(struct, "")}} +{%- else %} +{{serializer.deserializer_no_fd(struct, "")}} +{{serializer.deserializer_fd_simple(struct, "")}} +{%- endif %} +}; +{% endfor %} + +} /* namespace libcamera */ + +#endif /* __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_CORE_H__ */ |