summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjunjiez <junjiez@codeaurora.org>2017-11-17 15:22:06 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-12-20 17:48:22 -0800
commitd816712beadb0c288b058fcd8ed93fda2469e2a5 (patch)
treeb37cfcf082d6ae2c5fa40bdf30fbb2e78d3ef221
parent7e1395551d76b3cd4f34c5e2b216b7c0dceef150 (diff)
downloadandroid_packages_apps_Snap-d816712beadb0c288b058fcd8ed93fda2469e2a5.tar.gz
android_packages_apps_Snap-d816712beadb0c288b058fcd8ed93fda2469e2a5.tar.bz2
android_packages_apps_Snap-d816712beadb0c288b058fcd8ed93fda2469e2a5.zip
SnapdragonCamera:Fix RS issue
ensure the surface is valid before set it to the output alloaction. Change-Id: I70751ae36b5bd2133b19110345a65f2621d5dc78
-rwxr-xr-x[-rw-r--r--]src/com/android/camera/imageprocessor/FrameProcessor.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/com/android/camera/imageprocessor/FrameProcessor.java b/src/com/android/camera/imageprocessor/FrameProcessor.java
index 6b0c97732..2e7ded169 100644..100755
--- a/src/com/android/camera/imageprocessor/FrameProcessor.java
+++ b/src/com/android/camera/imageprocessor/FrameProcessor.java
@@ -59,7 +59,7 @@ import java.util.concurrent.Semaphore;
import org.codeaurora.snapcam.R;
public class FrameProcessor {
-
+ private static final String TAG = "FrameProcessor";
private ImageReader mInputImageReader;
private Allocation mInputAllocation;
private Allocation mProcessAllocation;
@@ -326,7 +326,11 @@ public class FrameProcessor {
public void setOutputSurface(Surface surface) {
mSurfaceAsItIs = surface;
if (mFinalFilters.size() != 0) {
- mOutputAllocation.setSurface(surface);
+ if (surface != null && surface.isValid()) {
+ mOutputAllocation.setSurface(surface);
+ } else {
+ Log.d(TAG,"OutputSurface is not valid");
+ }
}
}
@@ -352,7 +356,11 @@ public class FrameProcessor {
mVideoOutputAllocation = Allocation.createTyped(mRs, rgbTypeBuilder.create(),
Allocation.USAGE_SCRIPT | Allocation.USAGE_IO_OUTPUT);
}
- mVideoOutputAllocation.setSurface(surface);
+ if (surface != null && surface.isValid()) {
+ mVideoOutputAllocation.setSurface(surface);
+ } else {
+ Log.d(TAG,"Video outputSurface is not valid");
+ }
}
}
}