diff options
author | mingwax <mingwax@codeaurora.org> | 2017-03-01 16:33:30 +0800 |
---|---|---|
committer | Arne Coucheron <arco68@gmail.com> | 2017-06-13 07:18:49 +0200 |
commit | 202f50ab965cf3bdb65ca1c236146da8ccda0ed8 (patch) | |
tree | 07d46262c05d81ef7ea41fae86d5ab928f948193 | |
parent | fffbe39d98024cae932df964c9a587104397f2de (diff) | |
download | android_packages_apps_Snap-202f50ab965cf3bdb65ca1c236146da8ccda0ed8.tar.gz android_packages_apps_Snap-202f50ab965cf3bdb65ca1c236146da8ccda0ed8.tar.bz2 android_packages_apps_Snap-202f50ab965cf3bdb65ca1c236146da8ccda0ed8.zip |
SnapdragonCamera: Fix live shot image stretch when recording is 4K
When the video is seted 4K UHD, the mVideoSnapshotSize should
be setted the similar aspect ratio to ensure the picture which live
shotted is not stretched.
CRs-Fixed: 2012167
Change-Id: I15d139c6d558923d6b4a32ee3613c44c7a974129
-rw-r--r-- | src/com/android/camera/CaptureModule.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index 6505a4a5c..cfb064c07 100644 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -3407,8 +3407,14 @@ public class CaptureModule extends BaseModule<CaptureUI> implements PhotoControl private Size getMaxPictureSizeLessThan4k() { Size[] sizes = mSettingsManager.getSupportedOutputSize(getMainCameraId(), ImageFormat.JPEG); + float ratio = (float) mVideoSize.getWidth() / mVideoSize.getHeight(); for (Size size : sizes) { - if (!is4kSize(size)) return size; + if (!is4kSize(size)) { + float pictureRatio = (float) size.getWidth() / size.getHeight(); + if (Math.abs(pictureRatio - ratio) < 0.01) { + return size; + } + } } return sizes[sizes.length - 1]; } |