libcamera  v0.3.1+12-19bbca3c
Supporting cameras in Linux since 2019
Public Types | Public Member Functions | Friends | List of all members
libcamera::MediaEntity Class Reference

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

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

Public Types

enum  Type { Invalid, MediaEntity, V4L2Subdevice, V4L2VideoDevice }
 The type of the interface exposed by the entity to userspace.
 

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...
 
Type type () const
 Retrieve the entity's type. 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 std::vector< MediaEntity * > ancillaryEntities () const
 Retrieve all ancillary entities of the entity. More...
 
const MediaPadgetPadByIndex (unsigned int index) const
 Get a pad in this entity by its index. More...
 
const MediaPadgetPadById (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
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 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

◆ ancillaryEntities()

libcamera::MediaEntity::ancillaryEntities ( ) const
inline

Retrieve all ancillary entities of the entity.

Returns
The list of the entity's ancillary entities

◆ 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]idThe 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]indexThe 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]deviceNodeThe interface device node path associated with this entity
Returns
0 on success or a negative error code otherwise

◆ type()

libcamera::MediaEntity::type ( ) const
inline

Retrieve the entity's type.

The entity type identifies the type of interface exposed to userspace.

Returns
The entity's type

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