libcamera  v0.2.0+135-3cb20bc2
Supporting cameras in Linux since 2019
Classes | Public Member Functions | List of all members
libcamera::IPCMessage Class Reference

IPC message to be passed through IPC message pipe. More...

Classes

struct  Header
 Container for an IPCMessage header. More...
 

Public Member Functions

 IPCMessage ()
 Construct an empty IPCMessage instance.
 
 IPCMessage (uint32_t cmd)
 Construct an IPCMessage instance with a given command code. More...
 
 IPCMessage (const Header &header)
 Construct an IPCMessage instance with a given header. More...
 
 IPCMessage (IPCUnixSocket::Payload &payload)
 Construct an IPCMessage instance from an IPC payload. More...
 
IPCUnixSocket::Payload payload () const
 Create an IPCUnixSocket payload from the IPCMessage. More...
 
Headerheader ()
 Returns a reference to the header.
 
std::vector< uint8_t > & data ()
 Returns a reference to the byte vector containing data.
 
std::vector< SharedFD > & fds ()
 Returns a reference to the vector containing file descriptors.
 
const Headerheader () const
 Returns a const reference to the header.
 
const std::vector< uint8_t > & data () const
 Returns a const reference to the byte vector containing data.
 
const std::vector< SharedFD > & fds () const
 Returns a const reference to the vector containing file descriptors.
 

Detailed Description

IPC message to be passed through IPC message pipe.

Constructor & Destructor Documentation

◆ IPCMessage() [1/3]

libcamera::IPCMessage::IPCMessage ( uint32_t  cmd)

Construct an IPCMessage instance with a given command code.

Parameters
[in]cmdThe command code

◆ IPCMessage() [2/3]

libcamera::IPCMessage::IPCMessage ( const Header header)

Construct an IPCMessage instance with a given header.

Parameters
[in]headerThe header that the constructed IPCMessage will contain

◆ IPCMessage() [3/3]

libcamera::IPCMessage::IPCMessage ( IPCUnixSocket::Payload payload)

Construct an IPCMessage instance from an IPC payload.

Parameters
[in]payloadThe IPCUnixSocket payload to construct from

This essentially converts an IPCUnixSocket payload into an IPCMessage. The header is extracted from the payload into the IPCMessage's header field.

If the IPCUnixSocket payload had any valid file descriptors, then they will all be invalidated.

Member Function Documentation

◆ payload()

IPCUnixSocket::Payload libcamera::IPCMessage::payload ( ) const

Create an IPCUnixSocket payload from the IPCMessage.

This essentially converts the IPCMessage into an IPCUnixSocket payload.

Todo:
Resolve the layering violation (add other converters later?)

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