libcamera: libcamera::CameraSensorFactoryBase Class Reference

libcamera v0.7.1 Supporting cameras in Linux since 2019

Loading...
Searching...
No Matches
libcamera::CameraSensorFactoryBase Class Referenceabstract

Base class for camera sensor factories. More...

Inheritance diagram for libcamera::CameraSensorFactoryBase:
[legend]

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

## Static Public Member Functions
static std::unique_ptr< CameraSensor > | create (MediaEntity *entity)
| Create an instance of the CameraSensor corresponding to a media entity.

## 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] | name | The camera sensor factory name
  [in] | priority | Priority 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] | entity | The 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()

const std::string & libcamera::CameraSensorFactoryBase::name | ( |  | ) | const
| inline

Retrieve the camera sensor factory name.

Returns
  The name of the factory

## ◆ priority()

int 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:

- include/libcamera/internal/camera_sensor.h
- src/libcamera/sensor/camera_sensor.cpp