ipa_module.h
Go to the documentation of this file.
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2019, Google Inc.
*
* ipa_module.h - Image Processing Algorithm module
*/
#ifndef __LIBCAMERA_INTERNAL_IPA_MODULE_H__
#define __LIBCAMERA_INTERNAL_IPA_MODULE_H__
#include <stdint.h>
#include <string>
#include <vector>
#include <libcamera/ipa/ipa_interface.h>
#include <libcamera/ipa/ipa_module_info.h>
#include "libcamera/internal/log.h"
#include "libcamera/internal/pipeline_handler.h"
namespace libcamera {
class IPAModule : public Loggable
{
public:
explicit IPAModule(const std::string &libPath);
~IPAModule();
bool isValid() const;
const struct IPAModuleInfo &info() const;
const std::vector<uint8_t> signature() const;
const std::string &path() const;
bool load();
struct ipa_context *createContext();
bool match(PipelineHandler *pipe,
uint32_t minVersion, uint32_t maxVersion) const;
protected:
std::string logPrefix() const override;
private:
int loadIPAModuleInfo();
struct IPAModuleInfo info_;
std::vector<uint8_t> signature_;
std::string libPath_;
bool valid_;
bool loaded_;
void *dlHandle_;
typedef struct ipa_context *(*IPAIntfFactory)(void);
IPAIntfFactory ipaCreate_;
};
} /* namespace libcamera */
#endif /* __LIBCAMERA_INTERNAL_IPA_MODULE_H__ */
libcamera::IPAModule
Wrapper around IPA module shared object.
Definition: ipa_module.h:23
libcamera::IPAModule::info
const struct IPAModuleInfo & info() const
Retrieve the IPA module information.
Definition: ipa_module.cpp:358
libcamera::IPAModule::logPrefix
std::string logPrefix() const override
Retrieve a string to be prefixed to the log message.
Definition: ipa_module.cpp:482
libcamera::IPAModule::signature
const std::vector< uint8_t > signature() const
Retrieve the IPA module signature.
Definition: ipa_module.cpp:373
libcamera::IPAModule::load
bool load()
Load the IPA implementation factory from the shared object.
Definition: ipa_module.cpp:408
libcamera::IPAModule::IPAModule
IPAModule(const std::string &libPath)
Construct an IPAModule instance.
Definition: ipa_module.cpp:259
libcamera::IPAModule::path
const std::string & path() const
Retrieve the IPA module path.
Definition: ipa_module.cpp:386
libcamera::IPAModule::match
bool match(PipelineHandler *pipe, uint32_t minVersion, uint32_t maxVersion) const
Verify if the IPA module matches a given pipeline handler.
Definition: ipa_module.cpp:474
libcamera::IPAModule::isValid
bool isValid() const
Check if the IPAModule instance is valid.
Definition: ipa_module.cpp:344
libcamera::IPAModule::createContext
struct ipa_context * createContext()
Instantiate an IPA context.
Definition: ipa_module.cpp:455
libcamera::Loggable
Base class to support log message extensions.
Definition: log.h:83
libcamera::PipelineHandler
Create and manage cameras based on a set of media devices.
Definition: pipeline_handler.h:59
ipa_interface.h
Image Processing Algorithm interface.
ipa_module_info.h
Image Processing Algorithm module information.
log.h
Logging infrastructure.
pipeline_handler.h
Create pipelines and cameras from a set of media devices.
ipa_context
IPA module context of execution.
Definition: ipa_interface.h:17
libcamera::IPAModuleInfo
Information of an IPA module.
Definition: ipa_module_info.h:16