libcamera
v0.0.0
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... | |
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... | |
![]() | |
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... | |
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() method after constructing an IPAModule instance to verify the validity of the IPAModule.
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.
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 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.
|
overrideprotectedvirtual |
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.
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 method 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.