[libcamera-devel] [RFC PATCH v4 13/21] android: Plumb AeEnable control
Paul Elder
paul.elder at ideasonboard.com
Fri Jul 16 12:56:23 CEST 2021
Plumb the AeEnable control into the HAL for CONTROL_AE_AVAILABLE_MODES
for static metadata, and CONTROL_AE_MODE for result metadata.
Bug: https://bugs.libcamera.org/show_bug.cgi?id=42
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 | 10 +++++-----
src/android/camera_device.cpp | 9 +++++++--
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp
index c333b329..fe81c665 100644
--- a/src/android/camera_capabilities.cpp
+++ b/src/android/camera_capabilities.cpp
@@ -818,11 +818,11 @@ int CameraCapabilities::initializeStaticMetadata()
staticMetadata_->addEntry(ANDROID_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES,
aeAvailableAntiBandingModes);
- std::vector<uint8_t> aeAvailableModes = {
- ANDROID_CONTROL_AE_MODE_ON,
- };
- staticMetadata_->addEntry(ANDROID_CONTROL_AE_AVAILABLE_MODES,
- aeAvailableModes);
+ setMetadata<uint8_t, bool>(
+ staticMetadata_.get(),
+ ANDROID_CONTROL_AE_AVAILABLE_MODES,
+ controlsInfo, &controls::AeEnable,
+ { ANDROID_CONTROL_AE_MODE_ON });
int64_t minFrameDurationNsec = -1;
int64_t maxFrameDurationNsec = -1;
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 692d0a5b..98a73b37 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -781,6 +781,9 @@ int CameraDevice::processControls(Camera3RequestDescriptor *descriptor)
controls.set(controls::ScalerCrop, cropRegion);
}
+ if (settings.getEntry(ANDROID_CONTROL_AE_MODE, &entry))
+ controls.set(controls::AeEnable, *entry.data.u8);
+
return 0;
}
@@ -1205,8 +1208,10 @@ CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor) cons
value = ANDROID_CONTROL_AE_LOCK_OFF;
resultMetadata->addEntry(ANDROID_CONTROL_AE_LOCK, value);
- value = ANDROID_CONTROL_AE_MODE_ON;
- resultMetadata->addEntry(ANDROID_CONTROL_AE_MODE, value);
+ if (metadata.contains(controls::AeEnable)) {
+ uint8_t aeMode = metadata.get<bool>(controls::AeEnable);
+ resultMetadata->addEntry(ANDROID_CONTROL_AE_MODE, aeMode);
+ }
if (settings.getEntry(ANDROID_CONTROL_AE_TARGET_FPS_RANGE, &entry))
/*
--
2.27.0
More information about the libcamera-devel
mailing list