libcamera  v0.3.1+12-19bbca3c
Supporting cameras in Linux since 2019
Public Member Functions | Public Attributes | Protected Attributes | List of all members
libcamera::IPCPipe Class Referenceabstract

IPC message pipe for IPA isolation. More...

Collaboration diagram for libcamera::IPCPipe:
Collaboration graph
[legend]

Public Member Functions

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

Public Attributes

Signal< const IPCMessage & > recv
 Signal to be emitted when a message is received over IPC. More...
 

Protected Attributes

bool connected_
 Flag to indicate if the IPCPipe instance is connected. More...
 

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()

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()

libcamera::IPCPipe::sendAsync ( const IPCMessage data)
pure virtual

Send a message over IPC asynchronously.

Parameters
[in]dataData to send

This function will return immediately after sending the message.

Returns
Zero on success, negative error code otherwise

◆ sendSync()

libcamera::IPCPipe::sendSync ( const IPCMessage in,
IPCMessage out 
)
pure virtual

Send a message over IPC synchronously.

Parameters
[in]inData to send
[in]outIPCMessage 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_

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

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: