@@ -86,6 +86,8 @@ struct RKISP1FrameContext : public IPAFrameContext {
struct IPAContext {
IPASessionConfiguration configuration;
IPAActiveState activeState;
+
+ FCQueue<RKISP1FrameContext> frameContexts;
};
} /* namespace ipa::rkisp1 */
@@ -46,7 +46,7 @@ public:
int init(const IPASettings &settings, unsigned int hwRevision,
ControlInfoMap *ipaControls) override;
int start() override;
- void stop() override {}
+ void stop() override;
int configure(const IPACameraSensorInfo &info,
const std::map<uint32_t, IPAStream> &streamConfig,
@@ -186,6 +186,11 @@ int IPARkISP1::start()
return 0;
}
+void IPARkISP1::stop()
+{
+ context_.frameContexts.clear();
+}
+
/**
* \todo The RkISP1 pipeline currently provides an empty IPACameraSensorInfo
* if the connected sensor does not provide enough information to properly
@@ -225,7 +230,8 @@ int IPARkISP1::configure([[maybe_unused]] const IPACameraSensorInfo &info,
<< "Exposure: " << minExposure << "-" << maxExposure
<< " Gain: " << minGain << "-" << maxGain;
- /* Clean context at configuration */
+ /* Clear the IPA context before the streaming session. */
+ context_.frameContexts.clear();
context_ = {};
/* Set the hardware revision for the algorithms. */
@@ -312,6 +318,8 @@ void IPARkISP1::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId)
void IPARkISP1::processStatsBuffer(const uint32_t frame, const uint32_t bufferId,
const ControlList &sensorControls)
{
+ RKISP1FrameContext &frameContext = context_.frameContexts.get(frame);
+
const rkisp1_stat_buffer *stats =
reinterpret_cast<rkisp1_stat_buffer *>(
mappedBuffers_.at(bufferId).planes()[0].data());
@@ -323,9 +331,6 @@ void IPARkISP1::processStatsBuffer(const uint32_t frame, const uint32_t bufferId
unsigned int aeState = 0;
- /* \todo Obtain the frame context to pass to process from the FCQueue */
- RKISP1FrameContext frameContext;
-
for (auto const &algo : algorithms())
algo->process(context_, frameContext, stats);