@@ -172,6 +172,8 @@ void Awb::queueRequest(IPAContext &context,
awbAlgo_->handleControls(controls);
frameContext.awb.autoEnabled = awb.autoEnabled;
+ frameContext.awb.gains = awb.automatic.gains;
+ frameContext.awb.temperatureK = awb.automatic.temperatureK;
if (awb.autoEnabled)
return;
@@ -214,6 +214,8 @@ struct IPAFrameContext : public FrameContext {
double strength;
double gain;
} wdr;
+
+ bool initialised;
};
struct IPAContext {
@@ -343,6 +343,10 @@ void IPARkISP1::initializeFrameContext(const uint32_t frame,
IPAFrameContext &frameContext,
const ControlList &controls)
{
+ if (frameContext.initialised)
+ return;
+
+ frameContext.initialised = true;
for (auto const &a : algorithms()) {
Algorithm *algo = static_cast<Algorithm *>(a.get());
if (algo->disabled_)
@@ -354,6 +358,7 @@ void IPARkISP1::initializeFrameContext(const uint32_t frame,
void IPARkISP1::computeParams(const uint32_t frame, const uint32_t bufferId)
{
IPAFrameContext &frameContext = context_.frameContexts.get(frame);
+ initializeFrameContext(frame, frameContext, {});
/*
* \todo: This needs discussion. In raw mode, computeParams is
@@ -383,6 +388,7 @@ void IPARkISP1::processStats(const uint32_t frame, const uint32_t bufferId,
const ControlList &sensorControls)
{
IPAFrameContext &frameContext = context_.frameContexts.get(frame);
+ initializeFrameContext(frame, frameContext, {});
/*
* In raw capture mode, the ISP is bypassed and no statistics buffer is
For per frame control we want to tick the IPA by the sensor frame sequence instead of the request frame sequence. This has the side effect that the IPA must be able to cope with situations where a frame context is required for a frame that was not queued before (computeParams is called without a corresponding request) or processStats is called for an unexpected sequence number (because a scratch buffer was used on kernel side) Prepare for that by allowing the frame context to be initialized on demand. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> --- src/ipa/rkisp1/algorithms/awb.cpp | 2 ++ src/ipa/rkisp1/ipa_context.h | 2 ++ src/ipa/rkisp1/rkisp1.cpp | 6 ++++++ 3 files changed, 10 insertions(+)