Camera: Fix coordinate mapping within partial result
Capture result coordinate mapping has the assumption that all relevant
tags are within the same capture result. With partial result, this
assumption is no longer true.
Address the issue by removing the remapped tags from partial result.
This approach shouldn't be causing performance degradation because we
are not touching 3A states, and 3A regions has dependency on crop
region, zoom ratio, and various modes used by the coordinate mappers.
Test: Camera CTS
Bug: 170575182
Change-Id: I022482ebf0f687d9b6138684aeda0f2bbf94046b
diff --git a/services/camera/libcameraservice/device3/ZoomRatioMapper.cpp b/services/camera/libcameraservice/device3/ZoomRatioMapper.cpp
index a87de77..81d7bf9 100644
--- a/services/camera/libcameraservice/device3/ZoomRatioMapper.cpp
+++ b/services/camera/libcameraservice/device3/ZoomRatioMapper.cpp
@@ -25,6 +25,19 @@
namespace camera3 {
+void ZoomRatioMapper::initRemappedKeys() {
+ mRemappedKeys.insert(
+ kMeteringRegionsToCorrect.begin(),
+ kMeteringRegionsToCorrect.end());
+ mRemappedKeys.insert(
+ kRectsToCorrect.begin(),
+ kRectsToCorrect.end());
+ mRemappedKeys.insert(
+ kResultPointsToCorrectNoClamp.begin(),
+ kResultPointsToCorrectNoClamp.end());
+
+ mRemappedKeys.insert(ANDROID_CONTROL_ZOOM_RATIO);
+}
status_t ZoomRatioMapper::initZoomRatioInTemplate(CameraMetadata *request) {
camera_metadata_entry_t entry;
@@ -117,6 +130,8 @@
ZoomRatioMapper::ZoomRatioMapper(const CameraMetadata* deviceInfo,
bool supportNativeZoomRatio, bool usePrecorrectArray) {
+ initRemappedKeys();
+
camera_metadata_ro_entry_t entry;
entry = deviceInfo->find(ANDROID_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE);