@@ -12,6 +12,7 @@
#include <libcamera/control_ids.h>
#include <libcamera/formats.h>
#include <libcamera/geometry.h>
+#include <libcamera/request.h>
#include <libcamera/stream.h>
#include "libcamera/internal/camera_sensor.h"
@@ -289,6 +290,20 @@ FrameBuffer *CIO2Device::queueBuffer(Request *request, FrameBuffer *rawBuffer)
buffer->setRequest(request);
}
+ if (request->controls().contains(controls::draft::TestPatternMode)) {
+ const uint8_t testPatternMode =
+ static_cast<uint8_t>(request->controls().get(
+ controls::draft::TestPatternMode));
+ int ret = sensor_->setTestPatternMode(testPatternMode);
+ if (ret) {
+ LOG(IPU3, Error)
+ << "Failed to set test pattern mode: " << ret;
+ } else {
+ request->metadata().set(controls::draft::TestPatternMode,
+ testPatternMode);
+ }
+ }
+
int ret = output_->queueBuffer(buffer);
if (ret)
return nullptr;
Apply a camera sensor a requested test pattern mode. The test pattern mode can be specified per frame. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> --- src/libcamera/pipeline/ipu3/cio2.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+)