private static List<Size> getPreviewSizes(Camera.Parameters parameters) {
        List<Camera.Size> rawSupportedSizes = parameters.getSupportedPreviewSizes();
        List<Size> previewSizes = new ArrayList<>();
        if (rawSupportedSizes == null) {
            Camera.Size defaultSize = parameters.getPreviewSize();
            if (defaultSize != null) {
                Size previewSize = new Size(defaultSize.width, defaultSize.height);
                previewSizes.add(new Size(defaultSize.width, defaultSize.height));
            }
            return previewSizes;
        }
        for (Camera.Size size : rawSupportedSizes) {
            previewSizes.add(new Size(size.width, size.height));
        }
        return previewSizes;
    }
@return the camera rotation relative to display rotation, in degrees. Typically 0 if the
   display is in landscape orientation.
zxing-android-embedded/src/com/journeyapps/barcodescanner/camera/CameraManager.java