diff options
author | codeworkx <codeworkx@cyanogenmod.org> | 2016-12-26 20:47:16 +0100 |
---|---|---|
committer | Daniel Hillenbrand <daniel.hillenbrand@codeworkx.de> | 2017-02-18 14:47:11 +0000 |
commit | f17e1272d105ab76cc2fad56c491b2911c1a4e17 (patch) | |
tree | 8f284cf698c51696f76015ae371d1697b4982d33 /src/com/android/camera/imageprocessor | |
parent | 27f8676f2dc16f8e611857937eb4d91d0ced5597 (diff) | |
download | android_packages_apps_Snap-f17e1272d105ab76cc2fad56c491b2911c1a4e17.tar.gz android_packages_apps_Snap-f17e1272d105ab76cc2fad56c491b2911c1a4e17.tar.bz2 android_packages_apps_Snap-f17e1272d105ab76cc2fad56c491b2911c1a4e17.zip |
Snap: CaptureModule: check if ZSL is supported before using it
Change-Id: Ifde34ce367ceeb19ad71bcff0c4518d578bb52a5
Diffstat (limited to 'src/com/android/camera/imageprocessor')
-rw-r--r-- | src/com/android/camera/imageprocessor/PostProcessor.java | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/com/android/camera/imageprocessor/PostProcessor.java b/src/com/android/camera/imageprocessor/PostProcessor.java index 74372d70a..cd07cb64c 100644 --- a/src/com/android/camera/imageprocessor/PostProcessor.java +++ b/src/com/android/camera/imageprocessor/PostProcessor.java @@ -116,11 +116,19 @@ public class PostProcessor{ private CameraDevice mCameraDevice; private CameraCaptureSession mCaptureSession; private ImageReader mImageReader; - private boolean mUseZSL = true; + private boolean mUseZSL = false; private Handler mZSLHandler; private HandlerThread mZSLHandlerThread; private ImageHandlerTask mImageHandlerTask; + private void checkAndEnableZSL(int cameraId) { + if (mController.mSettingsManager.isZslSupported(cameraId)) { + mUseZSL = true; + } else { + mUseZSL = false; + } + } + public boolean isZSLEnabled() { return mUseZSL; } @@ -305,6 +313,7 @@ public class PostProcessor{ public PostProcessor(CameraActivity activity, CaptureModule module) { mController = module; mActivity = activity; + checkAndEnableZSL(mController.getMainCameraId()); mNamedImages = new PhotoModule.NamedImages(); } @@ -343,13 +352,19 @@ public class PostProcessor{ public void onOpen(int postFilterId, boolean isLongShotOn, boolean isFlashModeOn) { mImageHandlerTask = new ImageHandlerTask(); - if(setFilter(postFilterId) || isLongShotOn || isFlashModeOn) { - mUseZSL = false; + if (mController.mSettingsManager.isZslSupported(mController.getMainCameraId())) { + if (setFilter(postFilterId) || isLongShotOn || isFlashModeOn) { + mUseZSL = false; + } else { + mUseZSL = true; + } } else { - mUseZSL = true; + mUseZSL = false; } + startBackgroundThread(); - if(mUseZSL) { + + if (mUseZSL) { mZSLQueue = new ZSLQueue(mController); } } @@ -360,13 +375,13 @@ public class PostProcessor{ public void onClose() { synchronized (lock) { - if(mHandler != null) { + if (mHandler != null) { mHandler.setInActive(); } stopBackgroundThread(); } setFilter(FILTER_NONE); - if(mZSLQueue != null) { + if (mZSLQueue != null) { mZSLQueue.onClose(); mZSLQueue = null; } |