public Size getBestPreviewSize(List<Size> sizes, final Size desired) {
        // Sample of supported preview sizes:
        // http://www.kirill.org/ar/ar.php

        List<Size> ordered = getBestPreviewOrder(sizes, desired);

        Log.i(TAG, "Viewfinder size: " + desired);
        Log.i(TAG, "Preview in order of preference: " + ordered);

        return ordered.get(0);
    }
Choose the best preview size, based on our viewfinder size.

The default implementation lets subclasses calculate a score for each size, the picks the one
with the best score.

The sizes list may be reordered by this call.

@param sizes supported preview sizes, containing at least one size. Sizes are in natural camera orientation.
@param desired The desired viewfinder size, in the same orientation
@return the best preview size, never null
zxing-android-embedded/src/com/journeyapps/barcodescanner/camera/PreviewScalingStrategy.java