[libcamera-devel] [RFC PATCH v4 16/21] android: Plumb AwbLock control
Paul Elder
paul.elder at ideasonboard.com
Fri Jul 16 12:56:26 CEST 2021
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 at ideasonboard.com>
TODO: check templates
---
Changes in v4:
- remove capability check
- plumb into processControls
Changes in v3:
- use new setMetadata
- rebase on camera capabilities refactor
---
src/android/camera_capabilities.cpp | 9 ++++++---
src/android/camera_device.cpp | 9 +++++++--
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp
index 85c39498..8ec4d014 100644
--- a/src/android/camera_capabilities.cpp
+++ b/src/android/camera_capabilities.cpp
@@ -937,9 +937,12 @@ int CameraCapabilities::initializeStaticMetadata()
ControlRange::Max,
ANDROID_CONTROL_AE_LOCK_AVAILABLE_FALSE);
- uint8_t awbLockAvailable = ANDROID_CONTROL_AWB_LOCK_AVAILABLE_FALSE;
- staticMetadata_->addEntry(ANDROID_CONTROL_AWB_LOCK_AVAILABLE,
- awbLockAvailable);
+ setMetadata<uint8_t, bool>(
+ staticMetadata_.get(),
+ ANDROID_CONTROL_AWB_LOCK_AVAILABLE,
+ controlsInfo, &controls::AwbLock,
+ ControlRange::Max,
+ ANDROID_CONTROL_AWB_LOCK_AVAILABLE_FALSE);
char availableControlModes = ANDROID_CONTROL_MODE_AUTO;
staticMetadata_->addEntry(ANDROID_CONTROL_AVAILABLE_MODES,
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 8a9abd34..09ecbd59 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -790,6 +790,9 @@ int CameraDevice::processControls(Camera3RequestDescriptor *descriptor)
if (settings.getEntry(ANDROID_CONTROL_AWB_MODE, &entry))
controls.set(controls::AwbMode, *entry.data.u8);
+ if (settings.getEntry(ANDROID_CONTROL_AWB_LOCK, &entry))
+ controls.set(controls::AwbLock, *entry.data.u8);
+
return 0;
}
@@ -1252,8 +1255,10 @@ CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor) cons
resultMetadata->addEntry(ANDROID_CONTROL_AWB_MODE, awbMode);
}
- value = ANDROID_CONTROL_AWB_LOCK_OFF;
- resultMetadata->addEntry(ANDROID_CONTROL_AWB_LOCK, value);
+ if (metadata.contains(controls::AwbLock)) {
+ uint8_t awbLock = metadata.get<bool>(controls::AwbLock);
+ resultMetadata->addEntry(ANDROID_CONTROL_AWB_LOCK, awbLock);
+ }
value = ANDROID_CONTROL_AWB_STATE_CONVERGED;
resultMetadata->addEntry(ANDROID_CONTROL_AWB_STATE, value);
--
2.27.0
More information about the libcamera-devel
mailing list