diff options
| author | Eino-Ville Talvala <etalvala@google.com> | 2011-09-14 14:05:30 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-09-14 14:05:30 -0700 |
| commit | c718193efe9b13f1e00f6bd8e3c145e9c28d9309 (patch) | |
| tree | c86f8948bf52799b9245c70e7eb4fc2b1a61e781 /src | |
| parent | cd34658b41261998dd8f2ba0c304373f1e20e631 (diff) | |
| parent | 3ac6ed3a95322fa9e29f81377e92669ebaeb77fb (diff) | |
| download | LegacyCamera-c718193efe9b13f1e00f6bd8e3c145e9c28d9309.zip LegacyCamera-c718193efe9b13f1e00f6bd8e3c145e9c28d9309.tar.gz LegacyCamera-c718193efe9b13f1e00f6bd8e3c145e9c28d9309.tar.bz2 | |
Merge "Fix orientation handling for Effects mode."
Diffstat (limited to 'src')
| -rw-r--r-- | src/com/android/camera/EffectsRecorder.java | 1 | ||||
| -rw-r--r-- | src/com/android/camera/VideoCamera.java | 23 |
2 files changed, 11 insertions, 13 deletions
diff --git a/src/com/android/camera/EffectsRecorder.java b/src/com/android/camera/EffectsRecorder.java index be33d31..f78f5dc 100644 --- a/src/com/android/camera/EffectsRecorder.java +++ b/src/com/android/camera/EffectsRecorder.java @@ -232,6 +232,7 @@ public class EffectsRecorder { default: break; } + if (mLogVerbose) Log.v(TAG, "Setting orientation hint to: " + degrees); mOrientationHint = degrees; setFaceDetectOrientation(degrees); diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index f8fe0e7..dcb0c23 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -520,7 +520,9 @@ public class VideoCamera extends ActivityBase if (mOrientationCompensation != orientationCompensation) { mOrientationCompensation = orientationCompensation; if (effectsActive()) { - mEffectsRecorder.setOrientationHint(orientationCompensation); + CameraInfo info = CameraHolder.instance().getCameraInfo()[mCameraId]; + int rotation = (info.orientation + mOrientation) % 360;; + mEffectsRecorder.setOrientationHint(rotation); } // Do not rotate the icons during recording because the video // orientation is fixed after recording. @@ -883,13 +885,14 @@ public class VideoCamera extends ActivityBase } mPreviewing = false; } + + mDisplayRotation = Util.getDisplayRotation(this); + int orientation = Util.getDisplayOrientation(mDisplayRotation, mCameraId); + mCameraDevice.setDisplayOrientation(orientation); + setCameraParameters(); + if (!effectsActive()) { setPreviewDisplay(mSurfaceHolder); - mDisplayRotation = Util.getDisplayRotation(this); - int orientation = Util.getDisplayOrientation(mDisplayRotation, mCameraId); - mCameraDevice.setDisplayOrientation(orientation); - setCameraParameters(); - try { mCameraDevice.startPreview(); } catch (Throwable ex) { @@ -897,8 +900,6 @@ public class VideoCamera extends ActivityBase throw new RuntimeException("startPreview failed", ex); } } else { - setCameraParameters(); - initializeEffectsPreview(); Log.v(TAG, "effectsStartPreview"); mEffectsRecorder.startPreview(); @@ -1241,11 +1242,7 @@ public class VideoCamera extends ActivityBase int rotation = 0; if (mOrientation != OrientationEventListener.ORIENTATION_UNKNOWN) { CameraInfo info = CameraHolder.instance().getCameraInfo()[mCameraId]; - if (info.facing == CameraInfo.CAMERA_FACING_FRONT) { - rotation = (info.orientation - mOrientation + 360) % 360; - } else { // back-facing camera - rotation = (info.orientation + mOrientation) % 360; - } + rotation = (info.orientation + mOrientation) % 360; } mEffectsRecorder.setOrientationHint(rotation); mOrientationHint = rotation; |
