@@ -491,10 +491,11 @@ void IpaBase::prepareIsp(const PrepareParams ¶ms)
void IpaBase::processStats(const ProcessParams ¶ms)
{
unsigned int ipaContext = params.ipaContext % rpiMetadata_.size();
+ RPiController::Metadata &rpiMetadata = rpiMetadata_[ipaContext];
- if (processPending_ && frameCount_ >= mistrustCount_) {
- RPiController::Metadata &rpiMetadata = rpiMetadata_[ipaContext];
+ Duration offset(0s);
+ if (processPending_ && frameCount_ >= mistrustCount_) {
auto it = buffers_.find(params.buffers.stats);
if (it == buffers_.end()) {
LOG(IPARPI, Error) << "Could not find stats buffer!";
@@ -510,7 +511,6 @@ void IpaBase::processStats(const ProcessParams ¶ms)
controller_.process(statistics, &rpiMetadata);
/* Send any sync algorithm outputs back to the pipeline handler */
- Duration offset(0s);
struct SyncStatus syncStatus;
if (rpiMetadata.get("sync.status", syncStatus) == 0) {
if (minFrameDuration_ != maxFrameDuration_)
@@ -522,14 +522,14 @@ void IpaBase::processStats(const ProcessParams ¶ms)
if (syncStatus.timerKnown)
libcameraMetadata_.set(controls::rpi::SyncTimer, syncStatus.timerValue);
}
+ }
- struct AgcStatus agcStatus;
- if (rpiMetadata.get("agc.status", agcStatus) == 0) {
- ControlList ctrls(sensorCtrls_);
- applyAGC(&agcStatus, ctrls, offset);
- setDelayedControls.emit(ctrls, ipaContext);
- setCameraTimeoutValue();
- }
+ struct AgcStatus agcStatus;
+ if (rpiMetadata.get("agc.status", agcStatus) == 0) {
+ ControlList ctrls(sensorCtrls_);
+ applyAGC(&agcStatus, ctrls, offset);
+ setDelayedControls.emit(ctrls, ipaContext);
+ setCameraTimeoutValue();
}
/*
The delay context counter must be advanced even when we decide not to run prepare/process. Otherwise, when we skip them at higher framerates, the current IPA context counter will catch up and overwrite the delay context. It's safe to advance the counter because the metadata is always copied forward a slot when we decide not to run the IPAs. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> --- src/ipa/rpi/common/ipa_base.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)