The ControlInfoMap and V4L2ControlInfoMap classes are very similar, with the latter adding convenience accessors based on numerical IDs for the former, as well as a cached idmap. Both features can be useful for ControlInfoMap in the context of serialisation, and merging the two classes will further simplify the IPA API. Import all the features of V4L2ControlInfoMap into ControlInfoMap, turning the latter into a real class. A few new constructors and assignment operators are added for completeness. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
57 lines
1.2 KiB
C++
57 lines
1.2 KiB
C++
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
/*
|
|
* Copyright (C) 2019, Google Inc.
|
|
*
|
|
* ipa_interface.h - Image Processing Algorithm interface
|
|
*/
|
|
#ifndef __LIBCAMERA_IPA_INTERFACE_H__
|
|
#define __LIBCAMERA_IPA_INTERFACE_H__
|
|
|
|
#include <map>
|
|
#include <vector>
|
|
|
|
#include <libcamera/buffer.h>
|
|
#include <libcamera/controls.h>
|
|
#include <libcamera/geometry.h>
|
|
#include <libcamera/signal.h>
|
|
|
|
#include "v4l2_controls.h"
|
|
|
|
namespace libcamera {
|
|
|
|
struct IPAStream {
|
|
unsigned int pixelFormat;
|
|
Size size;
|
|
};
|
|
|
|
struct IPABuffer {
|
|
unsigned int id;
|
|
BufferMemory memory;
|
|
};
|
|
|
|
struct IPAOperationData {
|
|
unsigned int operation;
|
|
std::vector<uint32_t> data;
|
|
std::vector<ControlList> controls;
|
|
};
|
|
|
|
class IPAInterface
|
|
{
|
|
public:
|
|
virtual ~IPAInterface() {}
|
|
|
|
virtual int init() = 0;
|
|
|
|
virtual void configure(const std::map<unsigned int, IPAStream> &streamConfig,
|
|
const std::map<unsigned int, ControlInfoMap> &entityControls) = 0;
|
|
|
|
virtual void mapBuffers(const std::vector<IPABuffer> &buffers) = 0;
|
|
virtual void unmapBuffers(const std::vector<unsigned int> &ids) = 0;
|
|
|
|
virtual void processEvent(const IPAOperationData &data) = 0;
|
|
Signal<unsigned int, const IPAOperationData &> queueFrameAction;
|
|
};
|
|
|
|
} /* namespace libcamera */
|
|
|
|
#endif /* __LIBCAMERA_IPA_INTERFACE_H__ */
|