Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Priyank Vasa committed Jan 5, 2019
1 parent ce18afe commit de906a0
Showing 1 changed file with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ internal open class Camera2(
CameraViewException("Af mode ${config.autoFocus.value} not supported by selected camera. Setting it to off."),
ErrorLevel.Warning
)
config.autoFocus.value = Modes.DEFAULT_AUTO_FOCUS
config.autoFocus.value = Modes.AutoFocus.AF_OFF
}
}

Expand Down Expand Up @@ -987,7 +987,7 @@ internal open class Camera2(
CameraViewException("Awb mode ${config.awb.value} not supported by selected camera. Setting it to off."),
ErrorLevel.Warning
)
config.awb.value = Modes.DEFAULT_AWB
config.awb.value = Modes.AutoWhiteBalance.AWB_OFF
}
}

Expand All @@ -1001,10 +1001,7 @@ internal open class Camera2(
CameraViewException("Optical image stabilization is not supported by selected camera $cameraId. Setting it to off."),
ErrorLevel.Warning
)
previewRequestBuilder.set(
CaptureRequest.LENS_OPTICAL_STABILIZATION_MODE,
CaptureRequest.LENS_OPTICAL_STABILIZATION_MODE_OFF
)
config.opticalStabilization.value = false
}
} else previewRequestBuilder.set(
CaptureRequest.LENS_OPTICAL_STABILIZATION_MODE,
Expand All @@ -1020,17 +1017,19 @@ internal open class Camera2(
CameraViewException("Noise reduction mode ${config.noiseReduction.value} not supported by selected camera. Setting it to off."),
ErrorLevel.Warning
)
config.noiseReduction.value = Modes.DEFAULT_NOISE_REDUCTION
config.noiseReduction.value = Modes.NoiseReduction.NOISE_REDUCTION_OFF
}
}

private fun updateModes() = runBlocking(Dispatchers.Main) {
updateScalerCropRegion()
updateAf()
updateFlash()
updateAwb()
updateOis()
updateNoiseReduction()
private fun updateModes() = runBlocking {
GlobalScope.launch(Dispatchers.Main) {
updateScalerCropRegion()
updateAf()
updateFlash()
updateAwb()
updateOis()
updateNoiseReduction()
}
}

/** Locks the focus as the first step for a still image capture. */
Expand Down

0 comments on commit de906a0

Please sign in to comment.