summaryrefslogtreecommitdiff
path: root/utils/ipc/generators/libcamera_templates/serializer.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'utils/ipc/generators/libcamera_templates/serializer.tmpl')
-rw-r--r--utils/ipc/generators/libcamera_templates/serializer.tmpl22
1 files changed, 11 insertions, 11 deletions
diff --git a/utils/ipc/generators/libcamera_templates/serializer.tmpl b/utils/ipc/generators/libcamera_templates/serializer.tmpl
index b8ef8e7b..77bae36f 100644
--- a/utils/ipc/generators/libcamera_templates/serializer.tmpl
+++ b/utils/ipc/generators/libcamera_templates/serializer.tmpl
@@ -40,7 +40,7 @@
retData.insert(retData.end(), {{field.mojom_name}}.begin(), {{field.mojom_name}}.end());
{%- elif field|is_fd %}
std::vector<uint8_t> {{field.mojom_name}};
- std::vector<FileDescriptor> {{field.mojom_name}}Fds;
+ std::vector<SharedFD> {{field.mojom_name}}Fds;
std::tie({{field.mojom_name}}, {{field.mojom_name}}Fds) =
IPADataSerializer<{{field|name}}>::serialize(data.{{field.mojom_name}});
retData.insert(retData.end(), {{field.mojom_name}}.begin(), {{field.mojom_name}}.end());
@@ -58,7 +58,7 @@
{%- elif field|is_plain_struct or field|is_array or field|is_map or field|is_str %}
std::vector<uint8_t> {{field.mojom_name}};
{%- if field|has_fd %}
- std::vector<FileDescriptor> {{field.mojom_name}}Fds;
+ std::vector<SharedFD> {{field.mojom_name}}Fds;
std::tie({{field.mojom_name}}, {{field.mojom_name}}Fds) =
{%- else %}
std::tie({{field.mojom_name}}, std::ignore) =
@@ -177,7 +177,7 @@
# \a struct.
#}
{%- macro serializer(struct, namespace) %}
- static std::tuple<std::vector<uint8_t>, std::vector<FileDescriptor>>
+ static std::tuple<std::vector<uint8_t>, std::vector<SharedFD>>
serialize(const {{struct|name_full}} &data,
{%- if struct|needs_control_serializer %}
ControlSerializer *cs)
@@ -187,7 +187,7 @@
{
std::vector<uint8_t> retData;
{%- if struct|has_fd %}
- std::vector<FileDescriptor> retFds;
+ std::vector<SharedFD> retFds;
{%- endif %}
{%- for field in struct.fields %}
{{serializer_field(field, namespace, loop)}}
@@ -210,7 +210,7 @@
{%- macro deserializer_fd(struct, namespace) %}
static {{struct|name_full}}
deserialize(std::vector<uint8_t> &data,
- std::vector<FileDescriptor> &fds,
+ std::vector<SharedFD> &fds,
{%- if struct|needs_control_serializer %}
ControlSerializer *cs)
{%- else %}
@@ -224,8 +224,8 @@
static {{struct|name_full}}
deserialize(std::vector<uint8_t>::const_iterator dataBegin,
std::vector<uint8_t>::const_iterator dataEnd,
- std::vector<FileDescriptor>::const_iterator fdsBegin,
- std::vector<FileDescriptor>::const_iterator fdsEnd,
+ std::vector<SharedFD>::const_iterator fdsBegin,
+ std::vector<SharedFD>::const_iterator fdsEnd,
{%- if struct|needs_control_serializer %}
ControlSerializer *cs)
{%- else %}
@@ -234,7 +234,7 @@
{
{{struct|name_full}} ret;
std::vector<uint8_t>::const_iterator m = dataBegin;
- std::vector<FileDescriptor>::const_iterator n = fdsBegin;
+ std::vector<SharedFD>::const_iterator n = fdsBegin;
size_t dataSize = std::distance(dataBegin, dataEnd);
[[maybe_unused]] size_t fdsSize = std::distance(fdsBegin, fdsEnd);
@@ -255,7 +255,7 @@
{%- macro deserializer_fd_simple(struct, namespace) %}
static {{struct|name_full}}
deserialize(std::vector<uint8_t> &data,
- [[maybe_unused]] std::vector<FileDescriptor> &fds,
+ [[maybe_unused]] std::vector<SharedFD> &fds,
ControlSerializer *cs = nullptr)
{
return IPADataSerializer<{{struct|name_full}}>::deserialize(data.cbegin(), data.cend(), cs);
@@ -264,8 +264,8 @@
static {{struct|name_full}}
deserialize(std::vector<uint8_t>::const_iterator dataBegin,
std::vector<uint8_t>::const_iterator dataEnd,
- [[maybe_unused]] std::vector<FileDescriptor>::const_iterator fdsBegin,
- [[maybe_unused]] std::vector<FileDescriptor>::const_iterator fdsEnd,
+ [[maybe_unused]] std::vector<SharedFD>::const_iterator fdsBegin,
+ [[maybe_unused]] std::vector<SharedFD>::const_iterator fdsEnd,
ControlSerializer *cs = nullptr)
{
return IPADataSerializer<{{struct|name_full}}>::deserialize(dataBegin, dataEnd, cs);