diff options
author | mingwax <mingwax@codeaurora.org> | 2017-03-09 16:40:22 +0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-03-12 19:15:25 -0700 |
commit | bebfa961e414299d2d46095e0786412e5e62300e (patch) | |
tree | 7f1d9d9b8f6889f59e5f50d1a34f9ac473ecaaf9 /src/com/android/camera/util | |
parent | 3f0720bf770b55231b93cb1e1c39e28e0f2c219b (diff) | |
download | android_packages_apps_Snap-bebfa961e414299d2d46095e0786412e5e62300e.tar.gz android_packages_apps_Snap-bebfa961e414299d2d46095e0786412e5e62300e.tar.bz2 android_packages_apps_Snap-bebfa961e414299d2d46095e0786412e5e62300e.zip |
SnapdragonCamera: Fix ghosting when non-zsl in VGA/QVGA size
(1) Increase the size of the preivewSize according to the ratio of
the pictureSize.
(2) Change the mVideoSnapshotSize from the mPictureSize to mVideoSize.
(3) Reconstruction the getMaxPictureSizeLessThan4K method.
CRs-Fixed: 1116242
Change-Id: Ic7dbab23fd0ee083cd38818fa39f4893de7c1d24
Diffstat (limited to 'src/com/android/camera/util')
-rw-r--r-- | src/com/android/camera/util/CameraUtil.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/com/android/camera/util/CameraUtil.java b/src/com/android/camera/util/CameraUtil.java index f6591a6db..3b0d5e6ac 100644 --- a/src/com/android/camera/util/CameraUtil.java +++ b/src/com/android/camera/util/CameraUtil.java @@ -587,9 +587,18 @@ public class CameraUtil { Point size = sizes[i]; double ratio = (double) size.x / size.y; if (Math.abs(ratio - targetRatio) > ASPECT_TOLERANCE) continue; - if (Math.abs(size.y - targetHeight) < minDiff) { + + double heightDiff = Math.abs(size.y - targetHeight); + if (heightDiff < minDiff) { optimalSizeIndex = i; minDiff = Math.abs(size.y - targetHeight); + } else if (heightDiff == minDiff) { + // Prefer resolutions smaller-than-display when an equally close + // larger-than-display resolution is available + if (size.y < targetHeight) { + optimalSizeIndex = i; + minDiff = heightDiff; + } } } // Cannot find the one match the aspect ratio. This should not happen. |