libcamera::IPAModule Class Reference

Wrapper around IPA module shared object. More...

Inheritance diagram for libcamera::IPAModule:

## Public Member Functions

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

## Protected Member Functions

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

## 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() method after constructing an IPAModule instance to verify the validity of the IPAModule.

## Member Function Documentation

## createContext()

struct ipa_context * libcamera::IPAModule::createContext | ( |  | ) |

Instantiate an IPA context.

After loading the IPA module with load(), this method creates an instance of the IPA module context. Ownership of the context is passed to the caller, and the context shall be destroyed by calling the ipa_context::ops::destroy() function.

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 context 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 ipa_context object to be used by pipeline handlers. This method loads the factory function from the shared object. Later, createContext() can be called to instantiate the ipa_context.

This method only needs to be called successfully once, after which createContext() can be called as many times as ipa_context 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

override protected virtual

Retrieve a string to be prefixed to the log message.

This method 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 method 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