[libcamera-devel,10/10] test: af: Introduce a capture script test file
diff mbox series

Message ID 20220613142853.98484-11-jeanmichel.hautbois@ideasonboard.com
State New
Headers show
Series
  • ipa: raspberrypi: Introduce an autofocus algorithm
Related show

Commit Message

Jean-Michel Hautbois June 13, 2022, 2:28 p.m. UTC
When testing the autofocus state machine, it is useful to know which
state is expected for a given frame. Introduce a yaml file to set the AF
controls at given points in time to ease debugging the state machine

Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
---
 test/af/af-state-machine.yaml | 46 +++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 test/af/af-state-machine.yaml

Patch
diff mbox series

diff --git a/test/af/af-state-machine.yaml b/test/af/af-state-machine.yaml
new file mode 100644
index 00000000..54da3fe2
--- /dev/null
+++ b/test/af/af-state-machine.yaml
@@ -0,0 +1,46 @@ 
+# SPDX-License-Identifier: CC0-1.0
+
+# AF controls test script
+#
+# A capture script allows to associate a list of AF controls and their values
+# to frame numbers.
+
+# Manual mode
+# State should be AfStateIdle
+# We can still change LensPosition
+frames:
+  - 1:
+      AfMode: 0
+      LensPosition: 0.0
+
+  - 5:
+      LensPosition: 100.0
+
+  - 10:
+      LensPosition: 500.0
+
+  - 15:
+      LensPosition: 0.0
+
+  - 50:
+# Change to continuous mode
+# State should immediately be AfStateScanning
+# The algorithm should start a scan
+# It will settle on AfStateFocused or AfStateFailed
+      AfMode: 2
+
+  - 80:
+# Change to auto mode
+# The Lens or state should not change until AfTrigger is received
+# Entering this mode will report AfStateIdle
+      AfMode: 1
+  - 90:
+# Start the scan
+      AfTrigger: 0
+        #  - 110:
+#Cancel the scan
+      AfTrigger: 1
+
+  - 100:
+# Switch back to continuous
+      AfMode: 2