21 template<
typename FrameContext>
26 template<
typename T>
friend class FCQueue;
28 bool initialised =
false;
31 template<
typename FrameContext>
43 ctx.initialised =
false;
50 FrameContext &frameContext = contexts_[frame % contexts_.size()];
63 if (frame != 0 && frame <= frameContext.frame)
65 <<
"Frame " << frame <<
" already initialised";
67 init(frameContext, frame);
74 FrameContext &frameContext = contexts_[frame % contexts_.size()];
84 if (frame < frameContext.frame)
85 LOG(
FCQueue, Fatal) <<
"Frame context for " << frame
86 <<
" has been overwritten by " 87 << frameContext.frame;
89 if (frame == 0 && !frameContext.initialised) {
99 init(frameContext, frame);
104 if (frame == frameContext.frame)
117 <<
"Obtained an uninitialised FrameContext for " << frame;
119 init(frameContext, frame);
125 void init(
FrameContext &frameContext,
const uint32_t frame)
128 frameContext.frame = frame;
129 frameContext.initialised =
true;
132 std::vector<FrameContext> contexts_;
#define LOG(category, severity)
Log a message.
Top-level libcamera namespace.
Definition: backtrace.h:17
void clear()
Clear the contexts queue.
Definition: fc_queue.h:40
A support class for managing FrameContext instances in IPA modules.
Definition: fc_queue.h:22
FCQueue(unsigned int size)
Construct a frame contexts queue of a specified size.
Definition: fc_queue.h:35
FrameContext & alloc(const uint32_t frame)
Allocate and return a FrameContext for the frame.
Definition: fc_queue.h:48
#define LOG_DECLARE_CATEGORY(name)
Declare a category of log messages.
Context for a frame.
Definition: fc_queue.h:24