CameraConfigurationManager.java (zxing-zxing-3.4.1) | : | CameraConfigurationManager.java (zxing-zxing-3.5.0) | ||
---|---|---|---|---|
skipping to change at line 96 | skipping to change at line 96 | |||
int cwRotationFromNaturalToCamera = camera.getOrientation(); | int cwRotationFromNaturalToCamera = camera.getOrientation(); | |||
Log.i(TAG, "Camera at: " + cwRotationFromNaturalToCamera); | Log.i(TAG, "Camera at: " + cwRotationFromNaturalToCamera); | |||
// Still not 100% sure about this. But acts like we need to flip this: | // Still not 100% sure about this. But acts like we need to flip this: | |||
if (camera.getFacing() == CameraFacing.FRONT) { | if (camera.getFacing() == CameraFacing.FRONT) { | |||
cwRotationFromNaturalToCamera = (360 - cwRotationFromNaturalToCamera) % 36 0; | cwRotationFromNaturalToCamera = (360 - cwRotationFromNaturalToCamera) % 36 0; | |||
Log.i(TAG, "Front camera overriden to: " + cwRotationFromNaturalToCamera); | Log.i(TAG, "Front camera overriden to: " + cwRotationFromNaturalToCamera); | |||
} | } | |||
/* | ||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(cont | ||||
ext); | ||||
String overrideRotationString; | ||||
if (camera.getFacing() == CameraFacing.FRONT) { | ||||
overrideRotationString = prefs.getString(PreferencesActivity.KEY_FORCE_CAM | ||||
ERA_ORIENTATION_FRONT, null); | ||||
} else { | ||||
overrideRotationString = prefs.getString(PreferencesActivity.KEY_FORCE_CAM | ||||
ERA_ORIENTATION, null); | ||||
} | ||||
if (overrideRotationString != null && !"-".equals(overrideRotationString)) { | ||||
Log.i(TAG, "Overriding camera manually to " + overrideRotationString); | ||||
cwRotationFromNaturalToCamera = Integer.parseInt(overrideRotationString); | ||||
} | ||||
*/ | ||||
cwRotationFromDisplayToCamera = | cwRotationFromDisplayToCamera = | |||
(360 + cwRotationFromNaturalToCamera - cwRotationFromNaturalToDisplay) % 360; | (360 + cwRotationFromNaturalToCamera - cwRotationFromNaturalToDisplay) % 360; | |||
Log.i(TAG, "Final display orientation: " + cwRotationFromDisplayToCamera); | Log.i(TAG, "Final display orientation: " + cwRotationFromDisplayToCamera); | |||
if (camera.getFacing() == CameraFacing.FRONT) { | if (camera.getFacing() == CameraFacing.FRONT) { | |||
Log.i(TAG, "Compensating rotation for front camera"); | Log.i(TAG, "Compensating rotation for front camera"); | |||
cwNeededRotation = (360 - cwRotationFromDisplayToCamera) % 360; | cwNeededRotation = (360 - cwRotationFromDisplayToCamera) % 360; | |||
} else { | } else { | |||
cwNeededRotation = cwRotationFromDisplayToCamera; | cwNeededRotation = cwRotationFromDisplayToCamera; | |||
} | } | |||
Log.i(TAG, "Clockwise rotation from display to camera: " + cwNeededRotation) ; | Log.i(TAG, "Clockwise rotation from display to camera: " + cwNeededRotation) ; | |||
End of changes. 1 change blocks. | ||||
17 lines changed or deleted | 0 lines changed or added |