diff options
author | Paul Elder <paul.elder@ideasonboard.com> | 2019-07-02 23:48:21 +0900 |
---|---|---|
committer | Paul Elder <paul.elder@ideasonboard.com> | 2019-07-12 16:32:29 +0900 |
commit | c2a8217df54c2c522047ee716228c9dd4fc1dd32 (patch) | |
tree | a8c7c3232c573645f4e927e6d0ae2dc8c381db6a /src/libcamera/include | |
parent | 3d20beca6616095b2bc2952d645e7562410e79e5 (diff) |
libcamera: add IPA proxy
Add an IPAProxy class whose implementations will act as a proxy between a
pipeline handler and an isolated IPA interface. Also add an IPAProxyFactory
that will construct the IPAProxy implementations as necessary.
Update Doxygen to ignore the directory where IPAProxy implementations will
reside.
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/libcamera/include')
-rw-r--r-- | src/libcamera/include/ipa_proxy.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/src/libcamera/include/ipa_proxy.h b/src/libcamera/include/ipa_proxy.h new file mode 100644 index 00000000..ac57699b --- /dev/null +++ b/src/libcamera/include/ipa_proxy.h @@ -0,0 +1,66 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2019, Google Inc. + * + * ipa_proxy.h - Image Processing Algorithm proxy + */ +#ifndef __LIBCAMERA_IPA_PROXY_H__ +#define __LIBCAMERA_IPA_PROXY_H__ + +#include <memory> +#include <string> +#include <vector> + +#include <libcamera/ipa/ipa_interface.h> + +#include "ipa_module.h" +#include "utils.h" + +namespace libcamera { + +class IPAProxy : public IPAInterface +{ +public: + IPAProxy(); + ~IPAProxy(); + + bool isValid() const { return valid_; } + +protected: + std::string resolvePath(const std::string &file) const; + + bool valid_; +}; + +class IPAProxyFactory +{ +public: + IPAProxyFactory(const char *name); + virtual ~IPAProxyFactory(){}; + + virtual std::unique_ptr<IPAProxy> create(IPAModule *ipam) = 0; + + const std::string &name() const { return name_; } + + static void registerType(IPAProxyFactory *factory); + static std::vector<IPAProxyFactory *> &factories(); + +private: + std::string name_; +}; + +#define REGISTER_IPA_PROXY(proxy) \ +class proxy##Factory final : public IPAProxyFactory \ +{ \ +public: \ + proxy##Factory() : IPAProxyFactory(#proxy) {} \ + std::unique_ptr<IPAProxy> create(IPAModule *ipam) \ + { \ + return utils::make_unique<proxy>(ipam); \ + } \ +}; \ +static proxy##Factory global_##proxy##Factory; + +} /* namespace libcamera */ + +#endif /* __LIBCAMERA_IPA_PROXY_H__ */ |