summaryrefslogtreecommitdiff
path: root/src/ipa/rkisp1
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipa/rkisp1')
-rw-r--r--src/ipa/rkisp1/algorithms/agc.cpp4
-rw-r--r--src/ipa/rkisp1/algorithms/agc.h3
-rw-r--r--src/ipa/rkisp1/algorithms/awb.cpp3
-rw-r--r--src/ipa/rkisp1/algorithms/awb.h5
-rw-r--r--src/ipa/rkisp1/rkisp1.cpp17
5 files changed, 13 insertions, 19 deletions
diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp
index 04062a36..37cd10f9 100644
--- a/src/ipa/rkisp1/algorithms/agc.cpp
+++ b/src/ipa/rkisp1/algorithms/agc.cpp
@@ -283,12 +283,14 @@ double Agc::measureBrightness(const rkisp1_cif_isp_hist_stat *hist) const
* \param[in] frame The frame context sequence number
* \param[in] frameContext The current frame context
* \param[in] stats The RKISP1 statistics and ISP results
+ * \param[out] metadata Metadata for the frame, to be filled by the algorithm
*
* Identify the current image brightness, and use that to estimate the optimal
* new exposure and gain for the scene.
*/
void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,
- IPAFrameContext &frameContext, const rkisp1_stat_buffer *stats)
+ IPAFrameContext &frameContext, const rkisp1_stat_buffer *stats,
+ [[maybe_unused]] ControlList &metadata)
{
/*
* \todo Verify that the exposure and gain applied by the sensor for
diff --git a/src/ipa/rkisp1/algorithms/agc.h b/src/ipa/rkisp1/algorithms/agc.h
index 9ad5c32f..da4d2d4e 100644
--- a/src/ipa/rkisp1/algorithms/agc.h
+++ b/src/ipa/rkisp1/algorithms/agc.h
@@ -31,7 +31,8 @@ public:
rkisp1_params_cfg *params) override;
void process(IPAContext &context, const uint32_t frame,
IPAFrameContext &frameContext,
- const rkisp1_stat_buffer *stats) override;
+ const rkisp1_stat_buffer *stats,
+ ControlList &metadata) override;
private:
void computeExposure(IPAContext &Context, IPAFrameContext &frameContext,
diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp
index 3349948a..f597ded8 100644
--- a/src/ipa/rkisp1/algorithms/awb.cpp
+++ b/src/ipa/rkisp1/algorithms/awb.cpp
@@ -208,7 +208,8 @@ void Awb::queueRequest(IPAContext &context,
void Awb::process(IPAContext &context,
[[maybe_unused]] const uint32_t frame,
IPAFrameContext &frameContext,
- const rkisp1_stat_buffer *stats)
+ const rkisp1_stat_buffer *stats,
+ [[maybe_unused]] ControlList &metadata)
{
const rkisp1_cif_isp_stat *params = &stats->params;
const rkisp1_cif_isp_awb_stat *awb = &params->awb;
diff --git a/src/ipa/rkisp1/algorithms/awb.h b/src/ipa/rkisp1/algorithms/awb.h
index d76b5382..f5633b11 100644
--- a/src/ipa/rkisp1/algorithms/awb.h
+++ b/src/ipa/rkisp1/algorithms/awb.h
@@ -27,8 +27,9 @@ public:
IPAFrameContext &frameContext,
const ControlList &controls) override;
void process(IPAContext &context, const uint32_t frame,
- IPAFrameContext &frameCtx,
- const rkisp1_stat_buffer *stats) override;
+ IPAFrameContext &frameContext,
+ const rkisp1_stat_buffer *stats,
+ ControlList &metadata) override;
private:
uint32_t estimateCCT(double red, double green, double blue);
diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
index ba3c547e..494d8c89 100644
--- a/src/ipa/rkisp1/rkisp1.cpp
+++ b/src/ipa/rkisp1/rkisp1.cpp
@@ -69,7 +69,6 @@ protected:
private:
void setControls(unsigned int frame);
- void prepareMetadata(unsigned int frame, unsigned int aeState);
std::map<unsigned int, FrameBuffer> buffers_;
std::map<unsigned int, MappedFrameBuffer> mappedBuffers_;
@@ -338,14 +337,14 @@ void IPARkISP1::processStatsBuffer(const uint32_t frame, const uint32_t bufferId
frameContext.sensor.gain =
camHelper_->gain(sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get<int32_t>());
- unsigned int aeState = 0;
+ ControlList metadata(controls::controls);
for (auto const &algo : algorithms())
- algo->process(context_, frame, frameContext, stats);
+ algo->process(context_, frame, frameContext, stats, metadata);
setControls(frame);
- prepareMetadata(frame, aeState);
+ metadataReady.emit(frame, metadata);
}
void IPARkISP1::setControls(unsigned int frame)
@@ -366,16 +365,6 @@ void IPARkISP1::setControls(unsigned int frame)
setSensorControls.emit(frame, ctrls);
}
-void IPARkISP1::prepareMetadata(unsigned int frame, unsigned int aeState)
-{
- ControlList ctrls(controls::controls);
-
- if (aeState)
- ctrls.set(controls::AeLocked, aeState == 2);
-
- metadataReady.emit(frame, ctrls);
-}
-
} /* namespace ipa::rkisp1 */
/*