[libcamera-devel] [PATCH 1/7] android: camera_device: Report COLOR_CORRECTION_ABERRATION_MODE
Jacopo Mondi
jacopo at jmondi.org
Wed Feb 3 17:25:54 CET 2021
The CaptureResultTest#testCameraCaptureResultAllKeys enforces the
presence of the ANDROID_COLOR_CORRECTION_ABERRATION_MODE result
metadata.
Report the only supported value of
ANDROID_COLOR_CORRECTION_ABERRATION_MODE_OFF.
Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
src/android/camera_device.cpp | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index a50b0ebfe60e..02908beb867e 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -708,7 +708,7 @@ std::tuple<uint32_t, uint32_t> CameraDevice::calculateStaticMetadataSize()
* Currently: 53 entries, 846 bytes of static metadata
*/
uint32_t numEntries = 53;
- uint32_t byteSize = 846;
+ uint32_t byteSize = 850;
/*
* Calculate space occupation in bytes for dynamically built metadata
@@ -1243,6 +1243,7 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()
availableRequestKeys.size());
std::vector<int32_t> availableResultKeys = {
+ ANDROID_COLOR_CORRECTION_ABERRATION_MODE,
ANDROID_CONTROL_AE_ANTIBANDING_MODE,
ANDROID_CONTROL_AE_LOCK,
ANDROID_CONTROL_AE_MODE,
@@ -1960,7 +1961,7 @@ CameraDevice::getResultMetadata(Camera3RequestDescriptor *descriptor,
* Total bytes for JPEG metadata: 82
*/
std::unique_ptr<CameraMetadata> resultMetadata =
- std::make_unique<CameraMetadata>(40, 156);
+ std::make_unique<CameraMetadata>(41, 157);
if (!resultMetadata->isValid()) {
LOG(HAL, Error) << "Failed to allocate static metadata";
return nullptr;
@@ -1972,7 +1973,11 @@ CameraDevice::getResultMetadata(Camera3RequestDescriptor *descriptor,
* from libcamera::Request::metadata.
*/
- uint8_t value = ANDROID_CONTROL_AE_ANTIBANDING_MODE_OFF;
+ uint8_t value = ANDROID_COLOR_CORRECTION_ABERRATION_MODE_OFF;
+ resultMetadata->addEntry(ANDROID_COLOR_CORRECTION_ABERRATION_MODE,
+ &value, 1);
+
+ value = ANDROID_CONTROL_AE_ANTIBANDING_MODE_OFF;
resultMetadata->addEntry(ANDROID_CONTROL_AE_ANTIBANDING_MODE, &value, 1);
value = ANDROID_CONTROL_AE_LOCK_OFF;
--
2.30.0
More information about the libcamera-devel
mailing list