am 7b9a10fe: Merge "Fix effects orientation handling." into ics-mr0
* commit '7b9a10fef160cd452f7905ee52f7b9ac2262faf5':
Fix effects orientation handling.
diff --git a/src/com/android/camera/EffectsRecorder.java b/src/com/android/camera/EffectsRecorder.java
index e4d613a..7c81bf0 100644
--- a/src/com/android/camera/EffectsRecorder.java
+++ b/src/com/android/camera/EffectsRecorder.java
@@ -323,12 +323,12 @@
mEffectsListener = listener;
}
- private void setFaceDetectOrientation(int degrees) {
+ private void setFaceDetectOrientation() {
if (mCurrentEffect == EFFECT_GOOFY_FACE) {
Filter rotateFilter = mRunner.getGraph().getFilter("rotate");
Filter metaRotateFilter = mRunner.getGraph().getFilter("metarotate");
- rotateFilter.setInputValue("rotation", degrees);
- int reverseDegrees = (360 - degrees) % 360;
+ rotateFilter.setInputValue("rotation", mOrientationHint);
+ int reverseDegrees = (360 - mOrientationHint) % 360;
metaRotateFilter.setInputValue("rotation", reverseDegrees);
}
}
@@ -367,9 +367,8 @@
break;
}
if (mLogVerbose) Log.v(TAG, "Setting orientation hint to: " + degrees);
-
mOrientationHint = degrees;
- setFaceDetectOrientation(degrees);
+ setFaceDetectOrientation();
setRecordingOrientation();
}
@@ -498,7 +497,7 @@
default:
break;
}
- setFaceDetectOrientation(mOrientationHint);
+ setFaceDetectOrientation();
setRecordingOrientation();
}
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java
index 7d96cd3..4b3b078 100755
--- a/src/com/android/camera/VideoCamera.java
+++ b/src/com/android/camera/VideoCamera.java
@@ -530,9 +530,8 @@
if (mOrientationCompensation != orientationCompensation) {
mOrientationCompensation = orientationCompensation;
if (effectsActive()) {
- CameraInfo info = CameraHolder.instance().getCameraInfo()[mCameraId];
- int rotation = (info.orientation + mOrientation) % 360;
- mEffectsRecorder.setOrientationHint(rotation);
+ mEffectsRecorder.setOrientationHint(
+ mOrientationCompensation % 360);
}
// Do not rotate the icons during recording because the video
// orientation is fixed after recording.
@@ -1251,9 +1250,10 @@
// documentation.
int rotation = 0;
if (mOrientation != OrientationEventListener.ORIENTATION_UNKNOWN) {
- rotation = (info.orientation + mOrientation) % 360;
+ rotation = mOrientationCompensation % 360;
}
mEffectsRecorder.setOrientationHint(rotation);
+
mOrientationCompensationAtRecordStart = mOrientationCompensation;
mEffectsRecorder.setPreviewDisplay(