libcamera: libcamera::IPAModule Class Reference

libcamera v0.0.4 Supporting cameras in Linux since 2019

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
libcamera::IPAModule Class Reference

Wrapper around IPA module shared object. More...

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

## Public Member Functions
| IPAModule (const std::string &libPath)
| Construct an IPAModule instance.
bool | isValid () const
| Check if the IPAModule instance is valid.
const struct IPAModuleInfo & | info () const
| Retrieve the IPA module information.
const std::vector< uint8_t > | signature () const
| Retrieve the IPA module signature.
const std::string & | path () const
| Retrieve the IPA module path.
bool | load ()
| Load the IPA implementation factory from the shared object.
IPAInterface * | createInterface ()
| Instantiate an IPA interface.
bool | match (PipelineHandler *pipe, uint32_t minVersion, uint32_t maxVersion) const
| Verify if the IPA module matches a given pipeline handler.

## Protected Member Functions
std::string | logPrefix () const override
| Retrieve a string to be prefixed to the log message.
Protected Member Functions inherited from libcamera::Loggable
virtual std::string | logPrefix () const =0
| Retrieve a string to be prefixed to the log message.
LogMessage | _log (const LogCategory *category, LogSeverity severity, const char *fileName=__builtin_FILE(), unsigned int line=__builtin_LINE()) const
| Create a temporary LogMessage object to log a message.

## Detailed Description

Wrapper around IPA module shared object.

## Constructor & Destructor Documentation

## ◆ IPAModule()

libcamera::IPAModule::IPAModule | ( | const std::string & | libPath | ) |
| explicit

Construct an IPAModule instance.

Parameters

  [in] | libPath | path to IPA module shared object

Loads the IPAModuleInfo from the IPA module shared object at libPath. The IPA module shared object file must be of the same endianness and bitness as libcamera.

The caller shall call the isValid() function after constructing an IPAModule instance to verify the validity of the IPAModule.

## Member Function Documentation

## ◆ createInterface()

IPAInterface * libcamera::IPAModule::createInterface | ( |  | ) |

Instantiate an IPA interface.

After loading the IPA module with load(), this function creates an instance of the IPA module interface.

Calling this function on a module that has not yet been loaded, or an invalid module (as returned by load() and isValid(), respectively) is an error.

Returns
  The IPA interface on success, or nullptr on error

## ◆ info()

const struct IPAModuleInfo & libcamera::IPAModule::info | ( |  | ) | const

Retrieve the IPA module information.

The content of the IPA module information is loaded from the module, and is valid only if the module is valid (as returned by isValid()). Calling this function on an invalid module is an error.

Returns
  the IPA module information

## ◆ isValid()

bool libcamera::IPAModule::isValid | ( |  | ) | const

Check if the IPAModule instance is valid.

An IPAModule instance is valid if the IPA module shared object exists and the IPA module information it contains was successfully retrieved and validated.

Returns
  True if the IPAModule is valid, false otherwise

## ◆ load()

bool libcamera::IPAModule::load | ( |  | ) |

Load the IPA implementation factory from the shared object.

The IPA module shared object implements an IPAInterface object to be used by pipeline handlers. This function loads the factory function from the shared object. Later, createInterface() can be called to instantiate the IPAInterface.

This function only needs to be called successfully once, after which createInterface() can be called as many times as IPAInterface instances are needed.

Calling this function on an invalid module (as returned by isValid()) is an error.

Returns
  True if load was successful, or already loaded, and false otherwise

## ◆ logPrefix()

std::string libcamera::IPAModule::logPrefix | ( |  | ) | const
| overrideprotectedvirtual

Retrieve a string to be prefixed to the log message.

This function allows classes inheriting from the Loggable class to extend the logger with an object-specific prefix output right before the log message contents.

Returns
  A string to be prefixed to the log message

Implements libcamera::Loggable.

## ◆ match()

bool libcamera::IPAModule::match | ( | PipelineHandler * | pipe,
|  | uint32_t | minVersion,
|  | uint32_t | maxVersion
| ) |  | const

Verify if the IPA module matches a given pipeline handler.

Parameters

  [in] | pipe | Pipeline handler to match with
  [in] | minVersion | Minimum acceptable version of IPA module
  [in] | maxVersion | Maximum acceptable version of IPA module

This function checks if this IPA module matches the pipe pipeline handler, and the input version range.

Returns
  True if the pipeline handler matches the IPA module, or false otherwise

## ◆ path()

const std::string & libcamera::IPAModule::path | ( |  | ) | const

Retrieve the IPA module path.

The IPA module path is the file name and path of the IPA module shared object from which the IPA module was created.

Returns
  The IPA module path

## ◆ signature()

const std::vector< uint8_t > libcamera::IPAModule::signature | ( |  | ) | const

Retrieve the IPA module signature.

The IPA module signature is stored alongside the IPA module in a file with a '.sign' suffix, and is loaded when the IPAModule instance is created. This function returns the signature without verifying it. If the signature is missing, the returned vector will be empty.

Returns
  The IPA module signature

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

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