summaryrefslogtreecommitdiff
path: root/include/linux/rkisp1-config.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-11-29 23:02:27 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-12-01 08:54:12 +0200
commitb24d9c4413b9d7f55f4105adeb7cf9a2450d3204 (patch)
treec896a9d23ffe729ffdac5146b965fe2e83fbdee8 /include/linux/rkisp1-config.h
parent68e4f70a6937a69339c3f48502cd4e332c3a16ca (diff)
test: Store path to the test executable in Test class
Store the path to the test executable, found in argv[0], in the Test instance. This can be useful for tests that need to fork processes. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'include/linux/rkisp1-config.h')
0 files changed, 0 insertions, 0 deletions
id='n48' href='#n48'>48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
/* 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 <ipa/ipa_interface.h>

namespace libcamera {

class IPAModule;

class IPAProxy : public IPAInterface
{
public:
	IPAProxy(IPAModule *ipam);
	~IPAProxy();

	bool isValid() const { return valid_; }

	std::string configurationFile(const std::string &file) const;

protected:
	std::string resolvePath(const std::string &file) const;

	bool valid_;

private:
	IPAModule *ipam_;
};

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 std::make_unique<proxy>(ipam);	\
	}						\
};							\
static proxy##Factory global_##proxy##Factory;

} /* namespace libcamera */

#endif /* __LIBCAMERA_IPA_PROXY_H__ */