BlockingCaptureCallbackpublic class BlockingCaptureCallback extends CameraCaptureSession.CaptureCallback A camera capture listener that implements blocking operations on state changes for a
particular capture request.
Provides a waiter that can be used to block until the next unobserved state of the
requested type arrives.
Pass-through all StateListener changes to the proxy. |
Fields Summary |
---|
public static final int | CAPTURE_STARTED{@link #onCaptureStarted} has been called. | public static final int | CAPTURE_PROGRESSED{@link #onCaptureProgressed} has been
called. | public static final int | CAPTURE_COMPLETED{@link #onCaptureCompleted} has
been called. | public static final int | CAPTURE_FAILED{@link #onCaptureFailed} has been
called. | public static final int | CAPTURE_SEQUENCE_COMPLETED{@link #onCaptureSequenceCompleted} has been called. | public static final int | CAPTURE_SEQUENCE_ABORTED{@link #onCaptureSequenceAborted} has been called. | private static final String[] | sStateNames | private static final String | TAG | private static final boolean | VERBOSE | private final CameraCaptureSession.CaptureCallback | mProxy | private final com.android.ex.camera2.utils.StateWaiter | mStateWaiter | private final com.android.ex.camera2.utils.StateChangeListener | mStateChangeListener |
Constructors Summary |
---|
public BlockingCaptureCallback()Create a blocking capture listener without forwarding the capture listener invocations
to another capture listener.
mProxy = null;
| public BlockingCaptureCallback(CameraCaptureSession.CaptureCallback listener)Create a blocking capture listener; forward original listener invocations
into {@code listener}.
if (listener == null) {
throw new NullPointerException("listener must not be null");
}
mProxy = listener;
|
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 | onCaptureCompleted(android.hardware.camera2.CameraCaptureSession session, android.hardware.camera2.CaptureRequest request, android.hardware.camera2.TotalCaptureResult result)
if (mProxy != null) mProxy.onCaptureCompleted(session, request, result);
mStateChangeListener.onStateChanged(CAPTURE_COMPLETED);
| public void | onCaptureFailed(android.hardware.camera2.CameraCaptureSession session, android.hardware.camera2.CaptureRequest request, android.hardware.camera2.CaptureFailure failure)
if (mProxy != null) mProxy.onCaptureFailed(session, request, failure);
mStateChangeListener.onStateChanged(CAPTURE_FAILED);
| public void | onCaptureProgressed(android.hardware.camera2.CameraCaptureSession session, android.hardware.camera2.CaptureRequest request, android.hardware.camera2.CaptureResult partialResult)
if (mProxy != null) mProxy.onCaptureProgressed(session, request, partialResult);
mStateChangeListener.onStateChanged(CAPTURE_PROGRESSED);
| public void | onCaptureSequenceAborted(android.hardware.camera2.CameraCaptureSession session, int sequenceId)
if (mProxy != null) mProxy.onCaptureSequenceAborted(session, sequenceId);
mStateChangeListener.onStateChanged(CAPTURE_SEQUENCE_ABORTED);
| public void | onCaptureSequenceCompleted(android.hardware.camera2.CameraCaptureSession session, int sequenceId, long frameNumber)
if (mProxy != null) mProxy.onCaptureSequenceCompleted(session, sequenceId, frameNumber);
mStateChangeListener.onStateChanged(CAPTURE_SEQUENCE_COMPLETED);
| public void | onCaptureStarted(android.hardware.camera2.CameraCaptureSession session, android.hardware.camera2.CaptureRequest request, long timestamp, long frameNumber)
if (mProxy != null) mProxy.onCaptureStarted(session, request, timestamp, frameNumber);
mStateChangeListener.onStateChanged(CAPTURE_STARTED);
|
|