libcamera  v0.4.0+139-39419ce4
Supporting cameras in Linux since 2019
Public Member Functions | Static Public Member Functions | List of all members
libcamera::CameraSensorFactoryBase Class Referenceabstract

Base class for camera sensor factories. More...

Inheritance diagram for libcamera::CameraSensorFactoryBase:
Inheritance graph
[legend]

Public Member Functions

 CameraSensorFactoryBase (const char *name, int priority)
 Construct a camera sensor factory base. More...
 
const std::string & name () const
 Retrieve the camera sensor factory name. More...
 
int priority () const
 Retrieve the priority value for the factory. More...
 

Static Public Member Functions

static std::unique_ptr< CameraSensorcreate (MediaEntity *entity)
 Create an instance of the CameraSensor corresponding to a media entity. More...
 

Detailed Description

Base class for camera sensor factories.

The CameraSensorFactoryBase class is the base of all specializations of the CameraSensorFactory class template. It implements the factory registration, maintains a registry of factories, and provides access to the registered factories.

Constructor & Destructor Documentation

◆ CameraSensorFactoryBase()

libcamera::CameraSensorFactoryBase::CameraSensorFactoryBase ( const char *  name,
int  priority 
)

Construct a camera sensor factory base.

Parameters
[in]nameThe camera sensor factory name
[in]priorityPriority order for factory selection

Creating an instance of the factory base registers it with the global list of factories, accessible through the factories() function.

Member Function Documentation

◆ create()

std::unique_ptr< CameraSensor > libcamera::CameraSensorFactoryBase::create ( MediaEntity entity)
static

Create an instance of the CameraSensor corresponding to a media entity.

Parameters
[in]entityThe media entity on the source end of the sensor

When multiple factories match the same entity, this function selects the matching factory with the highest priority as specified to the REGISTER_CAMERA_SENSOR() macro at factory registration time. If multiple matching factories have the same highest priority value, which factory gets selected is undefined and may vary between runs.

Returns
A unique pointer to a new instance of the CameraSensor subclass matching the entity, or a null pointer if no such factory exists

◆ name()

libcamera::CameraSensorFactoryBase::name ( ) const
inline

Retrieve the camera sensor factory name.

Returns
The name of the factory

◆ priority()

libcamera::CameraSensorFactoryBase::priority ( ) const
inline

Retrieve the priority value for the factory.

Returns
The priority value for the factory

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