[1/5] libcamera: control_ids_draft: Add flash controls
diff mbox series

Message ID 20250828-flash-support-v1-1-4c5dc674a05b@emfend.at
State New
Headers show
Series
  • Support for v4l2 flash devices
Related show

Commit Message

Matthias Fend Aug. 28, 2025, 1:09 p.m. UTC
Define a set of controls to control camera flash devices.

Signed-off-by: Matthias Fend <matthias.fend@emfend.at>
---
 src/libcamera/control_ids_draft.yaml | 69 ++++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)

Comments

Kieran Bingham Aug. 30, 2025, 10:21 a.m. UTC | #1
Quoting Matthias Fend (2025-08-28 14:09:38)
> Define a set of controls to control camera flash devices.
> 
> Signed-off-by: Matthias Fend <matthias.fend@emfend.at>
> ---
>  src/libcamera/control_ids_draft.yaml | 69 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 69 insertions(+)
> 
> diff --git a/src/libcamera/control_ids_draft.yaml b/src/libcamera/control_ids_draft.yaml
> index 03309eeac34fa76eee4bb5d1c87d6467b890c9a7..c10b774bfd59b26980475bb9706fffa6961b3b1b 100644
> --- a/src/libcamera/control_ids_draft.yaml
> +++ b/src/libcamera/control_ids_draft.yaml

Please target real controls not draft controls. We should really try to
remove this draft file...


> @@ -294,4 +294,73 @@ controls:
>          Currently identical to ANDROID_STATISTICS_FACE_IDS.
>        size: [n]
>  
> +  - FlashMode:
> +      type: int32_t
> +      direction: inout
> +      description: |
> +        Flash mode.
> +      enum:
> +        - name: FlashModeNone
> +          value: 0
> +          description: |
> +            None.
> +        - name: FlashModeFlash
> +          value: 1
> +          description: |
> +            Flash.
> +        - name: FlashModeTorch
> +          value: 2
> +          description: |
> +            Torch.

And I think we could expand all of those descriptions somehow.

> +
> +  - FlashIntensity:
> +      type: int32_t
> +      direction: inout
> +      description: |
> +        Flash intensity in mA.
> +
> +  - FlashTimeout:
> +      type: int32_t
> +      direction: inout
> +      description: |
> +        Flash timeout in us.
> +
> +  - FlashStrobeSource:
> +      type: int32_t
> +      direction: inout
> +      description: |
> +        Flash mode.

Flash mode ? Or Flash source?

With all the descriptions expanded, these can target mainline controls.
No need to go to draft.

We'll need to convey relationships in the documentation too.. like
perhaps it could be documented how FlashTimeout I suspect interacts only
with FlashStrobeSourceSoftware ? ...


> +      enum:
> +        - name: FlashStrobeSourceSoftware
> +          value: 0
> +          description: |
> +            Software.
> +        - name: FlashStrobeSourceExternal
> +          value: 1
> +          description: |
> +            External.
> +
> +  - FlashStrobe:
> +      type: int32_t
> +      direction: in
> +      description: |
> +        Start/stop flash strobe.
> +
> +      enum:
> +        - name: FlashStrobeStart
> +          value: 0
> +          description: |
> +            Start flash strobe.
> +
> +        - name: FlashStrobeStop
> +          value: 1
> +          description: |
> +            Stop flash strobe.
> +
> +  - FlashTorchIntensity:

Do we need this in addition to FlashIntensity ?

Will we have different intensity limits depending on the mode between
flash+torch?

> +      type: int32_t
> +      direction: inout
> +      description: |
> +        Torch intensity in mA.

I guess we get mA from the kernel drivers?

> +
>  ...
> 
> -- 
> 2.34.1
>

Patch
diff mbox series

diff --git a/src/libcamera/control_ids_draft.yaml b/src/libcamera/control_ids_draft.yaml
index 03309eeac34fa76eee4bb5d1c87d6467b890c9a7..c10b774bfd59b26980475bb9706fffa6961b3b1b 100644
--- a/src/libcamera/control_ids_draft.yaml
+++ b/src/libcamera/control_ids_draft.yaml
@@ -294,4 +294,73 @@  controls:
         Currently identical to ANDROID_STATISTICS_FACE_IDS.
       size: [n]
 
+  - FlashMode:
+      type: int32_t
+      direction: inout
+      description: |
+        Flash mode.
+      enum:
+        - name: FlashModeNone
+          value: 0
+          description: |
+            None.
+        - name: FlashModeFlash
+          value: 1
+          description: |
+            Flash.
+        - name: FlashModeTorch
+          value: 2
+          description: |
+            Torch.
+
+  - FlashIntensity:
+      type: int32_t
+      direction: inout
+      description: |
+        Flash intensity in mA.
+
+  - FlashTimeout:
+      type: int32_t
+      direction: inout
+      description: |
+        Flash timeout in us.
+
+  - FlashStrobeSource:
+      type: int32_t
+      direction: inout
+      description: |
+        Flash mode.
+      enum:
+        - name: FlashStrobeSourceSoftware
+          value: 0
+          description: |
+            Software.
+        - name: FlashStrobeSourceExternal
+          value: 1
+          description: |
+            External.
+
+  - FlashStrobe:
+      type: int32_t
+      direction: in
+      description: |
+        Start/stop flash strobe.
+
+      enum:
+        - name: FlashStrobeStart
+          value: 0
+          description: |
+            Start flash strobe.
+
+        - name: FlashStrobeStop
+          value: 1
+          description: |
+            Stop flash strobe.
+
+  - FlashTorchIntensity:
+      type: int32_t
+      direction: inout
+      description: |
+        Torch intensity in mA.
+
 ...