fix: Fix Android Stabilization Modes (#449)
This commit is contained in:
parent
e621422389
commit
83524c0541
@ -152,7 +152,8 @@ class CameraViewModule(reactContext: ReactApplicationContext) : ReactContextBase
|
|||||||
capabilities.contains(CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT)
|
capabilities.contains(CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT)
|
||||||
val supportsRawCapture = capabilities.contains(CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES_RAW)
|
val supportsRawCapture = capabilities.contains(CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES_RAW)
|
||||||
val isoRange = characteristics.get(CameraCharacteristics.SENSOR_INFO_SENSITIVITY_RANGE)
|
val isoRange = characteristics.get(CameraCharacteristics.SENSOR_INFO_SENSITIVITY_RANGE)
|
||||||
val stabilizationModes = characteristics.get(CameraCharacteristics.CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES)!! // only digital, no optical
|
val digitalStabilizationModes = characteristics.get(CameraCharacteristics.CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES)
|
||||||
|
val opticalStabilizationModes = characteristics.get(CameraCharacteristics.LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION)
|
||||||
val zoomRange = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R)
|
val zoomRange = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R)
|
||||||
characteristics.get(CameraCharacteristics.CONTROL_ZOOM_RATIO_RANGE)
|
characteristics.get(CameraCharacteristics.CONTROL_ZOOM_RATIO_RANGE)
|
||||||
else null
|
else null
|
||||||
@ -230,13 +231,18 @@ class CameraViewModule(reactContext: ReactApplicationContext) : ReactContextBase
|
|||||||
colorSpaces.pushString(formatName)
|
colorSpaces.pushString(formatName)
|
||||||
|
|
||||||
val videoStabilizationModes = Arguments.createArray()
|
val videoStabilizationModes = Arguments.createArray()
|
||||||
if (stabilizationModes.contains(CameraCharacteristics.CONTROL_VIDEO_STABILIZATION_MODE_OFF)) {
|
|
||||||
videoStabilizationModes.pushString("off")
|
videoStabilizationModes.pushString("off")
|
||||||
}
|
if (digitalStabilizationModes != null) {
|
||||||
if (stabilizationModes.contains(CameraCharacteristics.CONTROL_VIDEO_STABILIZATION_MODE_ON)) {
|
if (digitalStabilizationModes.contains(CameraCharacteristics.CONTROL_VIDEO_STABILIZATION_MODE_ON)) {
|
||||||
videoStabilizationModes.pushString("auto")
|
videoStabilizationModes.pushString("auto")
|
||||||
videoStabilizationModes.pushString("standard")
|
videoStabilizationModes.pushString("standard")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (opticalStabilizationModes != null) {
|
||||||
|
if (opticalStabilizationModes.contains(CameraCharacteristics.LENS_OPTICAL_STABILIZATION_MODE_ON)) {
|
||||||
|
videoStabilizationModes.pushString("cinematic")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val format = Arguments.createMap()
|
val format = Arguments.createMap()
|
||||||
format.putDouble("photoHeight", size.height.toDouble())
|
format.putDouble("photoHeight", size.height.toDouble())
|
||||||
|
Loading…
Reference in New Issue
Block a user