@@ -555,8 +555,7 @@ void IPAIPU3::setControls(unsigned int frame)
frameContext.agc.exposure, frameContext.agc.gain);
ControlList lensCtrls(lensCtrls_);
- lensCtrls.set(V4L2_CID_FOCUS_ABSOLUTE,
- static_cast<int32_t>(context_.activeState.af.focus));
+ af::prepareControls(lensCtrls, context_.activeState.af.focus);
setSensorControls.emit(frame, ctrls, lensCtrls);
}
@@ -7,6 +7,8 @@
#pragma once
+#include <linux/v4l2-controls.h>
+
#include <libcamera/base/log.h>
#include <libcamera/control_ids.h>
@@ -25,6 +27,11 @@ struct ActiveState {
bool stable;
};
+inline void prepareControls(ControlList &controls, int32_t focus)
+{
+ controls.set(V4L2_CID_FOCUS_ABSOLUTE, focus);
+}
+
} /* namespace af */
class AfAlgorithm
Similarly to what other algorithms do, let's add a control initialisation function to the libipa autofocus algorithm and use it in ipu3 IPA. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> --- src/ipa/ipu3/ipu3.cpp | 3 +-- src/ipa/libipa/af.h | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-)