public void setPreview(Camera camera) throws IOException {
        if (surfaceHolder != null) {
            camera.setPreviewDisplay(surfaceHolder);
        } else {
            camera.setPreviewTexture(surfaceTexture);
        }
    }
A surface on which a camera preview is displayed.

This wraps either a SurfaceHolder or a SurfaceTexture.
zxing-android-embedded/src/com/journeyapps/barcodescanner/camera/CameraSurface.java