Class CaptureAdapter¶
- java.lang.Object
-
- com.iristick.smartglass.core.camera.CaptureAdapter
- All Implemented Interfaces:
- CaptureListener
CaptureListener2
instead.@Deprecated public abstract class CaptureAdapter extends Object implements CaptureListener
An abstract adapter class for tracking the progress of a CaptureRequest
submitted to a camera session.
The methods in this class are empty. This class exists as convenience for creating listener objects.
- See Also:
CaptureListener2
Constructor Summary¶
Constructor and Description |
---|
CaptureAdapter()
Deprecated.
|
Method Summary¶
Modifier and Type | Method and Description |
---|---|
void |
onCaptureBufferLost(CaptureSession session,
CaptureRequest request,
Surface surface,
long frameNumber)
Deprecated.
Called when a buffer for capture could not be sent to its destination surface.
|
void |
onCaptureCompleted(CaptureSession session,
CaptureRequest request,
CaptureResult result)
Deprecated.
Called when an image capture has successfully completed.
|
void |
onCaptureFailed(CaptureSession session,
CaptureRequest request,
CaptureFailure failure)
Deprecated.
Called instead of
onCaptureCompleted when the
session failed to produce a CaptureResult for the request. |
void |
onCaptureSequenceAborted(CaptureSession session,
int sequenceId)
Deprecated.
Called when a capture sequence aborts before any
CaptureResult
or CaptureFailure for it have been returned via this listener. |
void |
onCaptureSequenceCompleted(CaptureSession session,
int sequenceId,
long frameNumber)
Deprecated.
Called when a capture sequence finishes and all
CaptureResult
or CaptureFailure for it have been returned via this listener. |
void |
onCaptureStarted(CaptureSession session,
CaptureRequest request,
long timestamp,
long frameNumber)
Deprecated.
Called when an image capture is started.
|
Methods inherited from class java.lang.Object¶
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail¶
CaptureAdapter¶
public CaptureAdapter()
Method Detail¶
onCaptureStarted¶
public void onCaptureStarted(@NonNull CaptureSession session, @NonNull CaptureRequest request, long timestamp, long frameNumber)
CaptureListener
Called when an image capture is started.
This callback is invoked when the capture of a frame begins, so it is the most appropriate time for playing a shutter sound or triggering UI indicators.
- Specified by:
onCaptureStarted
in interfaceCaptureListener
- Parameters:
session
- The session.request
- The request that was given tosession
.timestamp
- Deprecated! This timestamp should not be used as it is not related to theCaptureResult.SENSOR_TIMESTAMP
value of a completed frame. This argument may be removed in future SDK releases.frameNumber
- The frame number for this capture.
onCaptureBufferLost¶
public void onCaptureBufferLost(@NonNull CaptureSession session, @NonNull CaptureRequest request, @NonNull Surface surface, long frameNumber)
CaptureListener
Called when a buffer for capture could not be sent to its destination surface.
When the whole request fails, onCaptureFailed
is called instead.
- Specified by:
onCaptureBufferLost
in interfaceCaptureListener
- Parameters:
session
- The session.request
- The request that was given tosession
.surface
- The target output surface for which the capture failed.frameNumber
- The frame number for this capture.
onCaptureCompleted¶
public void onCaptureCompleted(@NonNull CaptureSession session, @NonNull CaptureRequest request, @NonNull CaptureResult result)
CaptureListener
Called when an image capture has successfully completed.
- Specified by:
onCaptureCompleted
in interfaceCaptureListener
- Parameters:
session
- The session.request
- The request that was given tosession
.result
- The result from the capture, including the frame number.
onCaptureFailed¶
public void onCaptureFailed(@NonNull CaptureSession session, @NonNull CaptureRequest request, @NonNull CaptureFailure failure)
CaptureListener
Called instead of onCaptureCompleted
when the
session failed to produce a CaptureResult
for the request.
Other requests are unaffected, and some or all image buffers from the capture may have been pushed to their respective output streams.
- Specified by:
onCaptureFailed
in interfaceCaptureListener
- Parameters:
session
- The session.request
- The request that was given tosession
.failure
- The output failure from the capture, including the failure reason and the frame number.
onCaptureSequenceCompleted¶
public void onCaptureSequenceCompleted(@NonNull CaptureSession session, int sequenceId, long frameNumber)
CaptureListener
Called when a capture sequence finishes and all CaptureResult
or CaptureFailure
for it have been returned via this listener.
If the capture sequence is aborted before any requests have been processed,
onCaptureSequenceAborted
is invoked instead.
- Specified by:
onCaptureSequenceCompleted
in interfaceCaptureListener
- Parameters:
session
- The session.sequenceId
- A sequence ID returned by theCameraSession.capture
family of functions.frameNumber
- The last frame number (returned byCaptureResult.getFrameNumber()
orCaptureFailure.getFrameNumber()
) in the capture sequence.
onCaptureSequenceAborted¶
public void onCaptureSequenceAborted(@NonNull CaptureSession session, int sequenceId)
CaptureListener
Called when a capture sequence aborts before any CaptureResult
or CaptureFailure
for it have been returned via this listener.
Due to the asynchronous nature of the session device, not all submitted captures
are immediately processed. Pending requests may be cleared out when the session is closed
or gets disconnected. When such an event happens,
onCaptureCompleted
, onCaptureFailed
and
onCaptureSequenceCompleted
will not be called.
- Specified by:
onCaptureSequenceAborted
in interfaceCaptureListener
- Parameters:
session
- The session.sequenceId
- A sequence ID returned by theCameraSession.capture
family of functions.