summaryrefslogtreecommitdiff
path: root/utils/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2021-03-08 16:48:27 +0900
committerPaul Elder <paul.elder@ideasonboard.com>2021-03-09 11:49:13 +0900
commit0612bef6013e31345dd9181869775fd704026f52 (patch)
tree0dc836df2b92c99fcf25bdeefcb9688450bc2b9e /utils/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl
parent51e5d67f8e70a316f08c928bc1000a76c163e06c (diff)
utils: ipc: Make first output parameter direct return if int32
To make it more convenient for synchronous IPA calls to return a status, convert the first output into a direct return if it is an int32. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Naushir Patuck <naush@raspberrypi.com>
Diffstat (limited to 'utils/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl')
-rw-r--r--utils/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl8
1 files changed, 3 insertions, 5 deletions
diff --git a/utils/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl
index ac037fa1..8a57b6cc 100644
--- a/utils/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl
+++ b/utils/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl
@@ -83,15 +83,14 @@ public:
{{param|name}} {{param.mojom_name}};
{% endfor %}
{%- if method|method_return_value != "void" %}
- {{method|method_return_value}} _callRet = ipa_->{{method.mojom_name}}({{method.parameters|params_comma_sep}});
-{%- else %}
+ {{method|method_return_value}} _callRet =
+{%- endif -%}
ipa_->{{method.mojom_name}}({{method.parameters|params_comma_sep}}
{{- ", " if method|method_param_outputs|params_comma_sep -}}
{%- for param in method|method_param_outputs -%}
&{{param.mojom_name}}{{", " if not loop.last}}
{%- endfor -%}
);
-{%- endif %}
{% if not method|is_async %}
IPCMessage::Header header = { _ipcMessage.header().cmd, _ipcMessage.header().cookie };
IPCMessage _response(header);
@@ -100,9 +99,8 @@ public:
std::tie(_callRetBuf, std::ignore) =
IPADataSerializer<{{method|method_return_value}}>::serialize(_callRet);
_response.data().insert(_response.data().end(), _callRetBuf.cbegin(), _callRetBuf.cend());
-{%- else %}
- {{proxy_funcs.serialize_call(method|method_param_outputs, "_response.data()", "_response.fds()")|indent(16, true)}}
{%- endif %}
+ {{proxy_funcs.serialize_call(method|method_param_outputs, "_response.data()", "_response.fds()")|indent(16, true)}}
int _ret = socket_.send(_response.payload());
if (_ret < 0) {
LOG({{proxy_worker_name}}, Error)