[libcamera-devel,RFC,v3,07/16] controls: Replace AwbLocked with AwbState, and add AwbLock
diff mbox series

Message ID 20210702103800.41291-8-paul.elder@ideasonboard.com
State Superseded
Delegated to: Paul Elder
Headers show
Series
  • Preliminary FULL plumbing
Related show

Commit Message

Paul Elder July 2, 2021, 10:37 a.m. UTC
AwbLocked alone isn't sufficient for reporting the AWB state, so replace
it with AwbState. Add an AwbLock control for instructing the camera to
lock the AWB values.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>

---
No change in v3
---
 src/libcamera/control_ids.yaml | 82 ++++++++++++++++++++--------------
 1 file changed, 49 insertions(+), 33 deletions(-)

Patch
diff mbox series

diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml
index 2e62f61b..3a4f07cf 100644
--- a/src/libcamera/control_ids.yaml
+++ b/src/libcamera/control_ids.yaml
@@ -161,6 +161,55 @@  controls:
           value: 3
           description: Custom exposure mode.
 
+  - AwbLock:
+      type: bool
+      description: |
+        Control to lock the AWB values.
+        When set to true, the AWB algorithm is locked to its latest parameters,
+        and will not change exposure settings until set to false.
+        \sa AwbState
+
+  - AwbState:
+      type: int32_t
+      description: |
+        Control to report the current AWB algorithm state. Switching between or
+        enabling AWB modes (AwbMode) always resets the AwbState to
+        AwbStateInactive. The camera device can do several state transitions
+        between two results, if it is allowed by the state transition table.
+        For example, AwbStateInactive may never actually be seen in a result.
+
+        The state in the result is the state for this image (in sync with this
+        image). If AWB state becomes AwbStateConverged, then the image data
+        associated with the result should be good to use.
+
+        The state transitions mentioned below assume that AwbMode is auto.
+
+        \sa AwbLock
+      enum:
+        - name: AwbStateInactive
+          value: 0
+          description: |
+            The AWB algorithm is inactive.
+            If the camera initiates an AWB scan, the state shall go to Searching.
+            If AwbLock is on, the state shall go to Locked.
+        - name: AwbStateSearching
+          value: 1
+          description: |
+            The AWB algorithm has not converged yet.
+            If the camera finishes an AWB scan, the state shall go to Converged.
+            If AwbLock is on, the state shall go to Locked.
+        - name: AwbStateConverged
+          value: 2
+          description: |
+            The AWB algorithm has converged.
+            If the camera initiates an AWB scan, the state shall go to Searching.
+            If AwbLock is on, the state shall go to Locked.
+        - name: AwbStateLocked
+          value: 3
+          description: |
+            The AWB algorithm is locked.
+            If AwbLock is off, the state shall go to Searching.
+
   - ExposureValue:
       type: float
       description: |
@@ -272,17 +321,6 @@  controls:
           value: 10
           description: Custom AWB mode.
 
-  - AwbLocked:
-      type: bool
-      description: |
-        Report the lock status of a running AWB algorithm.
-
-        If the AWB algorithm is locked the value shall be set to true, if it's
-        converging it shall be set to false. If the AWB algorithm is not
-        running the control shall not be present in the metadata control list.
-
-        \sa AwbEnable
-
   - ColourGains:
       type: float
       description: |
@@ -572,28 +610,6 @@  controls:
           description: |
             AF has completed a passive scan without finding focus.
 
-  - AwbState:
-      type: int32_t
-      draft: true
-      description: |
-       Control to report the current AWB algorithm state. Currently identical
-       to ANDROID_CONTROL_AWB_STATE.
-
-        Current state of the AWB algorithm.
-      enum:
-        - name: AwbStateInactive
-          value: 0
-          description: The AWB algorithm is inactive.
-        - name: AwbStateSearching
-          value: 1
-          description: The AWB algorithm has not converged yet.
-        - name: AwbConverged
-          value: 2
-          description: The AWB algorithm has converged.
-        - name: AwbLocked
-          value: 3
-          description: The AWB algorithm is locked.
-
   - SensorRollingShutterSkew:
       type: int64_t
       draft: true