From e0ee63046ad062040aafc977585fb461a2acf666 Mon Sep 17 00:00:00 2001 From: Chien-Yu Chen Date: Mon, 6 Jul 2015 17:46:05 -0700 Subject: ImageWriter: Exception when Surface is abandoned Throw IllegalStateException when queueing or dequeueing an image if the input surface is already abandoned by the consumer. Also fix a crash when planes are not initialized when closing ImageWriter. Bug: 22279111 Change-Id: I8301920d64a53c45b29e947e52ff323733abbf16 --- core/java/android/hardware/camera2/CameraCaptureSession.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/java/android/hardware/camera2') diff --git a/core/java/android/hardware/camera2/CameraCaptureSession.java b/core/java/android/hardware/camera2/CameraCaptureSession.java index c547b06..62ebfb3 100644 --- a/core/java/android/hardware/camera2/CameraCaptureSession.java +++ b/core/java/android/hardware/camera2/CameraCaptureSession.java @@ -497,8 +497,9 @@ public abstract class CameraCaptureSession implements AutoCloseable { * *

Each reprocessable capture session has an input {@link Surface} where the reprocess * capture requests get the input images from, rather than the camera device. The application - * can create a {@link android.media.ImageWriter} with this input {@link Surface} and use it to - * provide input images for reprocess capture requests.

+ * can create a {@link android.media.ImageWriter ImageWriter} with this input {@link Surface} + * and use it to provide input images for reprocess capture requests. When the reprocessable + * capture session is closed, the input {@link Surface} is abandoned and becomes invalid.

* * @return The {@link Surface} where reprocessing capture requests get the input images from. If * this is not a reprocess capture session, {@code null} will be returned. -- cgit v1.1