[v2] libcamera: pipeline: uvcvideo: Report new AeEnable control as available
diff mbox series

Message ID 20250402151158.968707-1-barnabas.pocze@ideasonboard.com
State New
Headers show
Series
  • [v2] libcamera: pipeline: uvcvideo: Report new AeEnable control as available
Related show

Commit Message

Barnabás Pőcze April 2, 2025, 3:11 p.m. UTC
The `AeEnable` control is handled by the `Camera` class directly, but it
still has to be added because `ControlInfoMap`s are not easily modifiable.

See 338ba00e7abfe8 ("ipa: rkisp1: agc: Report new AeEnable control as available")
for more details and a similar change in rkisp1.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
---
changes in v2:
  * only report control if it can actually do something

v1: https://patchwork.libcamera.org/patch/23106/
---
 src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 5 +++++
 1 file changed, 5 insertions(+)

--
2.49.0

Comments

Laurent Pinchart April 2, 2025, 3:54 p.m. UTC | #1
On Wed, Apr 02, 2025 at 05:11:58PM +0200, Barnabás Pőcze wrote:
> The `AeEnable` control is handled by the `Camera` class directly, but it
> still has to be added because `ControlInfoMap`s are not easily modifiable.
> 
> See 338ba00e7abfe8 ("ipa: rkisp1: agc: Report new AeEnable control as available")
> for more details and a similar change in rkisp1.
> 
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> changes in v2:
>   * only report control if it can actually do something
> 
> v1: https://patchwork.libcamera.org/patch/23106/
> ---
>  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
> index 5adc89fdb..a7e0fcfbc 100644
> --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
> +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
> @@ -590,6 +590,11 @@ int UVCCameraData::init(MediaDevice *media)
>  		addControl(cid, info, &ctrls);
>  	}
> 
> +	if (autoExposureMode_ && manualExposureMode_) {
> +		/* \todo Move this to the Camera class */
> +		ctrls[&controls::AeEnable] = ControlInfo(false, true, true);
> +	}
> +
>  	controlInfo_ = ControlInfoMap(std::move(ctrls), controls::controls);
> 
>  	/*
Kieran Bingham April 2, 2025, 4:03 p.m. UTC | #2
Quoting Barnabás Pőcze (2025-04-02 16:11:58)
> The `AeEnable` control is handled by the `Camera` class directly, but it
> still has to be added because `ControlInfoMap`s are not easily modifiable.
> 
> See 338ba00e7abfe8 ("ipa: rkisp1: agc: Report new AeEnable control as available")
> for more details and a similar change in rkisp1.
> 
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> ---
> changes in v2:
>   * only report control if it can actually do something

That was my only worry on v1!

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> 
> v1: https://patchwork.libcamera.org/patch/23106/
> ---
>  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
> index 5adc89fdb..a7e0fcfbc 100644
> --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
> +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
> @@ -590,6 +590,11 @@ int UVCCameraData::init(MediaDevice *media)
>                 addControl(cid, info, &ctrls);
>         }
> 
> +       if (autoExposureMode_ && manualExposureMode_) {
> +               /* \todo Move this to the Camera class */
> +               ctrls[&controls::AeEnable] = ControlInfo(false, true, true);
> +       }
> +
>         controlInfo_ = ControlInfoMap(std::move(ctrls), controls::controls);
> 
>         /*
> --
> 2.49.0

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
index 5adc89fdb..a7e0fcfbc 100644
--- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
+++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
@@ -590,6 +590,11 @@  int UVCCameraData::init(MediaDevice *media)
 		addControl(cid, info, &ctrls);
 	}

+	if (autoExposureMode_ && manualExposureMode_) {
+		/* \todo Move this to the Camera class */
+		ctrls[&controls::AeEnable] = ControlInfo(false, true, true);
+	}
+
 	controlInfo_ = ControlInfoMap(std::move(ctrls), controls::controls);

 	/*