summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2021-02-03 16:37:20 +0100
committerJacopo Mondi <jacopo@jmondi.org>2021-02-05 13:08:01 +0100
commit9690d082ec71d3c9aee313fae7b6edfec2ffb352 (patch)
treecd1d14efbf2a04c8099bebdf7a339eadb8f9bf65
parentf266c0eb9ca981d4856c352fcbf95fec03ecf91a (diff)
android: camera_device: Report AF_MODE_OFF in template
The CaptureResultTest#testCameraCaptureResultAllKeys CTS test enforces the presence of the auto focus mode in the preview request template. Add the only supported mode AF_MODE_OFF in the generated template. Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
-rw-r--r--src/android/camera_device.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index bc224ecc..fabe45ac 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -1351,7 +1351,7 @@ CameraMetadata *CameraDevice::requestTemplatePreview()
* \todo Keep this in sync with the actual number of entries.
* Currently: 20 entries, 35 bytes
*/
- CameraMetadata *requestTemplate = new CameraMetadata(20, 35);
+ CameraMetadata *requestTemplate = new CameraMetadata(21, 36);
if (!requestTemplate->isValid()) {
delete requestTemplate;
return nullptr;
@@ -1384,6 +1384,9 @@ CameraMetadata *CameraDevice::requestTemplatePreview()
requestTemplate->addEntry(ANDROID_CONTROL_AE_ANTIBANDING_MODE,
&aeAntibandingMode, 1);
+ uint8_t afMode = ANDROID_CONTROL_AF_MODE_OFF;
+ requestTemplate->addEntry(ANDROID_CONTROL_AF_MODE, &afMode, 1);
+
uint8_t afTrigger = ANDROID_CONTROL_AF_TRIGGER_IDLE;
requestTemplate->addEntry(ANDROID_CONTROL_AF_TRIGGER,
&afTrigger, 1);