summaryrefslogtreecommitdiff
path: root/src/android
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2020-10-08 16:18:26 +0200
committerJacopo Mondi <jacopo@jmondi.org>2020-10-26 17:51:56 +0100
commit63336863c99098989f13aea67b29a28f75e7ca2b (patch)
treea477761608180c14fe9c704eb9aa4345ff7055b2 /src/android
parent0b5fecc74651cf3c4f551062f576bffbd1545d79 (diff)
android: camera_device: Handle COLOR_CORRECTION_ABERRATION_MODE
Register the ANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES static metadata property inspecting the values retuned by the pipeline handler. Reserve in the static metadata pack enough space to support all the 3 available color correction aberration 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/android')
-rw-r--r--src/android/camera_device.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 61d3ff8a..af4ce301 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -553,7 +553,7 @@ std::tuple<uint32_t, uint32_t> CameraDevice::calculateStaticMetadataSize()
* Currently: 51 entries, 687 bytes of static metadata
*/
uint32_t numEntries = 51;
- uint32_t byteSize = 691;
+ uint32_t byteSize = 693;
/*
* Calculate space occupation in bytes for dynamically built metadata
@@ -595,12 +595,18 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()
const ControlInfoMap &controlsInfo = camera_->controls();
/* Color correction static metadata. */
- std::vector<uint8_t> aberrationModes = {
- ANDROID_COLOR_CORRECTION_ABERRATION_MODE_OFF,
- };
- staticMetadata_->addEntry(ANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES,
- aberrationModes.data(),
- aberrationModes.size());
+ {
+ std::vector<uint8_t> data(3);
+ const auto &infoMap = controlsInfo.find(&controls::draft::ColorCorrectionAberrationMode);
+ if (infoMap != controlsInfo.end()) {
+ for (const auto &value : infoMap->second.values())
+ data.push_back(value.get<int32_t>());
+ } else {
+ data.push_back(ANDROID_COLOR_CORRECTION_ABERRATION_MODE_OFF);
+ }
+ staticMetadata_->addEntry(ANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES,
+ data.data(), data.size());
+ }
/* Control static metadata. */
std::vector<uint8_t> aeAvailableAntiBandingModes = {