summaryrefslogtreecommitdiff
path: root/utils/codegen/ipc/generators/libcamera_templates/serializer.tmpl
diff options
context:
space:
mode:
authorBarnabás Pőcze <barnabas.pocze@ideasonboard.com>2025-05-13 14:11:01 +0200
committerBarnabás Pőcze <barnabas.pocze@ideasonboard.com>2025-05-27 11:10:23 +0200
commitd58ccabab7fd097737bee91b9fcb4f2ee48c2a36 (patch)
tree132d74477a12d1318118600016e9bcb43503682e /utils/codegen/ipc/generators/libcamera_templates/serializer.tmpl
parent0a1539a4f12115837938138aa84895d539e98cec (diff)
utils: codegen: ipc: Add `deserializer()` function
Add `deserializer()` in `serializer.tmpl` to have a single function that generates all the necessary functions into the template specialization like `serializer()`. This also avoids the duplication of some conditional logic. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Diffstat (limited to 'utils/codegen/ipc/generators/libcamera_templates/serializer.tmpl')
-rw-r--r--utils/codegen/ipc/generators/libcamera_templates/serializer.tmpl14
1 files changed, 14 insertions, 0 deletions
diff --git a/utils/codegen/ipc/generators/libcamera_templates/serializer.tmpl b/utils/codegen/ipc/generators/libcamera_templates/serializer.tmpl
index 114e349c..d07836cc 100644
--- a/utils/codegen/ipc/generators/libcamera_templates/serializer.tmpl
+++ b/utils/codegen/ipc/generators/libcamera_templates/serializer.tmpl
@@ -317,3 +317,17 @@
return ret;
}
{%- endmacro %}
+
+{#
+ # \brief Deserialize a struct
+ #
+ # Generate code for IPADataSerializer specialization, for deserializing \a struct.
+ #}
+{%- macro deserializer(struct) %}
+{%- if struct|has_fd %}
+{{deserializer_fd(struct)}}
+{%- else %}
+{{deserializer_no_fd(struct)}}
+{{deserializer_fd_simple(struct)}}
+{%- endif %}
+{%- endmacro %}