@RequiresPermission(Manifest.permission.CAMERA) public CameraSource start(SurfaceHolder surfaceHolder) throws IOException {
synchronized (mCameraLock) {
    if (mCamera != null) {
      return this;
    }
    mCamera=createCamera();
    mCamera.setPreviewDisplay(surfaceHolder);
    mCamera.startPreview();
    mProcessingThread=new Thread(mFrameProcessor);
    mFrameProcessor.setActive(true);
    mProcessingThread.start();
  }
  return this;
}

@ RequiresPermission ( Manifest . permission . CAMERA ) public CameraSource start ( SurfaceHolder surfaceHolder ) throws IOException { synchronized ( mCameraLock ) { if ( mCamera != null ) { return this ; } mCamera = createCamera ( ) ; mCamera . setPreviewDisplay ( surfaceHolder ) ; mCamera . startPreview ( ) ; mProcessingThread = new Thread ( mFrameProcessor ) ; mFrameProcessor . setActive ( true ) ; mProcessingThread . start ( ) ; } return this ; }
opens the camera and starts sending preview frames to the underlying detector . the supplied surface holder is used for the preview so frames can be displayed to the user .
