libcamera: libcamera::MediaLink Class Reference

libcamera v0.5.1 Supporting cameras in Linux since 2019 |

Loading...
Searching...
No Matches
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:
[legend]
Collaboration diagram for libcamera::MediaLink:
[legend]

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

## 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.
Protected Attributes inherited from libcamera::MediaObject
MediaDevice * | dev_
| 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()

unsigned int 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] | enable | True 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()

MediaPad * libcamera::MediaLink::sink | ( |  | ) | const
| inline

Retrieve the link's sink pad.

Returns
  The sink pad at the destination of the link

## ◆ source()

MediaPad * 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:

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