summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2021-01-21 10:38:55 +0100
committerJacopo Mondi <jacopo@jmondi.org>2021-03-09 08:57:36 +0100
commit238fb2791164f63e377836f67d849dc0c9bb4cfe (patch)
tree954826e665fb0b8b36bc3318ca88d296a87871c1
parentedd4b1dab26bfaa5560751d35fb10cc4dd0dfa58 (diff)
android: camera_device: Use AE FPS range in template
The request template returned by requestTemplatePreview() uses an arbitrary {15, 30} Auto-Exposure algorithm FPS range. Use the one calculated at static metadata creation time, which is consistent with the camera limits. Once template generation will be performed inspecting the requested capture intent, the FPS range over which the AE algorithm can range shall be tuned accordingly. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
-rw-r--r--src/android/camera_device.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index dd011bde..537d6617 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -1392,12 +1392,21 @@ CameraMetadata *CameraDevice::requestTemplatePreview()
requestTemplate->addEntry(ANDROID_CONTROL_AE_LOCK,
&aeLock, 1);
- std::vector<int32_t> aeFpsTarget = {
- 15, 30,
- };
- requestTemplate->addEntry(ANDROID_CONTROL_AE_TARGET_FPS_RANGE,
- aeFpsTarget.data(),
- aeFpsTarget.size());
+ /* Get the FPS range registered in the static metadata. */
+ camera_metadata_ro_entry_t entry;
+ bool found = staticMetadata_->getEntry(ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,
+ &entry);
+ if (found)
+ /*
+ * \todo Depending on the requested CaptureIntent, the FPS range
+ * needs to be adjusted. For example, the capture template for
+ * video capture intent shall report a fixed value.
+ *
+ * Also assume the AE_AVAILABLE_TARGET_FPS_RANGE static metadata
+ * has been assembled as {{min, max} {max, max}}.
+ */
+ requestTemplate->addEntry(ANDROID_CONTROL_AE_TARGET_FPS_RANGE,
+ entry.data.i32, 2);
uint8_t aeAntibandingMode = ANDROID_CONTROL_AE_ANTIBANDING_MODE_AUTO;
requestTemplate->addEntry(ANDROID_CONTROL_AE_ANTIBANDING_MODE,