diff options
| author | mingwax <mingwax@codeaurora.org> | 2017-03-01 16:33:30 +0800 |
|---|---|---|
| committer | mingwax <mingwax@codeaurora.org> | 2017-03-01 17:28:51 +0800 |
| commit | 2624bca797eaa140b2602909913c19fff548e60c (patch) | |
| tree | 4ae49cce6f95cbf11eb04af7488447653de83470 /src/com/android/camera/CaptureModule.java | |
| parent | 727fdda2c1d3db4cc107825f8e6ab114f60b7064 (diff) | |
SnapdragonCamera: Fix live shot image stretch when recording is 4K
(1) 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.
(2) Fixed the width and height of the panorama image
CRs-Fixed: 2012167
Change-Id: I15d139c6d558923d6b4a32ee3613c44c7a974129
Diffstat (limited to 'src/com/android/camera/CaptureModule.java')
| -rw-r--r--[-rwxr-xr-x] | 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 e4c162a5b..d2545f448 100755..100644 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -4446,8 +4446,14 @@ public class CaptureModule implements CameraModule, PhotoController, 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]; } |
