summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Semkowicz via libcamera-devel <libcamera-devel@lists.libcamera.org>2022-07-13 10:43:12 +0200
committerJacopo Mondi <jacopo@jmondi.org>2022-07-14 20:12:17 +0200
commit3ed4e6881740688b418826303447f815cdd83999 (patch)
tree4dbddf8bdd53b25f2ff4a09f42da64004dbba2d2 /src
parentc04ead82ce822ef6b1d9fb4ac1e7b8a7968a5169 (diff)
ipa: rkisp1: Pass requests setting AF controls to the AF algorithm
Pass the controls set by top level API to the AF algorithm if it was enabled. Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>
Diffstat (limited to 'src')
-rw-r--r--src/ipa/rkisp1/rkisp1.cpp52
1 files changed, 50 insertions, 2 deletions
diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
index 01bb54fb..53b53f12 100644
--- a/src/ipa/rkisp1/rkisp1.cpp
+++ b/src/ipa/rkisp1/rkisp1.cpp
@@ -28,6 +28,7 @@
#include "libcamera/internal/mapped_framebuffer.h"
#include "libcamera/internal/yaml_parser.h"
+#include "algorithms/af.h"
#include "algorithms/agc.h"
#include "algorithms/algorithm.h"
#include "algorithms/awb.h"
@@ -295,9 +296,56 @@ void IPARkISP1::unmapBuffers(const std::vector<unsigned int> &ids)
}
void IPARkISP1::queueRequest([[maybe_unused]] const uint32_t frame,
- [[maybe_unused]] const ControlList &controls)
+ const ControlList &controls)
{
- /* \todo Start processing for 'frame' based on 'controls'. */
+ using namespace algorithms;
+
+ for (auto const &ctrl : controls) {
+ unsigned int ctrlEnum = ctrl.first;
+ const ControlValue &ctrlValue = ctrl.second;
+
+ LOG(IPARkISP1, Debug) << "Request ctrl: "
+ << controls::controls.at(ctrlEnum)->name()
+ << " = " << ctrlValue.toString();
+
+ switch (ctrlEnum) {
+ case controls::AF_MODE: {
+ Af *af = getAlgorithm<Af>();
+ if (!af) {
+ LOG(IPARkISP1, Warning) << "Could not set AF_MODE - no AF algorithm";
+ break;
+ }
+
+ af->setMode(static_cast<controls::AfModeEnum>(ctrlValue.get<int32_t>()));
+ break;
+ }
+ case controls::AF_TRIGGER: {
+ Af *af = getAlgorithm<Af>();
+ if (!af) {
+ LOG(IPARkISP1, Warning) << "Could not set AF_TRIGGER - no AF algorithm";
+ break;
+ }
+
+ af->setTrigger(static_cast<controls::AfTriggerEnum>(ctrlValue.get<int32_t>()));
+ break;
+ }
+ case controls::AF_PAUSE: {
+ Af *af = getAlgorithm<Af>();
+ if (!af) {
+ LOG(IPARkISP1, Warning) << "Could not set AF_TRIGGER - no AF algorithm";
+ break;
+ }
+
+ af->setPause(static_cast<controls::AfPauseEnum>(ctrlValue.get<int32_t>()));
+ break;
+ }
+ default:
+ LOG(IPARkISP1, Warning)
+ << "Ctrl " << controls::controls.at(ctrlEnum)->name()
+ << " is not handled.";
+ break;
+ }
+ }
}
void IPARkISP1::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId)