diff options
author | Jacopo Mondi <jacopo.mondi@ideasonboard.com> | 2024-10-16 17:20:43 +0200 |
---|---|---|
committer | Jacopo Mondi <jacopo.mondi@ideasonboard.com> | 2024-10-16 17:38:17 +0200 |
commit | 3b025c639f6d2b7d5d49e4e38feec7abc6e80344 (patch) | |
tree | 4247dbf020435636435c72ec0f6b8f99094ca9cd /src/ipa/rkisp1/algorithms | |
parent | 34a147315ca7929ca5c553ec8f61fead70e83f48 (diff) |
ipa: rkisp1: Initialize FrameContext.agc.meteringModepfc/rkisp1-free-run
The RkISP1 AGC algorithms assumes the metering mode to be
"MeteringMatrix" and pre-fill an array of weights associated
with it stored in meteringModes_[MeteringMatrix] when intializing
the algorithm in parseMeteringModes().
It laters fetches the weights when computing parameters using the
FrameContext.agc.meteringMode as index of the meteringModes_ array.
When a Request gets queued to the algorithm, the
FrameContext.agc.meteringMode index is populated from the algorithm's
active state, and optionally updated if the application has specified
a different metering mode.
In case of Request underrun however, a non-initialized FrameContext
gets provided to the algorithm, causing an (unhandled) exception when
accessing the meteringModes_ array.
Fix this by intializing the AGC metering mode to a supported value
coming from the ActiveState in IPAFrameContext::init().
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Diffstat (limited to 'src/ipa/rkisp1/algorithms')
-rw-r--r-- | src/ipa/rkisp1/algorithms/agc.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp index 17d074d9..dd7e9468 100644 --- a/src/ipa/rkisp1/algorithms/agc.cpp +++ b/src/ipa/rkisp1/algorithms/agc.cpp @@ -175,6 +175,8 @@ int Agc::configure(IPAContext &context, const IPACameraSensorInfo &configInfo) static_cast<controls::AeConstraintModeEnum>(constraintModes().begin()->first); context.activeState.agc.exposureMode = static_cast<controls::AeExposureModeEnum>(exposureModeHelpers().begin()->first); + + /* Use the metering matrix mode by default. */ context.activeState.agc.meteringMode = static_cast<controls::AeMeteringModeEnum>(meteringModes_.begin()->first); |