summaryrefslogtreecommitdiff
path: root/src/libcamera/include/ipa_manager.h
blob: 0b5fd2ac1f1247b338e43c2e36571d7fccd0b576 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
 * Copyright (C) 2019, Google Inc.
 *
 * ipa_manager.h - Image Processing Algorithm module manager
 */
#ifndef __LIBCAMERA_IPA_MANAGER_H__
#define __LIBCAMERA_IPA_MANAGER_H__

#include <stdint.h>
#include <vector>

#include <ipa/ipa_interface.h>
#include <ipa/ipa_module_info.h>

#include "ipa_module.h"
#include "pipeline_handler.h"
#include "pub_key.h"

namespace libcamera {

class IPAManager
{
public:
	static IPAManager *instance();

	std::unique_ptr<IPAInterface> createIPA(PipelineHandler *pipe,
						uint32_t maxVersion,
						uint32_t minVersion);

private:
	std::vector<IPAModule *> modules_;

	IPAManager();
	~IPAManager();

	void parseDir(const char *libDir, unsigned int maxDepth,
		      std::vector<std::string> &files);
	unsigned int addDir(const char *libDir, unsigned int maxDepth = 0);

	bool isSignatureValid(IPAModule *ipa) const;

	static const uint8_t publicKeyData_[];
	static const PubKey pubKey_;
};

} /* namespace libcamera */

#endif /* __LIBCAMERA_IPA_MANAGER_H__ */