libcamera  v0.3.2+116-83c5ad0f
Supporting cameras in Linux since 2019
Public Member Functions | Friends | List of all members
libcamera::MediaLink Class Reference

The MediaLink represents a link between two pads in the media graph. More...

Inheritance diagram for libcamera::MediaLink:
Inheritance graph
[legend]
Collaboration diagram for libcamera::MediaLink:
Collaboration graph
[legend]

Public Member Functions

MediaPadsource () const
 Retrieve the link's source pad. More...
 
MediaPadsink () const
 Retrieve the link's sink pad. More...
 
unsigned int flags () const
 Retrieve the link's flags. More...
 
int setEnabled (bool enable)
 Enable or disable a link. More...
 
std::string toString () const
 Generate a string representation of the MediaLink. More...
 
- Public Member Functions inherited from libcamera::MediaObject
MediaDevicedevice ()
 Retrieve the media device the media object belongs to. More...
 
const MediaDevicedevice () const
 Retrieve the media device the media object belongs to. More...
 
unsigned int id () const
 Retrieve the media object id. More...
 

Friends

class MediaDevice
 

Additional Inherited Members

- Protected Member Functions inherited from libcamera::MediaObject
 MediaObject (MediaDevice *dev, unsigned int id)
 Construct a MediaObject part of the MediaDevice dev, identified by the id unique within the device. More...
 
- Protected Attributes inherited from libcamera::MediaObject
MediaDevicedev_
 The media device the media object belongs to.
 
unsigned int id_
 The media object id.
 

Detailed Description

The MediaLink represents a link between two pads in the media graph.

Links are created from the information provided by the Media Controller API in the media_v2_link structure. They reference the source() and sink() pads they connect and track the link status through link flags().

Each link is referenced in the link array of both of the pads it connect.

Member Function Documentation

◆ flags()

libcamera::MediaLink::flags ( ) const
inline

Retrieve the link's flags.

Link flags are a bitmask of flags defined by the Media Controller API MEDIA_LNK_FL_* macros.

Returns
The link flags

◆ setEnabled()

int libcamera::MediaLink::setEnabled ( bool  enable)

Enable or disable a link.

Parameters
[in]enableTrue to enable the link, false to disable it

Set the status of a link according to the value of enable. Links between two pads can be set to the enabled or disabled state freely, unless they're immutable links, whose status cannot be changed. Enabling an immutable link is not considered an error, while trying to disable it is.

Enabling a link establishes a data connection between two pads, while disabling it interrupts that connection.

Returns
0 on success or a negative error code otherwise

◆ sink()

libcamera::MediaLink::sink ( ) const
inline

Retrieve the link's sink pad.

Returns
The sink pad at the destination of the link

◆ source()

libcamera::MediaLink::source ( ) const
inline

Retrieve the link's source pad.

Returns
The source pad at the origin of the link

◆ toString()

std::string libcamera::MediaLink::toString ( ) const

Generate a string representation of the MediaLink.

Returns
A string representing the MediaLink

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