-
Notifications
You must be signed in to change notification settings - Fork 84
Open
Description
for some reason the surface is abandoned, a simple retry fixes the problem
private suspend fun createCaptureSession(
device: CameraDevice, targets: List<Surface>, handler: Handler? = null
): CameraCaptureSession? = suspendCoroutine { cont ->
if (targets.any {
!it.isValid
}) {
// re-initialize the camera
Log.w("CamEngine", "Invalid surface targets, re-initializing camera")
cont.resume(null);
return@suspendCoroutine
}
// .....
session = createCaptureSession(camera, targets, cameraHandler)
if (session == null) {
Log.i("CAMERA", "session is null")
return initializeCamera();
}Metadata
Metadata
Assignees
Labels
No labels