[libcamera-devel,RFC,09/14] android: Plumb AwbLock control
diff mbox series

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

Commit Message

Paul Elder June 18, 2021, 10:33 a.m. UTC
Plumb the AwbLock control into the HAL for
CONTROL_AWB_LOCK_AVAILABLE_MODES for static metadata.

Bug: https://bugs.libcamera.org/show_bug.cgi?id=45
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>

---
TODO: plumb result metadata
---
 src/android/camera_device.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Laurent Pinchart June 28, 2021, 1:47 a.m. UTC | #1
Hi Paul,

Thank you for the patch.

On Fri, Jun 18, 2021 at 07:33:46PM +0900, Paul Elder wrote:
> Plumb the AwbLock control into the HAL for
> CONTROL_AWB_LOCK_AVAILABLE_MODES for static metadata.
> 
> Bug: https://bugs.libcamera.org/show_bug.cgi?id=45
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>

Same comments as for AeLock, with the same

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

once addressed.

> ---
> TODO: plumb result metadata
> ---
>  src/android/camera_device.cpp | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index a8b6fa38..e89afbb1 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -1032,6 +1032,14 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()
>  				  aeLockAvailable);
>  
>  	uint8_t awbLockAvailable = ANDROID_CONTROL_AWB_LOCK_AVAILABLE_FALSE;
> +	const auto &awbLockInfo = controlsInfo.find(&controls::AwbLock);
> +	if (awbLockInfo != controlsInfo.end()) {
> +		awbLockAvailable = awbLockInfo->second.max().get<bool>();
> +	}
> +	if (!awbLockAvailable) {
> +		capabilities[ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE] = false;
> +		capabilities[ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING] = false;
> +	}
>  	staticMetadata_->addEntry(ANDROID_CONTROL_AWB_LOCK_AVAILABLE,
>  				  awbLockAvailable);
>

Patch
diff mbox series

diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index a8b6fa38..e89afbb1 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -1032,6 +1032,14 @@  const camera_metadata_t *CameraDevice::getStaticMetadata()
 				  aeLockAvailable);
 
 	uint8_t awbLockAvailable = ANDROID_CONTROL_AWB_LOCK_AVAILABLE_FALSE;
+	const auto &awbLockInfo = controlsInfo.find(&controls::AwbLock);
+	if (awbLockInfo != controlsInfo.end()) {
+		awbLockAvailable = awbLockInfo->second.max().get<bool>();
+	}
+	if (!awbLockAvailable) {
+		capabilities[ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE] = false;
+		capabilities[ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING] = false;
+	}
 	staticMetadata_->addEntry(ANDROID_CONTROL_AWB_LOCK_AVAILABLE,
 				  awbLockAvailable);