libcamera::MediaEntity Class Reference

The MediaEntity represents an entity in the media graph. More...

Inheritance diagram for libcamera::MediaEntity:

## Public Member Functions

const std::string & | name () const
| Retrieve the entity name. More...
unsigned int | function () const
| Retrieve the entity's main function. More...
unsigned int | flags () const
| Retrieve the entity's flags. More...
const std::string & | deviceNode () const
| Retrieve the entity's device node path, if any. More...
unsigned int | deviceMajor () const
| Retrieve the major number of the interface associated with the entity. More...
unsigned int | deviceMinor () const
| Retrieve the minor number of the interface associated with the entity. More...
const std::vector< MediaPad * > & | pads () const
| Retrieve all pads of the entity. More...
const MediaPad * | getPadByIndex (unsigned int index) const
| Get a pad in this entity by its index. More...
const MediaPad * | getPadById (unsigned int id) const
| Get a pad in this entity by its object id. More...
int | setDeviceNode (const std::string &deviceNode)
| Set the path to the device node for the associated interface. More...
Public Member Functions inherited from libcamera::MediaObject
MediaDevice * | device ()
| 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
MediaDevice * | dev_
| The media device the media object belongs to.
unsigned int | id_
| The media object id.

## Detailed Description

The MediaEntity represents an entity in the media graph.

Entities are created from the information provided by the Media Controller API in the media_v2_entity structure. They reference the pads() they contain.

In addition to their graph id, media graph entities are identified by a name() unique in the media device context. They implement a function() and may expose a deviceNode().

## Member Function Documentation

## deviceMajor()

libcamera::MediaEntity::deviceMajor | ( |  | ) | const

inline

Retrieve the major number of the interface associated with the entity.

Returns
  The interface major number, or 0 if the entity isn't associated with an interface

## deviceMinor()

libcamera::MediaEntity::deviceMinor | ( |  | ) | const

inline

Retrieve the minor number of the interface associated with the entity.

Returns
  The interface minor number, or 0 if the entity isn't associated with an interface

## deviceNode()

libcamera::MediaEntity::deviceNode | ( |  | ) | const

inline

Retrieve the entity's device node path, if any.

Returns
  The entity's device node path, or an empty string if it is not set

See also
  int setDeviceNode()

## flags()

libcamera::MediaEntity::flags | ( |  | ) | const

inline

Retrieve the entity's flags.

Media entity flags are expressed using the MEDIA_ENT_FL_* macros defined by the Media Controller API.

Returns
  The entity's flags

## function()

libcamera::MediaEntity::function | ( |  | ) | const

inline

Retrieve the entity's main function.

Media entity functions are expressed using the MEDIA_ENT_F_* macros defined by the Media Controller API.

Returns
  The entity's function

## getPadById()

const MediaPad * libcamera::MediaEntity::getPadById | ( | unsigned int | id | ) | const

Get a pad in this entity by its object id.

Parameters

  [in] | id | The pad id

Returns
  The pad identified by id, or nullptr if no such pad exist

## getPadByIndex()

const MediaPad * libcamera::MediaEntity::getPadByIndex | ( | unsigned int | index | ) | const

Get a pad in this entity by its index.

Parameters

  [in] | index | The 0-based pad index

Returns
  The pad identified by index, or nullptr if no such pad exist

## name()

libcamera::MediaEntity::name | ( |  | ) | const

inline

Retrieve the entity name.

Returns
  The entity name

## pads()

libcamera::MediaEntity::pads | ( |  | ) | const

inline

Retrieve all pads of the entity.

Returns
  The list of the entity's pads

## setDeviceNode()

int libcamera::MediaEntity::setDeviceNode | ( | const std::string & | deviceNode | ) |

Set the path to the device node for the associated interface.

Parameters

  [in] | deviceNode | The interface device node path associated with this entity

Returns
  0 on success or a negative error code otherwise

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

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