Camera3: Remove mutex from ZoomRatioMapper
ZoomRatioMapper's member variables are const after construction. As a
result, we don't need mutex to protect updateCaptureRequest and
updateCaptureResult calls.
Also fixed missing zoom ratio mapping initialization for physical
sub-camera.
Test: testZoomRatio CTS
Bug: 130025314
Change-Id: Ibe2ff7cffb13178dcf70fc9e2eb044184e58bcf2
diff --git a/services/camera/libcameraservice/device3/Camera3Device.cpp b/services/camera/libcameraservice/device3/Camera3Device.cpp
index 1c5281d..09b1f02 100644
--- a/services/camera/libcameraservice/device3/Camera3Device.cpp
+++ b/services/camera/libcameraservice/device3/Camera3Device.cpp
@@ -161,14 +161,9 @@
}
}
- res = mZoomRatioMappers[physicalId].initZoomRatioTags(
+ mZoomRatioMappers[physicalId] = ZoomRatioMapper(
&mPhysicalDeviceInfoMap[physicalId],
mSupportNativeZoomRatio, usePrecorrectArray);
- if (res != OK) {
- SET_ERR_L("Failed to initialize camera %s's zoomRatio tags: %s (%d)",
- physicalId.c_str(), strerror(-res), res);
- return res;
- }
}
}
@@ -353,13 +348,8 @@
}
}
- res = mZoomRatioMappers[mId.c_str()].initZoomRatioTags(&mDeviceInfo,
+ mZoomRatioMappers[mId.c_str()] = ZoomRatioMapper(&mDeviceInfo,
mSupportNativeZoomRatio, usePrecorrectArray);
- if (res != OK) {
- SET_ERR_L("Failed to initialize zoomRatio tags: %s (%d)",
- strerror(-res), res);
- return res;
- }
return OK;
}