summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2011-10-20 01:50:48 -0700
committerEino-Ville Talvala <etalvala@google.com>2011-10-20 01:50:48 -0700
commit51b06d6696a4743339d026b3b3bd282645725b27 (patch)
tree56ba478a500d98b2a1ff9afa5406c4d3897719f0 /src/com/android/camera
parentf9f24d4c578a01cb09a7e5c4c66b75595d3669ee (diff)
downloadLegacyCamera-51b06d6696a4743339d026b3b3bd282645725b27.zip
LegacyCamera-51b06d6696a4743339d026b3b3bd282645725b27.tar.gz
LegacyCamera-51b06d6696a4743339d026b3b3bd282645725b27.tar.bz2
Fix effects orientation handling.
Effects orientation was incorrectly using the CameraInfo.orientation field to adjust for true down for face detection, background replacement, and effects recording video orientation. The input surfacetexture from the camera already takes the orientation into account in its transform matrix, resulting in incorrect rotation amounts. Bug: 5488310 Change-Id: I4c4105c44d361ca245874a47e4ff7b93cbd3bb06
Diffstat (limited to 'src/com/android/camera')
-rw-r--r--src/com/android/camera/EffectsRecorder.java11
-rwxr-xr-xsrc/com/android/camera/VideoCamera.java8
2 files changed, 9 insertions, 10 deletions
diff --git a/src/com/android/camera/EffectsRecorder.java b/src/com/android/camera/EffectsRecorder.java
index 8b63ceb..ed44a79 100644
--- a/src/com/android/camera/EffectsRecorder.java
+++ b/src/com/android/camera/EffectsRecorder.java
@@ -305,12 +305,12 @@ public class EffectsRecorder {
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);
}
}
@@ -349,9 +349,8 @@ public class EffectsRecorder {
break;
}
if (mLogVerbose) Log.v(TAG, "Setting orientation hint to: " + degrees);
-
mOrientationHint = degrees;
- setFaceDetectOrientation(degrees);
+ setFaceDetectOrientation();
setRecordingOrientation();
}
@@ -480,7 +479,7 @@ public class EffectsRecorder {
default:
break;
}
- setFaceDetectOrientation(mOrientationHint);
+ setFaceDetectOrientation();
setRecordingOrientation();
}
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java
index 8960311..8ac25e6 100755
--- a/src/com/android/camera/VideoCamera.java
+++ b/src/com/android/camera/VideoCamera.java
@@ -522,9 +522,8 @@ public class VideoCamera extends ActivityBase
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.
@@ -1255,9 +1254,10 @@ public class VideoCamera extends ActivityBase
// documentation.
int rotation = 0;
if (mOrientation != OrientationEventListener.ORIENTATION_UNKNOWN) {
- rotation = (info.orientation + mOrientation) % 360;
+ rotation = mOrientationCompensation % 360;
}
mEffectsRecorder.setOrientationHint(rotation);
+
mOrientationCompensationAtRecordStart = mOrientationCompensation;
mEffectsRecorder.setPreviewDisplay(