libcamera  v0.2.0+85-1c5830a9
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 
8 #pragma once
9 
10 #include <stdint.h>
11 #include <string>
12 #include <vector>
13 
14 #include <libcamera/base/log.h>
15 
18 
20 
21 namespace libcamera {
22 
23 class IPAModule : public Loggable
24 {
25 public:
26  explicit IPAModule(const std::string &libPath);
27  ~IPAModule();
28 
29  bool isValid() const;
30 
31  const struct IPAModuleInfo &info() const;
32  const std::vector<uint8_t> signature() const;
33  const std::string &path() const;
34 
35  bool load();
36 
38 
39  bool match(PipelineHandler *pipe,
40  uint32_t minVersion, uint32_t maxVersion) const;
41 
42 protected:
43  std::string logPrefix() const override;
44 
45 private:
46  int loadIPAModuleInfo();
47 
48  struct IPAModuleInfo info_;
49  std::vector<uint8_t> signature_;
50 
51  std::string libPath_;
52  bool valid_;
53  bool loaded_;
54 
55  void *dlHandle_;
56  typedef IPAInterface *(*IPAIntfFactory)(void);
57  IPAIntfFactory ipaCreate_;
58 };
59 
60 } /* namespace libcamera */
C++ Interface for IPA implementation.
Definition: ipa_interface.h:30
Information of an IPA module.
Definition: ipa_module_info.h:16
const struct IPAModuleInfo & info() const
Retrieve the IPA module information.
Definition: ipa_module.cpp:362
Base class to support log message extensions.
Definition: log.h:90
const std::vector< uint8_t > signature() const
Retrieve the IPA module signature.
Definition: ipa_module.cpp:377
Image Processing Algorithm interface.
Top-level libcamera namespace.
Definition: backtrace.h:17
Image Processing Algorithm module information.
bool isValid() const
Check if the IPAModule instance is valid.
Definition: ipa_module.cpp:348
const std::string & path() const
Retrieve the IPA module path.
Definition: ipa_module.cpp:390
Wrapper around IPA module shared object.
Definition: ipa_module.h:23
bool load()
Load the IPA implementation factory from the shared object.
Definition: ipa_module.cpp:412
Create and manage cameras based on a set of media devices.
Definition: pipeline_handler.h:37
IPAInterface * createInterface()
Instantiate an IPA interface.
Definition: ipa_module.cpp:457
IPAModule(const std::string &libPath)
Construct an IPAModule instance.
Definition: ipa_module.cpp:258
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:476
Logging infrastructure.
Create pipelines and cameras from a set of media devices.
std::string logPrefix() const override
Retrieve a string to be prefixed to the log message.
Definition: ipa_module.cpp:484