From 36a419d399f894914dec54dfb93cc7e6005ce175 Mon Sep 17 00:00:00 2001 From: junjiez Date: Tue, 2 May 2017 15:08:57 +0800 Subject: SnapdragonCamera: fix crash in HFR ConstrainedHighSpeedCaptureSession only supports some particular sizes, unsupported sizes will cause crash. When HFR is enabled, using video siez as preivew size to avoid crash. Change-Id: I9dad9690c2fc5a3fd25b758a7c3e0d892d63e35b CRs-Fixed: 2038913 --- src/com/android/camera/CaptureModule.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/com/android/camera/CaptureModule.java') diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index 346a818d3..3e3807b42 100644 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -3138,8 +3138,13 @@ public class CaptureModule implements CameraModule, PhotoController, mControlAFMode = CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE; closePreviewSession(); mFrameProcessor.onClose(); - boolean changed = mUI.setPreviewSize(mVideoPreviewSize.getWidth(), - mVideoPreviewSize.getHeight()); + + Size preview = mVideoPreviewSize; + if (mHighSpeedCapture) { + preview = mVideoSize; + } + boolean changed = mUI.setPreviewSize(preview.getWidth(), + preview.getHeight()); if (changed) { mUI.hideSurfaceView(); mUI.showSurfaceView(); -- cgit v1.2.3