From 51e5d67f8e70a316f08c928bc1000a76c163e06c Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Mon, 8 Mar 2021 16:48:26 +0900 Subject: utils: ipc: Support custom parameters to init() Add support to the mojom-based code generator for custom parameters to init(). Remove the parameter type and count validation as well. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- .../libcamera_templates/module_ipa_proxy.cpp.tmpl | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl') diff --git a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl index d451fab3..3eb3dced 100644 --- a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl +++ b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl @@ -141,10 +141,19 @@ void {{proxy_name}}::recvMessage(const IPCMessage &data) {{proxy_funcs.func_sig(proxy_name, method, "Thread")}} { -{%- if method.mojom_name == "init" %} - {{proxy_funcs.init_thread_body()}} -{%- elif method.mojom_name == "stop" %} +{%- if method.mojom_name == "stop" %} {{proxy_funcs.stop_thread_body()}} +{%- elif method.mojom_name == "init" %} + {{ method|method_return_value + " _ret = " if method|method_return_value != "void" -}} + ipa_->{{method.mojom_name}}( + {%- for param in method|method_param_names -%} + {{param}}{{- ", " if not loop.last}} + {%- endfor -%} +); + + proxy_.moveToThread(&thread_); + + return {{ "_ret" if method|method_return_value != "void" }}; {%- elif method.mojom_name == "start" %} running_ = true; thread_.start(); -- cgit v1.2.1