Merge "Import revised translations. DO NOT MERGE" into ics-mr1
diff --git a/src/com/android/camera/EffectsRecorder.java b/src/com/android/camera/EffectsRecorder.java
index a561011..73c5a92 100644
--- a/src/com/android/camera/EffectsRecorder.java
+++ b/src/com/android/camera/EffectsRecorder.java
@@ -93,6 +93,7 @@
private long mMaxFileSize = 0;
private int mMaxDurationMs = 0;
private int mCameraFacing = Camera.CameraInfo.CAMERA_FACING_BACK;
+ private boolean mAppIsLandscape;
private int mEffect = EFFECT_NONE;
private int mCurrentEffect = EFFECT_NONE;
@@ -376,6 +377,16 @@
setRecordingOrientation();
}
+ /** Passes the native orientation of the Camera app (device dependent)
+ * to allow for correct output aspect ratio. Defaults to portrait */
+ public void setAppToLandscape(boolean landscape) {
+ if (mState != STATE_CONFIGURE) {
+ throw new RuntimeException(
+ "setAppToLandscape called after configuration!");
+ }
+ mAppIsLandscape = landscape;
+ }
+
public void setCameraFacing(int facing) {
switch (mState) {
case STATE_RELEASED:
@@ -420,7 +431,12 @@
Log.v(TAG, "Effects framework initializing. Recording size "
+ mProfile.videoFrameWidth + ", " + mProfile.videoFrameHeight);
}
-
+ if (!mAppIsLandscape) {
+ int tmp;
+ tmp = mProfile.videoFrameWidth;
+ mProfile.videoFrameWidth = mProfile.videoFrameHeight;
+ mProfile.videoFrameHeight = tmp;
+ }
mGraphEnv.addReferences(
"textureSourceCallback", mSourceReadyCallback,
"recordingWidth", mProfile.videoFrameWidth,
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java
index 4d09fee..ba189ca 100755
--- a/src/com/android/camera/VideoCamera.java
+++ b/src/com/android/camera/VideoCamera.java
@@ -32,6 +32,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
+import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.hardware.Camera.CameraInfo;
@@ -1234,12 +1235,17 @@
// If the mCameraDevice is null, then this activity is going to finish
if (mCameraDevice == null) return;
+ boolean inLandscape =
+ (getRequestedOrientation() ==
+ ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
+
CameraInfo info = CameraHolder.instance().getCameraInfo()[mCameraId];
mEffectsRecorder = new EffectsRecorder(this);
// TODO: Confirm none of the foll need to go to initializeEffectsRecording()
// and none of these change even when the preview is not refreshed.
+ mEffectsRecorder.setAppToLandscape(inLandscape);
mEffectsRecorder.setCamera(mCameraDevice);
mEffectsRecorder.setCameraFacing(info.facing);
mEffectsRecorder.setProfile(mProfile);