diff options
| author | Vijay kumar Tumati <vtumati@codeaurora.org> | 2013-07-09 17:41:50 +0530 |
|---|---|---|
| committer | Steve Kondik <shade@chemlab.org> | 2013-10-18 15:54:49 -0700 |
| commit | 39aa292b2adc0924c7b36a1798c9ae9bea333f25 (patch) | |
| tree | 3d42e77132e0eea15fdf8ac2049579f1cf10c38b | |
| parent | 07630b2d04520e092a4bc14eb77aa692c4871149 (diff) | |
| download | android_packages_apps_Gallery2-39aa292b2adc0924c7b36a1798c9ae9bea333f25.tar.gz android_packages_apps_Gallery2-39aa292b2adc0924c7b36a1798c9ae9bea333f25.tar.bz2 android_packages_apps_Gallery2-39aa292b2adc0924c7b36a1798c9ae9bea333f25.zip | |
Camera: fix panorama rotation issues on 8226.
preview and snapshot are rotated unexpectedly
on 8226 but is fine on 8974. Need to change
rotation angles in panorama based on
sensor mount angle.
Change-Id: I0eff35e574b57b787683722bb16762b7b9b0ee2a
CRs-Fixed: 495787
(cherry picked from commit 7c0e1e546ac903268a16df6a1823743711e396e4)
| -rw-r--r-- | src/com/android/camera/PanoramaModule.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/com/android/camera/PanoramaModule.java b/src/com/android/camera/PanoramaModule.java index 66cdc2d30..574b2763d 100644 --- a/src/com/android/camera/PanoramaModule.java +++ b/src/com/android/camera/PanoramaModule.java @@ -784,12 +784,17 @@ public class PanoramaModule implements CameraModule, // device orientation at capture and the camera orientation respective to // the natural orientation of the device. int orientation; + int cameraOrientation = mCameraOrientation; + if(mDeviceOrientationAtCapture == 270 || mDeviceOrientationAtCapture == 90) { + if(mCameraOrientation == 0) + cameraOrientation = 180; + } if (mUsingFrontCamera) { // mCameraOrientation is negative with respect to the front facing camera. // See document of android.hardware.Camera.Parameters.setRotation. - orientation = (mDeviceOrientationAtCapture - mCameraOrientation + 360) % 360; + orientation = (mDeviceOrientationAtCapture - cameraOrientation + 360) % 360; } else { - orientation = (mDeviceOrientationAtCapture + mCameraOrientation) % 360; + orientation = (mDeviceOrientationAtCapture + cameraOrientation) % 360; } return orientation; } @@ -1158,9 +1163,12 @@ public class PanoramaModule implements CameraModule, // Set the display orientation to 0, so that the underlying mosaic // library can always get undistorted mPreviewWidth x mPreviewHeight // image data from SurfaceTexture. - mCameraDevice.setDisplayOrientation(0); + if (mCameraOrientation == 0) + mCameraDevice.setDisplayOrientation(270); + else + mCameraDevice.setDisplayOrientation(0); - mCameraTexture.setOnFrameAvailableListener(this); + if (mCameraTexture != null) mCameraTexture.setOnFrameAvailableListener(this); mCameraDevice.setPreviewTextureAsync(mCameraTexture); } mCameraDevice.startPreviewAsync(); |
