[libcamera-devel] [RFC PATCH 07/14] android: Plumb AeLock control

Paul Elder paul.elder at ideasonboard.com
Fri Jun 18 12:33:44 CEST 2021


Plumb the AeLock control into the HAL for
CONTROL_AE_LOCK_AVAILABLE_MODES for static metadata.

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

---
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 3446cdb6..3add5bc6 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -1010,6 +1010,14 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()
 				  sceneModesOverride);
 
 	uint8_t aeLockAvailable = ANDROID_CONTROL_AE_LOCK_AVAILABLE_FALSE;
+	const auto &aeLockInfo = controlsInfo.find(&controls::AeLock);
+	if (aeLockInfo != controlsInfo.end()) {
+		aeLockAvailable = aeLockInfo->second.max().get<bool>();
+	}
+	if (!aeLockAvailable) {
+		capabilities[ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE] = false;
+		capabilities[ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR] = false;
+	}
 	staticMetadata_->addEntry(ANDROID_CONTROL_AE_LOCK_AVAILABLE,
 				  aeLockAvailable);
 
-- 
2.27.0



More information about the libcamera-devel mailing list