summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/CaptureModule.java
diff options
context:
space:
mode:
authorCamera Software Integration <camswint@quicinc.com>2017-07-12 09:42:13 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-07-12 09:42:13 -0700
commitc549110ab1165ff87ffc75c12910e1ac9ea7aa19 (patch)
treed3e280677a0b08de27719433f08822563646a2dd /src/com/android/camera/CaptureModule.java
parentd783b87a53431d9596228b1df46d718887dda813 (diff)
parentb4a166a3bd548693cb7237fddaea2149a66f6a70 (diff)
downloadandroid_packages_apps_Snap-c549110ab1165ff87ffc75c12910e1ac9ea7aa19.tar.gz
android_packages_apps_Snap-c549110ab1165ff87ffc75c12910e1ac9ea7aa19.tar.bz2
android_packages_apps_Snap-c549110ab1165ff87ffc75c12910e1ac9ea7aa19.zip
Merge "SnapdragonCamera: Support preview setprop for video" into camera.lnx.3.0-dev
Diffstat (limited to 'src/com/android/camera/CaptureModule.java')
-rw-r--r--src/com/android/camera/CaptureModule.java44
1 files changed, 25 insertions, 19 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index 30158fdd6..d61163919 100644
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -2314,39 +2314,30 @@ public class CaptureModule implements CameraModule, PhotoController,
updateMaxVideoDuration();
}
- private void updatePreviewSize() {
+ private Size checkOverridePreviewSize(int cur_width, int cur_height) {
int preview_resolution = PersistUtil.getCameraPreviewSize();
- int width = mPreviewSize.getWidth();
- int height = mPreviewSize.getHeight();
-
- String makeup = mSettingsManager.getValue(SettingsManager.KEY_MAKEUP);
- boolean makeupOn = makeup != null && !makeup.equals("0");
- if (makeupOn) {
- width = mVideoSize.getWidth();
- height = mVideoSize.getHeight();
- }
switch (preview_resolution) {
case 1: {
- width = 640;
- height = 480;
+ cur_width = 640;
+ cur_height = 480;
Log.v(TAG, "Preview resolution hardcoded to 640x480");
break;
}
case 2: {
- width = 720;
- height = 480;
+ cur_width = 720;
+ cur_height = 480;
Log.v(TAG, "Preview resolution hardcoded to 720x480");
break;
}
case 3: {
- width = 1280;
- height = 720;
+ cur_width = 1280;
+ cur_height = 720;
Log.v(TAG, "Preview resolution hardcoded to 1280x720");
break;
}
case 4: {
- width = 1920;
- height = 1080;
+ cur_width = 1920;
+ cur_height = 1080;
Log.v(TAG, "Preview resolution hardcoded to 1920x1080");
break;
}
@@ -2355,7 +2346,20 @@ public class CaptureModule implements CameraModule, PhotoController,
break;
}
}
- mPreviewSize = new Size(width, height);
+ return new Size(cur_width, cur_height);
+ }
+ private void updatePreviewSize() {
+ int preview_resolution = PersistUtil.getCameraPreviewSize();
+ int width = mPreviewSize.getWidth();
+ int height = mPreviewSize.getHeight();
+
+ String makeup = mSettingsManager.getValue(SettingsManager.KEY_MAKEUP);
+ boolean makeupOn = makeup != null && !makeup.equals("0");
+ if (makeupOn) {
+ width = mVideoSize.getWidth();
+ height = mVideoSize.getHeight();
+ }
+ mPreviewSize = checkOverridePreviewSize(width, height);
mUI.setPreviewSize(mPreviewSize.getWidth(), mPreviewSize.getHeight());
}
@@ -3065,6 +3069,8 @@ public class CaptureModule implements CameraModule, PhotoController,
Size[] prevSizes = mSettingsManager.getSupportedOutputSize(getMainCameraId(),
MediaRecorder.class);
mVideoPreviewSize = getOptimalPreviewSize(mVideoSize, prevSizes);
+ mVideoPreviewSize = checkOverridePreviewSize(mVideoPreviewSize.getWidth(),
+ mVideoPreviewSize.getHeight());
}
private void updateVideoSnapshotSize() {