summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/ipu3/frames.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcamera/pipeline/ipu3/frames.h')
-rw-r--r--src/libcamera/pipeline/ipu3/frames.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/libcamera/pipeline/ipu3/frames.h b/src/libcamera/pipeline/ipu3/frames.h
new file mode 100644
index 00000000..106e5c15
--- /dev/null
+++ b/src/libcamera/pipeline/ipu3/frames.h
@@ -0,0 +1,62 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2020, Google Inc.
+ *
+ * frames.h - Intel IPU3 Frames helper
+ */
+#ifndef __LIBCAMERA_PIPELINE_IPU3_FRAMES_H__
+#define __LIBCAMERA_PIPELINE_IPU3_FRAMES_H__
+
+#include <map>
+#include <memory>
+#include <queue>
+#include <vector>
+
+namespace libcamera {
+
+class FrameBuffer;
+class IPAProxy;
+class PipelineHandler;
+class Request;
+class V4L2VideoDevice;
+struct IPABuffer;
+
+class IPU3Frames
+{
+public:
+ struct Info {
+ unsigned int id;
+ Request *request;
+
+ FrameBuffer *rawBuffer;
+ FrameBuffer *paramBuffer;
+ FrameBuffer *statBuffer;
+
+ bool paramDequeued;
+ bool metadataProcessed;
+ };
+
+ IPU3Frames();
+
+ void init(const std::vector<std::unique_ptr<FrameBuffer>> &paramBuffers,
+ const std::vector<std::unique_ptr<FrameBuffer>> &statBuffers);
+ void clear();
+
+ Info *create(Request *request);
+ void remove(Info *info);
+ bool tryComplete(Info *info);
+
+ Info *find(unsigned int id);
+ Info *find(FrameBuffer *buffer);
+
+private:
+ std::queue<FrameBuffer *> availableParamBuffers_;
+ std::queue<FrameBuffer *> availableStatBuffers_;
+
+ unsigned int nextId_;
+ std::map<unsigned int, std::unique_ptr<Info>> frameInfo_;
+};
+
+} /* namespace libcamera */
+
+#endif /* __LIBCAMERA_PIPELINE_IPU3_FRAMES_H__ */