libcamera/src/libcamera/include/ipa_module.h
Jacopo Mondi 132d99bc8f ipa: Switch to the plain C API
Switch IPA communication to the plain C API. As the IPAInterface class
is easier to use for pipeline handlers than a plain C API, retain it and
add an IPAContextWrapper that translate between the C++ and the C APIs.

On the IPA module side usage of IPAInterface may be desired for IPAs
implemented in C++ that want to link to libcamera. For those IPAs, a new
IPAInterfaceWrapper helper class is introduced to wrap the IPAInterface
implemented internally by the IPA module into an ipa_context,
ipa_context_ops and ipa_callback_ops.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-11-20 21:48:00 +02:00

55 lines
1,013 B
C++

/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2019, Google Inc.
*
* ipa_module.h - Image Processing Algorithm module
*/
#ifndef __LIBCAMERA_IPA_MODULE_H__
#define __LIBCAMERA_IPA_MODULE_H__
#include <string>
#include <ipa/ipa_interface.h>
#include <ipa/ipa_module_info.h>
#include "pipeline_handler.h"
namespace libcamera {
class IPAModule
{
public:
explicit IPAModule(const std::string &libPath);
~IPAModule();
bool isValid() const;
const struct IPAModuleInfo &info() const;
const std::string &path() const;
bool load();
struct ipa_context *createContext();
bool match(PipelineHandler *pipe,
uint32_t minVersion, uint32_t maxVersion) const;
bool isOpenSource() const;
private:
struct IPAModuleInfo info_;
std::string libPath_;
bool valid_;
bool loaded_;
void *dlHandle_;
typedef struct ipa_context *(*IPAIntfFactory)(void);
IPAIntfFactory ipaCreate_;
int loadIPAModuleInfo();
};
} /* namespace libcamera */
#endif /* __LIBCAMERA_IPA_MODULE_H__ */