diff options
-rwxr-xr-x | src/com/android/camera/CameraHolder.java | 3 | ||||
-rw-r--r-- | src/com/android/camera/CaptureModule.java | 18 | ||||
-rwxr-xr-x | src/com/android/camera/imageprocessor/PostProcessor.java | 10 |
3 files changed, 23 insertions, 8 deletions
diff --git a/src/com/android/camera/CameraHolder.java b/src/com/android/camera/CameraHolder.java index 59b305bc6..d5167af5b 100755 --- a/src/com/android/camera/CameraHolder.java +++ b/src/com/android/camera/CameraHolder.java @@ -184,6 +184,9 @@ public class CameraHolder { int facing = characteristics.get(CameraCharacteristics.LENS_FACING); if (facing == CameraCharacteristics.LENS_FACING_FRONT) { CaptureModule.FRONT_ID = i; + mFrontCameraId = i; + } else if (mBackCameraId != -1) { + mBackCameraId = i; } mCharacteristics.add(i, characteristics); } diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index 9e340a022..a16b769a7 100644 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -1899,12 +1899,11 @@ public class CaptureModule implements CameraModule, PhotoController, private void takePicture() { Log.d(TAG, "takePicture"); mUI.enableShutter(false); - if ((mSettingsManager.isZSLInHALEnabled() && + if ((mSettingsManager.isZSLInHALEnabled() || isActionImageCapture()) && !isFlashOn(getMainCameraId()) && (mPreviewCaptureResult != null && mPreviewCaptureResult.get(CaptureResult.CONTROL_AE_STATE) != CameraMetadata.CONTROL_AE_STATE_FLASH_REQUIRED && - mPreviewCaptureResult.getRequest().get(CaptureRequest.CONTROL_AE_LOCK) != Boolean.TRUE)) || - isActionImageCapture()) { + mPreviewCaptureResult.getRequest().get(CaptureRequest.CONTROL_AE_LOCK) != Boolean.TRUE)) { takeZSLPictureInHAL(); } else { if (isBackCamera()) { @@ -2338,6 +2337,12 @@ public class CaptureModule implements CameraModule, PhotoController, } } + public void doShutterAnimation() { + if (mUI != null) { + mUI.doShutterAnimation(); + } + } + private CameraCaptureSession.CaptureCallback mLongshotCallBack= new CameraCaptureSession.CaptureCallback() { @Override public void onCaptureCompleted(CameraCaptureSession session, @@ -2751,6 +2756,7 @@ public class CaptureModule implements CameraModule, PhotoController, if (mLongshoting && (!mLongshotActive) && image.getTimestamp() > mLastLongshotTimestamp) { image.close(); + Log.d(TAG, "image duplicate mLastLongshotTimestamp "); return; } if (mSettingsManager.getSavePictureFormat() == SettingsManager.HEIF_FORMAT) { @@ -3545,17 +3551,13 @@ public class CaptureModule implements CameraModule, PhotoController, mFrameProcessor.onOpen(getFrameProcFilterId(), mPreviewSize); } - if(mPostProcessor.isZSLEnabled()) { + if(mPostProcessor.isZSLEnabled() && !isActionImageCapture()) { mChosenImageFormat = ImageFormat.PRIVATE; } else if(mPostProcessor.isFilterOn() || getFrameFilters().size() != 0 || mPostProcessor.isSelfieMirrorOn()) { mChosenImageFormat = ImageFormat.YUV_420_888; } else { mChosenImageFormat = ImageFormat.JPEG; } - // if intent action is ACTION_IMAGE_CAPTURE, use HAL-ZSL to capture - if (isActionImageCapture()) { - mChosenImageFormat = ImageFormat.JPEG; - } setUpCameraOutputs(mChosenImageFormat); } diff --git a/src/com/android/camera/imageprocessor/PostProcessor.java b/src/com/android/camera/imageprocessor/PostProcessor.java index e3d1c62a7..fe9f1c9d9 100755 --- a/src/com/android/camera/imageprocessor/PostProcessor.java +++ b/src/com/android/camera/imageprocessor/PostProcessor.java @@ -587,6 +587,16 @@ public class PostProcessor{ CaptureRequest request, TotalCaptureResult result) { Log.d(TAG, "reprocessImage onCaptureCompleted"); + if (mActivity != null) { + mActivity.runOnUiThread(new Runnable() { + @Override + public void run() { + if (mController != null) { + mController.doShutterAnimation(); + } + } + }); + } } @Override |