libcamera  v0.3.0
Supporting cameras in Linux since 2019
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:
Inheritance graph
[legend]
Collaboration diagram for libcamera::IPAModule:
Collaboration graph
[legend]

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 IPAModuleInfoinfo () 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...
 
IPAInterfacecreateInterface ()
 Instantiate an IPA interface. 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 LogCategory *category, LogSeverity severity, const char *fileName=__builtin_FILE(), unsigned int line=__builtin_LINE()) 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]libPathpath 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]pipePipeline handler to match with
[in]minVersionMinimum acceptable version of IPA module
[in]maxVersionMaximum 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: