Skip to content

Instantly share code, notes, and snippets.

@adumont
Created January 12, 2012 12:28
Show Gist options
  • Save adumont/1600222 to your computer and use it in GitHub Desktop.
Save adumont/1600222 to your computer and use it in GitHub Desktop.
SuperOSR HTC Chacha - Camera.apk - Fix for 90º issue (temporal)
Here is my fix for the Camera.apk. For the moment it's getting the job done, but it's ugly, Later I'll put in place a system property for example and read from it.
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java
index d308d33..5399c7c 100644
--- a/src/com/android/camera/Camera.java
+++ b/src/com/android/camera/Camera.java
@@ -825,7 +825,7 @@ public class Camera extends BaseCamera implements View.OnClickListener,
info.orientation != 90) {
rotation = (info.orientation - mOrientation + 360) % 360;
} else { // back-facing camera (or acting like it)
- rotation = (info.orientation + mOrientation) % 360;
+ rotation = (info.orientation + mOrientation - 90 ) % 360;
}
}
mParameters.setRotation(rotation);
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java
index d2b6b84..2912be2 100644
--- a/src/com/android/camera/VideoCamera.java
+++ b/src/com/android/camera/VideoCamera.java
@@ -1119,7 +1119,7 @@ public class VideoCamera extends BaseCamera
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 - 90 ) % 360;
}
}
mMediaRecorder.setOrientationHint(rotation);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment