使用相机后,使用以下代码将其关闭,发生此错误:
Camera2 RequestThread-0:等待请求完成时超时
try {
mCameraOpenCloseLock.acquire();
if (null != mCameraCaptureSession) {
mCameraCaptureSession.close();
mCameraCaptureSession = null;
}
if (null != mImageReader) {
mImageReader.close();
mImageReader = null;
}
if (null != cameraDevice) {
cameraDevice.close();
mIsOpen = false;
cameraDevice = null;
}
} catch (InterruptedException e) {
throw new RuntimeException("Interrupted while trying to lock camera closing.", e);
} finally {
mCameraOpenCloseLock.release();
}
使用imageReader获取图像。