summaryrefslogtreecommitdiff
path: root/Documentation/guides
ModeNameSize
-rw-r--r--application-developer.rst23698logplain
-rw-r--r--introduction.rst16341logplain
-rw-r--r--ipa.rst20766logplain
-rw-r--r--pipeline-handler.rst60536logplain
-rw-r--r--tracing.rst5549logplain
='n92' href='#n92'>92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
 * Copyright (C) 2022, Google Inc.
 *
 * fc_queue.h - IPA Frame context queue
 */

#pragma once

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

#include <libcamera/base/log.h>

namespace libcamera {

LOG_DECLARE_CATEGORY(FCQueue)

namespace ipa {

template<typename FrameContext>
class FCQueue;

struct FrameContext {
private:
	template<typename T> friend class FCQueue;
	uint32_t frame;
};

template<typename FrameContext>
class FCQueue
{
public:
	FCQueue(unsigned int size)
		: contexts_(size)
	{
	}

	void clear()
	{
		for (FrameContext &ctx : contexts_)
			ctx.frame = 0;
	}

	FrameContext &alloc(const uint32_t frame)
	{