Class CaptureFailure¶
- java.lang.Object
-
- com.iristick.smartglass.core.camera.CaptureFailure
public abstract class CaptureFailure extends Object
A report of failed capture for a single image capture from the image sensor.
CaptureFailure
s are produced by a CaptureSession
if processing a
CaptureRequest
fails, either partially or fully. Use getReason()
to determine the specific nature of the failed capture.
No CaptureResult
with the same frame number will be produced.
CaptureFailure
objects are immutable.
Field Summary¶
Modifier and Type | Field and Description |
---|---|
static int |
REASON_ERROR
The capture of this frame has been dropped due to an error in the sensor or framework.
|
static int |
REASON_FLUSHED
The capture has failed due to this request being flushed, when the camera is closed or gets
disconnected.
|
Constructor Summary¶
Constructor and Description |
---|
CaptureFailure() |
Method Summary¶
Modifier and Type | Method and Description |
---|---|
abstract long |
getFrameNumber()
Gets the frame number associated with this failed capture.
|
abstract int |
getReason()
Determines why the request was dropped, whether due to an error or to a user
action.
|
abstract CaptureRequest |
getRequest()
Gets the request associated with this failed capture.
|
abstract int |
getSequenceId()
Gets the sequence ID for this failed capture that was returned by the
CaptureSession.capture family of functions. |
abstract boolean |
wasImageCaptured()
Determines if the image was captured from the camera.
|
Methods inherited from class java.lang.Object¶
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail¶
REASON_ERROR¶
public static final int REASON_ERROR
- See Also:
getReason()
REASON_FLUSHED¶
public static final int REASON_FLUSHED
- See Also:
getReason()
Constructor Detail¶
CaptureFailure¶
public CaptureFailure()
Method Detail¶
getRequest¶
@CheckResult @NonNull public abstract CaptureRequest getRequest()
Gets the request associated with this failed capture.
This is the same request as the one passed as second argument of
CaptureListener.onCaptureFailed(CaptureSession, CaptureRequest, CaptureFailure)
.
In particular,
camera.capture(someRequest, new CaptureAdapter() { @Override void onCaptureFailed(CameraSession camera, CaptureRequest request, CaptureFailure failure) { assert(failure.getRequest().equals(request) == true); } }, null);
- Returns:
- The request associated with this failed capture. Never
null
.
getReason¶
@CheckResult public abstract int getReason()
Determines why the request was dropped, whether due to an error or to a user action.
- Returns:
- One of
REASON_*
integer constants. - See Also:
REASON_ERROR
,REASON_FLUSHED
getSequenceId¶
@CheckResult public abstract int getSequenceId()
Gets the sequence ID for this failed capture that was returned by the
CaptureSession.capture
family of functions.
The sequence ID is a unique monotonically increasing value starting from 0
,
incremented every time a new group of requests is submitted to the CameraSession
.
- Returns:
- The ID for the sequence of requests that this capture failure is part of.
getFrameNumber¶
@CheckResult public abstract long getFrameNumber()
Gets the frame number associated with this failed capture.
Whenever a request has been processed, regardless of its outcome, it gets a unique frame number assigned to its future result/failed capture.
This value increases monotonically, starting with 0, for every new result or failure;
and the scope is the lifetime of the CameraDevice
.
- Returns:
- The frame number.
wasImageCaptured¶
@CheckResult public abstract boolean wasImageCaptured()
Determines if the image was captured from the camera.
If the image was not captured, no image buffers will be available. If the image was captured, then image buffers may be available.
- Returns:
true
if the image was captured,false
otherwise.