CameraInstance
= a handler class used to deal with the camera2 api
Methods
-
openCamera()
- initiates the camera
-
setUpCameraOutputs()
- iterates over cameraDevices (cameraIdList)
- checks preview sizes → chooseOptimalSize() → mPreviewSize
-
chooseOptimalSize()
- chooses the biggest possible size from a given array of sizes
Variables
- mPreviewSize: biggest possible preview size
Sequence
- SurfaceTextureListener
- onSurfaceTextureAvailable → openCamera()
- onSurfaceTextureChanged → configureTransform()
- openCamera()
- setUpCameraOutputs()
- manager.openCamera → mStateCallback
- mStateCallback
- onOpened → createCameraPreviewSession()
- else → close cameraDevice (and finish activity)
- createCameraPreviewSession()
- mPreviewRequestBuilder
- createCaptureSession() → captureSessionStateCallback
- captureSessionStateCallback
- onConfigured → configure mPreviewRequestBuilder