libcamera: libcamera::MediaPad 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::MediaPad Class Reference

The MediaPad represents a pad of an entity in the media graph. More...

Inheritance diagram for libcamera::MediaPad:
[legend]
Collaboration diagram for libcamera::MediaPad:
[legend]

## Public Member Functions
unsigned int | index () const
| Retrieve the pad index.
MediaEntity * | entity () const
| Retrieve the entity the pad belongs to.
unsigned int | flags () const
| Retrieve the pad flags.
const std::vector< MediaLink * > & | links () const
| Retrieve all links in the pad.
void | addLink (MediaLink *link)
| Add a new link to this pad.
std::string | toString () const
| Generate a string representation of the MediaPad.
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 MediaPad represents a pad of an entity in the media graph.

Pads are created from the information provided by the Media Controller API in the media_v2_pad structure. They reference the entity() they belong to.

In addition to their graph id, media graph pads are identified by an index unique in the context of the entity the pad belongs to.

A pad can be either a 'source' pad or a 'sink' pad. This information is captured in the pad flags().

Pads are connected through links. Links originating from a source pad are outbound links, and links arriving at a sink pad are inbound links. Pads reference all the links() that are connected to them.

## Member Function Documentation

## ◆ addLink()

void libcamera::MediaPad::addLink | ( | MediaLink * | link | ) |

Add a new link to this pad.

Parameters

  [in] | link | The MediaLink to add

## ◆ entity()

MediaEntity * libcamera::MediaPad::entity | ( |  | ) | const
| inline

Retrieve the entity the pad belongs to.

Returns
  The MediaEntity the pad belongs to

## ◆ flags()

unsigned int libcamera::MediaPad::flags | ( |  | ) | const
| inline

Retrieve the pad flags.

Pad flags are a bitmask of flags defined by the Media Controller API MEDIA_PAD_FL_* macros.

Returns
  The pad flags

## ◆ index()

unsigned int libcamera::MediaPad::index | ( |  | ) | const
| inline

Retrieve the pad index.

Returns
  The 0-based pad index identifying the pad in the context of the entity it belongs to

## ◆ links()

const std::vector< MediaLink * > & libcamera::MediaPad::links | ( |  | ) | const
| inline

Retrieve all links in the pad.

Returns
  A list of links connected to the pad

## ◆ toString()

std::string libcamera::MediaPad::toString | ( |  | ) | const

Generate a string representation of the MediaPad.

Returns
  A string representing the MediaPad

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

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