Fields Summary |
---|
public static final int | SESSION_CONFIGUREDSession is configured, ready for captures |
public static final int | SESSION_CONFIGURE_FAILEDSession has failed to configure, can't do any captures |
public static final int | SESSION_READYSession is ready |
public static final int | SESSION_ACTIVESession is active (transitory) |
public static final int | SESSION_CLOSEDSession is closed |
private final int | NUM_STATES |
private static final String | TAG |
private static final boolean | VERBOSE |
private final CameraCaptureSession.StateCallback | mProxy |
private final SessionFuture | mSessionFuture |
private final com.android.ex.camera2.utils.StateWaiter | mStateWaiter |
private final com.android.ex.camera2.utils.StateChangeListener | mStateChangeListener |
private static final String[] | sStateNames |
Methods Summary |
---|
public com.android.ex.camera2.utils.StateWaiter | getStateWaiter()Acquire the state waiter; can be used to block until a set of state transitions have
been reached.
Only one thread should wait at a time.
return mStateWaiter;
|
public void | onActive(android.hardware.camera2.CameraCaptureSession session)
mSessionFuture.setSession(session);
if (mProxy != null) mProxy.onActive(session);
mStateChangeListener.onStateChanged(SESSION_ACTIVE);
|
public void | onClosed(android.hardware.camera2.CameraCaptureSession session)
mSessionFuture.setSession(session);
if (mProxy != null) mProxy.onClosed(session);
mStateChangeListener.onStateChanged(SESSION_CLOSED);
|
public void | onConfigureFailed(android.hardware.camera2.CameraCaptureSession session)
mSessionFuture.setSession(session);
if (mProxy != null) mProxy.onConfigureFailed(session);
mStateChangeListener.onStateChanged(SESSION_CONFIGURE_FAILED);
|
public void | onConfigured(android.hardware.camera2.CameraCaptureSession session)
mSessionFuture.setSession(session);
if (mProxy != null) mProxy.onConfigured(session);
mStateChangeListener.onStateChanged(SESSION_CONFIGURED);
|
public void | onReady(android.hardware.camera2.CameraCaptureSession session)
mSessionFuture.setSession(session);
if (mProxy != null) mProxy.onReady(session);
mStateChangeListener.onStateChanged(SESSION_READY);
|
public android.hardware.camera2.CameraCaptureSession | waitAndGetSession(long timeoutMs)Return session if already have it; otherwise wait until any of the session listener
invocations fire and the session is available.
Does not consume any of the states from the state waiter.
try {
return mSessionFuture.get(timeoutMs, TimeUnit.MILLISECONDS);
} catch (TimeoutException e) {
throw new TimeoutRuntimeException(
String.format("Failed to get session after %s milliseconds", timeoutMs), e);
}
|