summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2014-11-04 23:11:00 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2014-11-04 23:11:00 -0800
commit6d7c20c785ec5f1c54dceeef187357184331277c (patch)
tree9edf8e2103dc9cfc24f2a0f9e7098961b24c3443 /src/com
parenta90a51afc72091494fd2e63727e38f7ae8231b30 (diff)
parentbd3d72f5a1c49b556bfd4b3ddbb52a82914f8ae1 (diff)
downloadandroid_packages_apps_Snap-6d7c20c785ec5f1c54dceeef187357184331277c.tar.gz
android_packages_apps_Snap-6d7c20c785ec5f1c54dceeef187357184331277c.tar.bz2
android_packages_apps_Snap-6d7c20c785ec5f1c54dceeef187357184331277c.zip
Merge "Camera2: Set preview size based on setprop"
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/camera/PhotoModule.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 0cc0a9973..f9ef6fbe6 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -3161,6 +3161,45 @@ public class PhotoModule
List<Size> sizes = mParameters.getSupportedPreviewSizes();
Size optimalSize = CameraUtil.getOptimalPreviewSize(mActivity, sizes,
(double) size.width / size.height);
+
+ //Read Preview Resolution from adb command
+ //value: 0(default) - Default value as per snapshot aspect ratio
+ //value: 1 - 640x480
+ //value: 2 - 720x480
+ //value: 3 - 1280x720
+ //value: 4 - 1920x1080
+ int preview_resolution = SystemProperties.getInt("persist.camera.preview.size", 0);
+ switch (preview_resolution) {
+ case 1: {
+ optimalSize.width = 640;
+ optimalSize.height = 480;
+ Log.v(TAG, "Preview resolution hardcoded to 640x480");
+ break;
+ }
+ case 2: {
+ optimalSize.width = 720;
+ optimalSize.height = 480;
+ Log.v(TAG, "Preview resolution hardcoded to 720x480");
+ break;
+ }
+ case 3: {
+ optimalSize.width = 1280;
+ optimalSize.height = 720;
+ Log.v(TAG, "Preview resolution hardcoded to 1280x720");
+ break;
+ }
+ case 4: {
+ optimalSize.width = 1920;
+ optimalSize.height = 1080;
+ Log.v(TAG, "Preview resolution hardcoded to 1920x1080");
+ break;
+ }
+ default: {
+ Log.v(TAG, "Preview resolution as per Snapshot aspect ratio");
+ break;
+ }
+ }
+
Size original = mParameters.getPreviewSize();
if (!original.equals(optimalSize)) {
mParameters.setPreviewSize(optimalSize.width, optimalSize.height);