# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Constants | Methods | Inherited Methods

# CaptureFailure

`public class CaptureFailure`
`extends Object` ``

java.lang.Object
↳ | android.hardware.camera2.CaptureFailure

A report of failed capture for a single image capture from the image sensor.

CaptureFailures are produced by a `CameraDevice` if processing a `CaptureRequest` fails, either partially or fully. Use `getReason()` to determine the specific nature of the failed capture.

Receiving a CaptureFailure means that the metadata associated with that frame number has been dropped -- no `CaptureResult` with the same frame number will be produced.

## Summary

### Constants
`int` | `REASON_ERROR` The `CaptureResult` has been dropped this frame only due to an error in the framework.
`int` | `REASON_FLUSHED` The capture has failed due to a `CameraCaptureSession#abortCaptures` call from the application.

### Public methods
`long` | `getFrameNumber()` Get the frame number associated with this failed capture.
`String` | `getPhysicalCameraId()` The physical camera device ID in case the capture failure comes from a `CaptureRequest` with configured physical camera streams for a logical camera.
`int` | `getReason()` Determine why the request was dropped, whether due to an error or to a user action.
`CaptureRequest` | `getRequest()` Get the request associated with this failed capture.
`int` | `getSequenceId()` The sequence ID for this failed capture that was returned by the `CameraCaptureSession#capture` family of functions.
`boolean` | `wasImageCaptured()` Determine if the image was captured from the camera.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Constants

### REASON_ERROR

    public static final int REASON_ERROR

The `CaptureResult` has been dropped this frame only due to an error in the framework.

See also:

- `getReason()`

Constant Value: 0 (0x00000000)

### REASON_FLUSHED

    public static final int REASON_FLUSHED

The capture has failed due to a `CameraCaptureSession#abortCaptures` call from the application.

See also:

- `getReason()`

Constant Value: 1 (0x00000001)

## Public methods

### getFrameNumber

    public long getFrameNumber ()

Get the frame number associated with this failed capture.

Whenever a request has been processed, regardless of failed capture or success, it gets a unique frame number assigned to its future result/failed capture.

This value monotonically increments, starting with 0, for every new result or failure; and the scope is the lifetime of the `CameraDevice`.

Returns
`long` | long frame number

### getPhysicalCameraId

    public String getPhysicalCameraId ()

The physical camera device ID in case the capture failure comes from a `CaptureRequest` with configured physical camera streams for a logical camera.

Returns
`String` | String The physical camera device ID of the respective failing output. `null` in case the capture request has no associated physical camera device.

See also:

- `CaptureRequest.Builder.setPhysicalCameraKey(CaptureRequest.Key, T, String)`
- `OutputConfiguration.setPhysicalCameraId(String)`

### getReason

    public int getReason ()

Determine why the request was dropped, whether due to an error or to a user action.

Returns
`int` | int The reason code. Value is `REASON_ERROR`, or `REASON_FLUSHED`

See also:

- `REASON_ERROR`
- `REASON_FLUSHED`

### getRequest

    public CaptureRequest getRequest ()

Get the request associated with this failed capture.

Whenever a request is unsuccessfully captured, with `CameraCaptureSession.CaptureCallback#onCaptureFailed`, the `failed capture`'s `getRequest()` will return that `request`.

In particular, ``

    cameraDevice.capture(someRequest, new CaptureCallback() {
         @Override
         void onCaptureFailed(CaptureRequest myRequest, CaptureFailure myFailure) {
             assert(myFailure.getRequest.equals(myRequest) == true);
         }
     };

Returns
`CaptureRequest` | The request associated with this failed capture. Never `null`.

### getSequenceId

    public int getSequenceId ()

The sequence ID for this failed capture that was returned by the `CameraCaptureSession#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 CameraDevice.

Returns
`int` | int The ID for the sequence of requests that this capture failure is the result of

See also:

- `CameraCaptureSession.CaptureCallback.onCaptureSequenceCompleted(CameraCaptureSession, int, long)`

### wasImageCaptured

    public boolean wasImageCaptured ()

Determine 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
`boolean` | boolean True if the image was captured, false otherwise.

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*