@Override protected void tearDown() throws Exception { mHandlerThread.quitSafely(); mHandler = null; mCameraListener = null; for (CameraHolder camera : mCameraHolders) { if (camera.isOpenned()) { camera.close(); camera = null; } } super.tearDown(); }
protected List<Size> getOrderedPreviewSizes(String cameraId) { CameraHolder camera = getCameraHolder(cameraId); assertTrue("Camera is not openned", camera.isOpenned()); return camera.getOrderedPreviewSizes(); }
protected StaticMetadata getStaticInfo(String cameraId) { CameraHolder camera = getCameraHolder(cameraId); assertTrue("Camera is not openned", camera.isOpenned()); return camera.getStaticInfo(); }
protected void startPreview( String cameraId, List<Surface> outputSurfaces, CaptureCallback listener) throws Exception { CameraHolder camera = getCameraHolder(cameraId); assertTrue("Camera " + cameraId + " is not openned", camera.isOpenned()); camera.startPreview(outputSurfaces, listener); }
protected void openCamera(String cameraId) throws Exception { CameraHolder camera = getCameraHolder(cameraId); assertFalse("Camera has already opened", camera.isOpenned()); camera.open(); return; }