summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2015-05-13 21:15:09 (GMT)
committerEino-Ville Talvala <etalvala@google.com>2015-05-13 21:15:09 (GMT)
commitebb6c5111f287a8cf55f1dcac7d7c5b76d9260ff (patch)
treebe046fff829e88a595deaeccefe056f5bb893396
parent046ba28a082f30d56a1ac63eaa13b5cf95093db6 (diff)
downloadandroid_frameworks_ex-ebb6c5111f287a8cf55f1dcac7d7c5b76d9260ff.zip
android_frameworks_ex-ebb6c5111f287a8cf55f1dcac7d7c5b76d9260ff.tar.gz
android_frameworks_ex-ebb6c5111f287a8cf55f1dcac7d7c5b76d9260ff.tar.bz2
Camera2: Support onSurfacePrepared in BlockingSessionCallback
Change-Id: Id46c044badb98f7837ca3898758997c171aa5c68
-rw-r--r--camera2/public/src/com/android/ex/camera2/blocking/BlockingSessionCallback.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/camera2/public/src/com/android/ex/camera2/blocking/BlockingSessionCallback.java b/camera2/public/src/com/android/ex/camera2/blocking/BlockingSessionCallback.java
index ae4f40b..0dad0d5 100644
--- a/camera2/public/src/com/android/ex/camera2/blocking/BlockingSessionCallback.java
+++ b/camera2/public/src/com/android/ex/camera2/blocking/BlockingSessionCallback.java
@@ -18,6 +18,7 @@ package com.android.ex.camera2.blocking;
import android.hardware.camera2.CameraCaptureSession;
import android.os.ConditionVariable;
import android.util.Log;
+import android.view.Surface;
import com.android.ex.camera2.exceptions.TimeoutRuntimeException;
import com.android.ex.camera2.utils.StateChangeListener;
@@ -186,6 +187,16 @@ public class BlockingSessionCallback extends CameraCaptureSession.StateCallback
mStateChangeListener.onStateChanged(SESSION_READY);
}
+ @Override
+ public void onSurfacePrepared(CameraCaptureSession session, Surface surface) {
+ mSessionFuture.setSession(session);
+ if (mProxy != null) {
+ mProxy.onSurfacePrepared(session, surface);
+ }
+ // Surface prepared doesn't cause a session state change, so don't trigger the
+ // state change listener
+ }
+
private static class SessionFuture implements Future<CameraCaptureSession> {
private volatile CameraCaptureSession mSession;
ConditionVariable mCondVar = new ConditionVariable(/*opened*/false);