Class CaptureFailure¶
- java.lang.Object
-
- com.iristick.smartglass.support.camera2.CaptureFailure
com.iristick.smartglass.core.camera
package instead.@Deprecated 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 CameraCaptureSession
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.
- Since:
- Android API level 21
Field Summary¶
Modifier and Type | Field and Description |
---|---|
static int |
REASON_ERROR
Deprecated.
The capture of this frame has been dropped due to an error in the sensor or framework.
|
static int |
REASON_FLUSHED
Deprecated.
The capture has failed due to this request being flushed, when the camera is closed or gets
disconnected.
|
Method Summary¶
Modifier and Type | Method and Description |
---|---|
abstract long |
getFrameNumber()
Deprecated.
Gets the frame number associated with this failed capture.
|
abstract int |
getReason()
Deprecated.
Determines why the request was dropped, whether due to an error or to a user
action.
|
abstract CaptureRequest |
getRequest()
Deprecated.
Gets the request associated with this failed capture.
|
abstract int |
getSequenceId()
Deprecated.
Gets the sequence ID for this failed capture that was returned by the
CaptureSession.capture family of functions. |
abstract boolean |
wasImageCaptured()
Deprecated.
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()
Method Detail¶
getRequest¶
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
CameraCaptureSession.CaptureCallback.onCaptureFailed(CameraCaptureSession, 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¶
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¶
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¶
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¶
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.