@Override
    protected void onRestoreInstanceState(Parcelable state) {
        if (!(state instanceof Bundle)) {
            super.onRestoreInstanceState(state);
            return;
        }
        Bundle myState = (Bundle)state;
        Parcelable superState = myState.getParcelable("super");
        super.onRestoreInstanceState(superState);
        boolean torch = myState.getBoolean("torch");
        setTorch(torch);
    }
Calculate framing rectangle, relative to the preview frame.

Note that the SurfaceView may be larger than the container.

Override this for more control over the framing rect calculations.

@param container this container, with left = top = 0
@param surface   the SurfaceView, relative to this container
@return the framing rect, relative to this container
zxing-android-embedded/src/com/journeyapps/barcodescanner/CameraPreview.java