コード例 #1
0
 @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();
 }
コード例 #2
0
 protected List<Size> getOrderedPreviewSizes(String cameraId) {
   CameraHolder camera = getCameraHolder(cameraId);
   assertTrue("Camera is not openned", camera.isOpenned());
   return camera.getOrderedPreviewSizes();
 }
コード例 #3
0
 protected StaticMetadata getStaticInfo(String cameraId) {
   CameraHolder camera = getCameraHolder(cameraId);
   assertTrue("Camera is not openned", camera.isOpenned());
   return camera.getStaticInfo();
 }
コード例 #4
0
 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);
 }
コード例 #5
0
 protected void openCamera(String cameraId) throws Exception {
   CameraHolder camera = getCameraHolder(cameraId);
   assertFalse("Camera has already opened", camera.isOpenned());
   camera.open();
   return;
 }