Last active
May 23, 2020 07:19
-
-
Save ananthrajsingh/ec2abb2363efbbf917726b0e5ab704c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun openCameraFront(width: Int, height: Int) { | |
setUpCameraOutputsFront(width, height) | |
configureTransformFront(width, height) | |
val manager = activity?.getSystemService(Context.CAMERA_SERVICE) as CameraManager | |
try { | |
manager.openCamera(cameraIdFront, stateCallbackFront, backgroundHandler) | |
} catch (e: CameraAccessException) { | |
Log.e(TAG, e.toString()) | |
} | |
} | |
private fun openCameraRear(width: Int, height: Int) { | |
setUpCameraOutputsRear(width, height) | |
configureTransformRear(width, height) | |
val manager = activity?.getSystemService(Context.CAMERA_SERVICE) as CameraManager | |
try { | |
manager.openCamera(cameraIdRear, stateCallbackRear, backgroundHandler) | |
} catch (e: CameraAccessException) { | |
Log.e(TAG, e.toString()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment