summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsatyavaraprasad yerramsetti <satyav@codeaurora.org>2013-08-08 18:00:11 +0530
committerSteve Kondik <shade@chemlab.org>2013-10-18 13:54:23 -0700
commitcb20328f0054322f168c98c8a1f932b0f7258197 (patch)
treedd2f6fe8ce42aa24345dd324ef9807e1b39898c5
parentf72e1792d608cf13db707f2fc345f7a0bf2b5f25 (diff)
downloadandroid_packages_apps_Gallery2-cb20328f0054322f168c98c8a1f932b0f7258197.tar.gz
android_packages_apps_Gallery2-cb20328f0054322f168c98c8a1f932b0f7258197.tar.bz2
android_packages_apps_Gallery2-cb20328f0054322f168c98c8a1f932b0f7258197.zip
Camera: change to fix camera preview stretched issue
When change camera preview size between 16:9 and 4:3, we need update the CamereScreenNail size, but this size will never update the size of mRenderWidth and mRenderHeight, this cause the function getWidth and getHeight get a wrong size, and cause the camera preview stretched change the method to fix this issue. CRs-Fixed: 507577 Change-Id: I00744851e0ecc393b13e907423ac6ec27230ff49
-rw-r--r--src/com/android/camera/CameraActivity.java2
-rw-r--r--src/com/android/camera/CameraScreenNail.java4
-rw-r--r--src/com/android/camera/VideoModule.java4
3 files changed, 5 insertions, 5 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index c0ee1d68a..3b80c2f4a 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -546,7 +546,7 @@ public class CameraActivity extends ActivityBase
notifyScreenNailChanged();
screenNail.acquireSurfaceTexture();
} else {
- if (screenNail.getWidth() != previewWidth || screenNail.getHeight() != previewHeight) {
+ if (screenNail.getTextureWidth() != previewWidth || screenNail.getTextureHeight() != previewHeight) {
screenNail.setSize(previewWidth, previewHeight);
}
screenNail.enableAspectRatioClamping();
diff --git a/src/com/android/camera/CameraScreenNail.java b/src/com/android/camera/CameraScreenNail.java
index a03c103cc..6244c25ab 100644
--- a/src/com/android/camera/CameraScreenNail.java
+++ b/src/com/android/camera/CameraScreenNail.java
@@ -156,11 +156,11 @@ public class CameraScreenNail extends SurfaceTextureScreenNail {
return mEnableAspectRatioClamping ? mRenderHeight : getTextureHeight();
}
- private int getTextureWidth() {
+ public int getTextureWidth() {
return super.getWidth();
}
- private int getTextureHeight() {
+ public int getTextureHeight() {
return super.getHeight();
}
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 52b773fa0..67bc9165e 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -2100,8 +2100,8 @@ public class VideoModule implements CameraModule,
}
CameraScreenNail screenNail = (CameraScreenNail) mActivity.mCameraScreenNail;
- int oldWidth = screenNail.getWidth();
- int oldHeight = screenNail.getHeight();
+ int oldWidth = screenNail.getTextureWidth();
+ int oldHeight = screenNail.getTextureHeight();
if (oldWidth != width || oldHeight != height) {
screenNail.setSize(width, height);