libcamera: libcamera::IPCPipe Class Reference

libcamera v0.5.1 Supporting cameras in Linux since 2019

Loading...
Searching...
No Matches
libcamera::IPCPipe Class Referenceabstract

IPC message pipe for IPA isolation. More...

Collaboration diagram for libcamera::IPCPipe:
[legend]

## Public Member Functions
| IPCPipe ()
| Construct an IPCPipe instance.
bool | isConnected () const
| Check if the IPCPipe instance is connected.
virtual int | sendSync (const IPCMessage &in, IPCMessage *out)=0
| Send a message over IPC synchronously.
virtual int | sendAsync (const IPCMessage &data)=0
| Send a message over IPC asynchronously.

## Public Attributes
Signal< const IPCMessage & > | recv
| Signal to be emitted when a message is received over IPC.

## Protected Attributes
bool | connected_
| Flag to indicate if the IPCPipe instance is connected.

## Detailed Description

IPC message pipe for IPA isolation.

Virtual class to model an IPC message pipe for use by IPA proxies for IPA isolation. sendSync() and sendAsync() must be implemented, and the recvMessage signal must be emitted whenever new data is available.

## Member Function Documentation

## ◆ isConnected()

bool libcamera::IPCPipe::isConnected | ( |  | ) | const
| inline

Check if the IPCPipe instance is connected.

An IPCPipe instance is connected if IPC is successfully set up.

Returns
  True if the IPCPipe is connected, false otherwise

## ◆ sendAsync()

virtual int libcamera::IPCPipe::sendAsync | ( | const IPCMessage & | data | ) |
| pure virtual

Send a message over IPC asynchronously.

Parameters

  [in] | data | Data to send

This function will return immediately after sending the message.

Returns
  Zero on success, negative error code otherwise

## ◆ sendSync()

virtual int libcamera::IPCPipe::sendSync | ( | const IPCMessage & | in,
|  | IPCMessage * | out )
| pure virtual

Send a message over IPC synchronously.

Parameters

  [in] | in | Data to send
  [in] | out | IPCMessage instance in which to receive data, if applicable

This function will not return until a response is received. The event loop will still continue to execute, however.

Returns
  Zero on success, negative error code otherwise

Todo
  Determine if the event loop should limit the types of messages it processes, to avoid reintrancy in the caller, and carefully document what the caller needs to implement to make this safe.

## Member Data Documentation

## ◆ connected_

bool libcamera::IPCPipe::connected_
| protected

Flag to indicate if the IPCPipe instance is connected.

An IPCPipe instance is connected if IPC is successfully set up.

This flag can be read via IPCPipe::isConnected().

Implementations of the IPCPipe class should set this flag upon successful connection.

## ◆ recv

Signal<const IPCMessage &> libcamera::IPCPipe::recv

Signal to be emitted when a message is received over IPC.

When a message is received over IPC, this signal shall be emitted. Users must connect to this to receive messages.

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

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