Skip to content

java.lang.IllegalArgumentException: Surface was abandoned #19

Description

@std-microblock

for some reason the surface is abandoned, a simple retry fixes the problem

privatesuspendfuncreateCaptureSession(
device:CameraDevice, targets:List<Surface>, handler:Handler? = null
): CameraCaptureSession?= suspendCoroutine { cont ->if (targets.any {
!it.isValid
}) {
// re-initialize the cameraLog.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();
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions