diff options
author | Sridhar Gujje <sgujje@qti.qualcomm.com> | 2019-02-04 22:28:49 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-02-04 22:28:49 -0800 |
commit | 9e88e44832e3b99e0e3d1a4c194276bd80581024 (patch) | |
tree | bc5cfc56f14d955348b976c38cc4e953af53bfd7 /src/com/android/camera/CaptureModule.java | |
parent | b5d931a976f062347880ea6973ee110688421da2 (diff) | |
parent | 46e372e609e1db83fa4f772be88fb553512e725d (diff) | |
download | android_packages_apps_Snap-9e88e44832e3b99e0e3d1a4c194276bd80581024.tar.gz android_packages_apps_Snap-9e88e44832e3b99e0e3d1a4c194276bd80581024.tar.bz2 android_packages_apps_Snap-9e88e44832e3b99e0e3d1a4c194276bd80581024.zip |
Merge "SnapdraongCamera:Fix HEIF longshot" into camera-SnapdragonCamera.lnx.2.0
Diffstat (limited to 'src/com/android/camera/CaptureModule.java')
-rwxr-xr-x | src/com/android/camera/CaptureModule.java | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index 2ef56a3b6..3687b37ea 100755 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -2390,30 +2390,37 @@ public class CaptureModule implements CameraModule, PhotoController, @Override public void onCaptureSequenceCompleted(CameraCaptureSession session, int sequenceId, long frameNumber) { - if(mLongshotActive) { - captureStillPicture(getMainCameraId()); - } else { - mLongshoting = false; - mNumFramesArrived.getAndSet(0); - unlockFocus(getMainCameraId()); - } if (mSettingsManager.getSavePictureFormat() == SettingsManager.HEIF_FORMAT) { + mLongshotActive = false; if (mHeifImage != null) { try { - mHeifImage.getWriter().stop(3000); + mHeifImage.getWriter().stop(5000); mHeifImage.getWriter().close(); - mHeifOutput.removeSurface(mHeifImage.getInputSurface()); - session.updateOutputConfiguration(mHeifOutput); mActivity.getMediaSaveService().addHEIFImage(mHeifImage.getPath(), mHeifImage.getTitle(),mHeifImage.getDate(),null,mPictureSize.getWidth(),mPictureSize.getHeight(), mHeifImage.getOrientation(),null,mContentResolver,mOnMediaSavedListener,mHeifImage.getQuality(),"heifs"); - mHeifImage = null; - } catch (TimeoutException | IllegalStateException e) { - e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); + } finally { + try{ + mHeifOutput.removeSurface(mHeifImage.getInputSurface()); + session.updateOutputConfiguration(mHeifOutput); + mHeifImage = null; + }catch (CameraAccessException e) { + e.printStackTrace(); + }catch (Exception e) { + e.printStackTrace(); + } } } + + } + if(mLongshotActive) { + captureStillPicture(getMainCameraId()); + } else { + mLongshoting = false; + mNumFramesArrived.getAndSet(0); + unlockFocus(getMainCameraId()); } } }; @@ -2479,16 +2486,21 @@ public class CaptureModule implements CameraModule, PhotoController, try { mHeifImage.getWriter().stop(3000); mHeifImage.getWriter().close(); - mHeifOutput.removeSurface(mHeifImage.getInputSurface()); - mCaptureSession[id].updateOutputConfiguration(mHeifOutput); mActivity.getMediaSaveService().addHEIFImage(mHeifImage.getPath(), mHeifImage.getTitle(),mHeifImage.getDate(),null,mPictureSize.getWidth(),mPictureSize.getHeight(), mHeifImage.getOrientation(),null,mContentResolver,mOnMediaSavedListener,mHeifImage.getQuality(),"heif"); - mHeifImage = null; - } catch (TimeoutException | IllegalStateException e) { - e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); + } finally { + try{ + mHeifOutput.removeSurface(mHeifImage.getInputSurface()); + mCaptureSession[id].updateOutputConfiguration(mHeifOutput); + mHeifImage = null; + } catch (CameraAccessException e) { + e.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + } } } } |