diff options
author | Jacopo Mondi <jacopo@jmondi.org> | 2020-10-08 16:47:36 +0200 |
---|---|---|
committer | Jacopo Mondi <jacopo@jmondi.org> | 2020-10-26 17:51:56 +0100 |
commit | 2c61850e120bd23effd88cc2529ebb0974d3af3a (patch) | |
tree | 4a1096f33d78b9d7c579d86c6cef07fb58664f44 /src | |
parent | 63336863c99098989f13aea67b29a28f75e7ca2b (diff) |
android: camera_device: Handle LENS_SHADING_MAP_MODES
Register the ANDROID_STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES
static metadata property inspecting the values retuned by the pipeline
handler.
Add one entry and reserve in static metadata pack enough space to
support all the 2 available lens shading map modes Android defines.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/android/camera_device.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index af4ce301..ca60f513 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -552,8 +552,8 @@ std::tuple<uint32_t, uint32_t> CameraDevice::calculateStaticMetadataSize() * \todo Keep this in sync with the actual number of entries. * Currently: 51 entries, 687 bytes of static metadata */ - uint32_t numEntries = 51; - uint32_t byteSize = 693; + uint32_t numEntries = 52; + uint32_t byteSize = 694; /* * Calculate space occupation in bytes for dynamically built metadata @@ -781,6 +781,19 @@ const camera_metadata_t *CameraDevice::getStaticMetadata() staticMetadata_->addEntry(ANDROID_STATISTICS_INFO_MAX_FACE_COUNT, &maxFaceCount, 1); + { + std::vector<uint8_t> data(2); + const auto &infoMap = controlsInfo.find(&controls::draft::LensShadingMapMode); + if (infoMap != controlsInfo.end()) { + for (const auto &value : infoMap->second.values()) + data.push_back(value.get<int32_t>()); + } else { + data.push_back(ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF); + } + staticMetadata_->addEntry(ANDROID_STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES, + data.data(), data.size()); + } + /* Sync static metadata. */ int32_t maxLatency = ANDROID_SYNC_MAX_LATENCY_UNKNOWN; staticMetadata_->addEntry(ANDROID_SYNC_MAX_LATENCY, &maxLatency, 1); |