/** * Must be called from camera thread. */ public void open() { camera = OpenCameraInterface.open(settings.getRequestedCameraId()); if (camera == null) { throw new RuntimeException("Failed to open camera"); } int cameraId = OpenCameraInterface.getCameraId(settings.getRequestedCameraId()); cameraInfo = new Camera.CameraInfo(); Camera.getCameraInfo(cameraId, cameraInfo); }
if (theCamera == null) { theCamera = OpenCameraInterface.open(requestedCameraId); if (theCamera == null) { throw new IOException();
/** * Opens the requested camera with {@link Camera#open(int)}, if one exists. * * @param requestedId camera ID of the camera to use. A negative value * or {@link #NO_REQUESTED_CAMERA} means "no preference" * @return handle to {@link Camera} that was opened */ public static Camera open(int requestedId) { int cameraId = getCameraId(requestedId); if (cameraId == -1) { return null; } else { return Camera.open(cameraId); } } }
OpenCamera theCamera = camera; if (theCamera == null) { theCamera = OpenCameraInterface.open(requestedCameraId); if (theCamera == null) { throw new IOException("Camera.open() failed to return object from driver");
Camera theCamera = camera; if (theCamera == null) { theCamera = new OpenCameraManager().build().open(); if (theCamera == null) { throw new IOException();
OpenCamera theCamera = camera; if (theCamera == null) { theCamera = OpenCameraInterface.open(requestedCameraId); if (theCamera == null) { throw new IOException("Camera.open() failed to return object from driver");