summaryrefslogtreecommitdiff
path: root/utils/ipc/generators/libcamera_templates
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2021-03-08 16:48:26 +0900
committerPaul Elder <paul.elder@ideasonboard.com>2021-03-09 11:49:02 +0900
commit51e5d67f8e70a316f08c928bc1000a76c163e06c (patch)
tree7bd72ab73aea975e8aa776b4fa21c58f024eff75 /utils/ipc/generators/libcamera_templates
parent3a59555414da0f1c8a24bdede1ae279154a2f058 (diff)
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 <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'utils/ipc/generators/libcamera_templates')
-rw-r--r--utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl15
-rw-r--r--utils/ipc/generators/libcamera_templates/proxy_functions.tmpl13
2 files changed, 12 insertions, 16 deletions
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();
diff --git a/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl b/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl
index 40611feb..f2d86b67 100644
--- a/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl
+++ b/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl
@@ -20,19 +20,6 @@
{%- endmacro -%}
{#
- # \brief Generate function body for IPA init() function for thread
- #}
-{%- macro init_thread_body() -%}
- int ret = ipa_->init(settings);
- if (ret)
- return ret;
-
- proxy_.moveToThread(&thread_);
-
- return 0;
-{%- endmacro -%}
-
-{#
# \brief Generate function body for IPA stop() function for thread
#}
{%- macro stop_thread_body() -%}