libcamera: libcamera::IPAProxy Class Reference

libcamera v0.4.0 Supporting cameras in Linux since 2019 |

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
libcamera::IPAProxy Class Reference

IPA Proxy. More...

Inheritance diagram for libcamera::IPAProxy:
[legend]
Collaboration diagram for libcamera::IPAProxy:
[legend]

## Public Types
enum | ProxyState { ProxyStopped , ProxyStopping , ProxyRunning }
| Identifies the available operational states of the proxy. More...

## Public Member Functions
| IPAProxy (IPAModule *ipam)
| Construct an IPAProxy instance.
bool | isValid () const
| Check if the IPAProxy instance is valid.
std::string | configurationFile (const std::string &name, const std::string &fallbackName=std::string()) const
| Retrieve the absolute path to an IPA configuration file.

## Protected Member Functions
std::string | resolvePath (const std::string &file) const
| Find a valid full path for a proxy worker for a given executable name.

## Protected Attributes
bool | valid_
| Flag to indicate if the IPAProxy instance is valid.
ProxyState | state_
| Current state of the IPAProxy.

## Detailed Description

IPA Proxy.

Isolate IPA into separate process.

## Member Enumeration Documentation

## ◆ ProxyState

enum libcamera::IPAProxy::ProxyState

Identifies the available operational states of the proxy.

Enumerator
ProxyStopped | The proxy is not active and only synchronous operations are permitted.
ProxyStopping | No new tasks can be submitted to the proxy, however existing events can be completed.
ProxyRunning | The Proxy is active and asynchronous tasks may be queued.

## Constructor & Destructor Documentation

## ◆ IPAProxy()

libcamera::IPAProxy::IPAProxy | ( | IPAModule * | ipam | ) |

Construct an IPAProxy instance.

Parameters

  [in] | ipam | The IPA module

## Member Function Documentation

## ◆ configurationFile()

std::string libcamera::IPAProxy::configurationFile | ( | const std::string & | name,
|  | const std::string & | fallbackName = std::string() ) const

Retrieve the absolute path to an IPA configuration file.

Parameters

  [in] | name | The configuration file name
  [in] | fallbackName | The name of a fallback configuration file

This function locates the configuration file for an IPA and returns its absolute path. It searches the following directories, in order:

- All directories specified in the colon-separated LIBCAMERA_IPA_CONFIG_PATH environment variable ; or
- If libcamera is not installed, the src/ipa/ directory within the source tree ; otherwise
- The system sysconf (etc/libcamera/ipa) and the data (share/libcamera/ipa/) directories.

The system directories are not searched if libcamera is not installed.

Within each of those directories, the function looks for a subdirectory named after the IPA module name, as reported in IPAModuleInfo::name, and for a file named name within that directory. The name is IPA-specific.

If the file named name is not found and fallbackName is non-empty then the whole search is repeated for fallbackName.

Returns
  The full path to the IPA configuration file, or an empty string if no configuration file can be found

## ◆ isValid()

bool libcamera::IPAProxy::isValid | ( |  | ) | const
| inline

Check if the IPAProxy instance is valid.

An IPAProxy instance is valid if the IPA interface is successfully created in isolation, and IPC is successfully set up.

Returns
  True if the IPAProxy is valid, false otherwise

## ◆ resolvePath()

std::string libcamera::IPAProxy::resolvePath | ( | const std::string & | file | ) | const
| protected

Find a valid full path for a proxy worker for a given executable name.

Parameters

  [in] | file | File name of proxy worker executable

A proxy worker's executable could be found in either the global installation directory, or in the paths specified by the environment variable LIBCAMERA_IPA_PROXY_PATH. This function checks the global install directory first, then LIBCAMERA_IPA_PROXY_PATH in order, and returns the full path to the proxy worker executable that is specified by file. The proxy worker executable shall have exec permission.

Returns
  The full path to the proxy worker executable, or an empty string if no valid executable path

## Member Data Documentation

## ◆ state_

ProxyState libcamera::IPAProxy::state_
| protected

Current state of the IPAProxy.

The IPAProxy can be Running, Stopped, or Stopping.

This state provides a means to ensure that asynchronous functions are only called while the proxy is running, and prevent new tasks being submitted while still enabling events to complete when the IPAProxy is stopping.

## ◆ valid_

bool libcamera::IPAProxy::valid_
| protected

Flag to indicate if the IPAProxy instance is valid.

A IPAProxy instance is valid if the IPA interface is successfully created in isolation, and IPC is successfully set up.

This flag can be read via IPAProxy::isValid().

Implementations of the IPAProxy class should set this flag upon successful construction.

The documentation for this class was generated from the following files:

- include/libcamera/internal/ipa_proxy.h
- src/libcamera/ipa_proxy.cpp