diff options
author | Sol Boucher <solb@google.com> | 2014-07-24 23:59:21 -0700 |
---|---|---|
committer | Sol Boucher <solb@google.com> | 2014-07-31 13:34:27 -0700 |
commit | 73ec9851f8e92968ac50193916526afd8f1343fc (patch) | |
tree | 7213706753fe6b07662afd5108600b6dc3a3adc8 /src/com/android/camera/VideoModule.java | |
parent | 00d8bbc97d970db9604474210554caa18935c7eb (diff) | |
download | android_packages_apps_Camera2-73ec9851f8e92968ac50193916526afd8f1343fc.tar.gz android_packages_apps_Camera2-73ec9851f8e92968ac50193916526afd8f1343fc.tar.bz2 android_packages_apps_Camera2-73ec9851f8e92968ac50193916526afd8f1343fc.zip |
Move display orientation calculations out of app code
Because they're needed by every app, these are being relocated into the
portability layer. As such, the CameraUtil#getDisplayOrientation() and
CameraUtil#getJpegRotation() methods are being replaced by the API-agnostic
CameraDeviceInfo.Characteristics#getPreviewOrientation() and
CameraDeviceInfo.Characteristics#getJpegOrientation() calls, respectively.
Change-Id: I5048e6f1a5ff655e4ea260b109e7c104bbe790b0
Diffstat (limited to 'src/com/android/camera/VideoModule.java')
-rw-r--r-- | src/com/android/camera/VideoModule.java | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index 3ba9f6b5d..ae0daaf22 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -416,11 +416,6 @@ public class VideoModule extends CameraModule return; } - // Set rotation and gps data. - Characteristics info = - mActivity.getCameraProvider().getCharacteristics(mCameraId); - int rotation = CameraUtil.getJpegRotation(info, mOrientation); - mCameraSettings.setPhotoRotationDegrees(rotation); Location loc = mLocationManager.getCurrentLocation(); CameraUtil.setGpsParameters(mCameraSettings, loc); mCameraDevice.applySettings(mCameraSettings); @@ -844,10 +839,10 @@ public class VideoModule extends CameraModule mDisplayRotation = CameraUtil.getDisplayRotation(mActivity); Characteristics info = mActivity.getCameraProvider().getCharacteristics(mCameraId); - mCameraDisplayOrientation = CameraUtil.getDisplayOrientation(mDisplayRotation, info); + mCameraDisplayOrientation = info.getPreviewOrientation(mDisplayRotation); // Change the camera display orientation if (mCameraDevice != null) { - mCameraDevice.setDisplayOrientation(mCameraDisplayOrientation); + mCameraDevice.setDisplayOrientation(mDisplayRotation); } if (mFocusManager != null) { mFocusManager.setDisplayOrientation(mCameraDisplayOrientation); @@ -919,7 +914,7 @@ public class VideoModule extends CameraModule } setDisplayOrientation(); - mCameraDevice.setDisplayOrientation(mCameraDisplayOrientation); + mCameraDevice.setDisplayOrientation(mDisplayRotation); setCameraParameters(); if (mFocusManager != null) { |