private void startCameraPreview(CameraSurface surface) {
        if (!previewActive && cameraInstance != null) {
            Log.i(TAG, "Starting preview");
            cameraInstance.setSurface(surface);
            cameraInstance.startPreview();
            previewActive = true;

            previewStarted();
            fireState.previewStarted();
        }
    }
Create a new CameraInstance.

Override to use a custom CameraInstance.

@return a new CameraInstance
zxing-android-embedded/src/com/journeyapps/barcodescanner/CameraPreview.java