libcamera
v0.3.1+12-19bbca3c
Supporting cameras in Linux since 2019
|
Wrapper around IPA module shared object. More...
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... | |
IPAInterface * | createInterface () |
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... | |
Wrapper around IPA module shared object.
|
explicit |
Construct an IPAModule instance.
[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.
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.
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.
bool libcamera::IPAModule::isValid | ( | ) | const |
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.
|
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.
Implements libcamera::Loggable.
bool libcamera::IPAModule::match | ( | PipelineHandler * | pipe, |
uint32_t | minVersion, | ||
uint32_t | maxVersion | ||
) | const |
Verify if the IPA module matches a given pipeline handler.
[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.
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.
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.