libcamera  v0.0.0
Supporting cameras in Linux since 2019
ipa_module.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 /*
3  * Copyright (C) 2019, Google Inc.
4  *
5  * ipa_module.h - Image Processing Algorithm module
6  */
7 #ifndef __LIBCAMERA_INTERNAL_IPA_MODULE_H__
8 #define __LIBCAMERA_INTERNAL_IPA_MODULE_H__
9 
10 #include <stdint.h>
11 #include <string>
12 #include <vector>
13 
16 
17 #include "libcamera/internal/log.h"
19 
20 namespace libcamera {
21 
22 class IPAModule : public Loggable
23 {
24 public:
25  explicit IPAModule(const std::string &libPath);
26  ~IPAModule();
27 
28  bool isValid() const;
29 
30  const struct IPAModuleInfo &info() const;
31  const std::vector<uint8_t> signature() const;
32  const std::string &path() const;
33 
34  bool load();
35 
36  struct ipa_context *createContext();
37 
38  bool match(PipelineHandler *pipe,
39  uint32_t minVersion, uint32_t maxVersion) const;
40 
41 protected:
42  std::string logPrefix() const override;
43 
44 private:
45  int loadIPAModuleInfo();
46 
47  struct IPAModuleInfo info_;
48  std::vector<uint8_t> signature_;
49 
50  std::string libPath_;
51  bool valid_;
52  bool loaded_;
53 
54  void *dlHandle_;
55  typedef struct ipa_context *(*IPAIntfFactory)(void);
56  IPAIntfFactory ipaCreate_;
57 };
58 
59 } /* namespace libcamera */
60 
61 #endif /* __LIBCAMERA_INTERNAL_IPA_MODULE_H__ */
Wrapper around IPA module shared object.
Definition: ipa_module.h:23
const struct IPAModuleInfo & info() const
Retrieve the IPA module information.
Definition: ipa_module.cpp:358
std::string logPrefix() const override
Retrieve a string to be prefixed to the log message.
Definition: ipa_module.cpp:482
const std::vector< uint8_t > signature() const
Retrieve the IPA module signature.
Definition: ipa_module.cpp:373
bool load()
Load the IPA implementation factory from the shared object.
Definition: ipa_module.cpp:408
IPAModule(const std::string &libPath)
Construct an IPAModule instance.
Definition: ipa_module.cpp:259
const std::string & path() const
Retrieve the IPA module path.
Definition: ipa_module.cpp:386
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
bool isValid() const
Check if the IPAModule instance is valid.
Definition: ipa_module.cpp:344
struct ipa_context * createContext()
Instantiate an IPA context.
Definition: ipa_module.cpp:455
Base class to support log message extensions.
Definition: log.h:83
Create and manage cameras based on a set of media devices.
Definition: pipeline_handler.h:59
Image Processing Algorithm interface.
Image Processing Algorithm module information.
Logging infrastructure.
Create pipelines and cameras from a set of media devices.
IPA module context of execution.
Definition: ipa_interface.h:17
Information of an IPA module.
Definition: ipa_module_info.h:16