libcamera: Pass CameraManager around instead of GlobalConfiguration

The GlobalConfiguration is explicitly passed around through constructors
of various objects that need access to the configuration. This ad-hoc
solution works for the specific use cases it was meant to support, but
isn't very generic. We have a top-level object in libcamera, the
CameraManager, that also needs to be accessed from various locations and
is passed to object constructors. Standardize on passing the
CameraManager everywhere, and access the global configuration through
it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
This commit is contained in:
Laurent Pinchart
2025-10-13 23:51:09 +03:00
parent 9cff4b757a
commit 1c3e1baa6e
19 changed files with 73 additions and 60 deletions

View File

@@ -45,8 +45,8 @@ namespace {{ns}} {
{% endfor %}
{%- endif %}
{{proxy_name}}Threaded::{{proxy_name}}Threaded(IPAModule *ipam, const GlobalConfiguration &configuration)
: {{proxy_name}}(ipam, configuration), thread_("{{proxy_name}}")
{{proxy_name}}Threaded::{{proxy_name}}Threaded(IPAModule *ipam, const CameraManager &cm)
: {{proxy_name}}(ipam, cm), thread_("{{proxy_name}}")
{
LOG(IPAProxy, Debug)
<< "initializing {{module_name}} proxy in thread: loading IPA from "
@@ -127,8 +127,8 @@ namespace {{ns}} {
/* ========================================================================== */
{{proxy_name}}Isolated::{{proxy_name}}Isolated(IPAModule *ipam, const GlobalConfiguration &configuration)
: {{proxy_name}}(ipam, configuration),
{{proxy_name}}Isolated::{{proxy_name}}Isolated(IPAModule *ipam, const CameraManager &cm)
: {{proxy_name}}(ipam, cm),
controlSerializer_(ControlSerializer::Role::Proxy), seq_(0)
{
LOG(IPAProxy, Debug)

View File

@@ -50,7 +50,7 @@ protected:
class {{proxy_name}}Threaded : public {{proxy_name}}
{
public:
{{proxy_name}}Threaded(IPAModule *ipam, const GlobalConfiguration &configuration);
{{proxy_name}}Threaded(IPAModule *ipam, const CameraManager &cm);
~{{proxy_name}}Threaded();
{% for method in interface_main.methods %}
@@ -112,7 +112,7 @@ private:
class {{proxy_name}}Isolated : public {{proxy_name}}
{
public:
{{proxy_name}}Isolated(IPAModule *ipam, const GlobalConfiguration &configuration);
{{proxy_name}}Isolated(IPAModule *ipam, const CameraManager &cm);
~{{proxy_name}}Isolated();
{% for method in interface_main.methods %}