public interface

SessionProcessor.CaptureCallback

 androidx.camera.core.impl.SessionProcessor.CaptureCallback

Overview

Callback for SessionProcessor.startRepeating(TagBundle, SessionProcessor.CaptureCallback) and SessionProcessor.startCapture(boolean, TagBundle, SessionProcessor.CaptureCallback).

Summary

Methods
public voidonCaptureCompleted(long timestamp, int captureSequenceId, CameraCaptureResult captureResult)

Capture result callback that needs to be called when the process capture results are ready as part of frame post-processing.

public voidonCaptureFailed(int captureSequenceId)

This method is called instead of SessionProcessor.CaptureCallback.onCaptureProcessStarted(int) when the camera device failed to produce the required input image.

public voidonCaptureProcessProgressed(int progress)

Capture progress callback that needs to be called when the process capture is ongoing and includes the estimated progress of the processing.

public voidonCaptureProcessStarted(int captureSequenceId)

This method is called when an image (or images in case of multi-frame capture) is captured and device-specific extension processing is triggered.

public voidonCaptureSequenceAborted(int captureSequenceId)

This method is called when a capture sequence aborts.

public voidonCaptureSequenceCompleted(int captureSequenceId)

This method is called independently of the others in the CaptureCallback, when a capture sequence finishes.

public voidonCaptureStarted(int captureSequenceId, long timestamp)

This method is called when the camera has started capturing the initial input image.

Methods

public void onCaptureStarted(int captureSequenceId, long timestamp)

This method is called when the camera has started capturing the initial input image. For a multi-frame capture, the method is called when the onCaptureStarted of first frame is called and its timestamp is directly forwarded to timestamp parameter of this method.

Parameters:

captureSequenceId: id of the current capture sequence
timestamp: the timestamp at start of capture for repeating request or the timestamp at start of capture of the first frame in a multi-frame capture, in nanoseconds.

public void onCaptureProcessStarted(int captureSequenceId)

This method is called when an image (or images in case of multi-frame capture) is captured and device-specific extension processing is triggered.

Parameters:

captureSequenceId: id of the current capture sequence

public void onCaptureFailed(int captureSequenceId)

This method is called instead of SessionProcessor.CaptureCallback.onCaptureProcessStarted(int) when the camera device failed to produce the required input image. The cause could be a failed camera capture request, a failed capture result or dropped camera frame.

Parameters:

captureSequenceId: id of the current capture sequence

public void onCaptureSequenceCompleted(int captureSequenceId)

This method is called independently of the others in the CaptureCallback, when a capture sequence finishes.

In total, there will be at least one SessionProcessor.CaptureCallback.onCaptureProcessStarted(int)/ SessionProcessor.CaptureCallback.onCaptureFailed(int) invocation before this callback is triggered. If the capture sequence is aborted before any requests have begun processing, SessionProcessor.CaptureCallback.onCaptureSequenceAborted(int) is invoked instead.

Parameters:

captureSequenceId: id of the current capture sequence

public void onCaptureSequenceAborted(int captureSequenceId)

This method is called when a capture sequence aborts.

Parameters:

captureSequenceId: id of the current capture sequence

public void onCaptureCompleted(long timestamp, int captureSequenceId, CameraCaptureResult captureResult)

Capture result callback that needs to be called when the process capture results are ready as part of frame post-processing. This callback will fire after SessionProcessor.CaptureCallback.onCaptureStarted(int, long), SessionProcessor.CaptureCallback.onCaptureProcessStarted(int) and before SessionProcessor.CaptureCallback.onCaptureSequenceCompleted(int). The callback is not expected to fire in case of capture failure SessionProcessor.CaptureCallback.onCaptureFailed(int) or capture abort SessionProcessor.CaptureCallback.onCaptureSequenceAborted(int).

Parameters:

timestamp: The timestamp at start of capture. The same timestamp value passed to SessionProcessor.CaptureCallback.onCaptureStarted(int, long).
captureSequenceId: the capture id of the request that generated the capture results. This is the return value of either SessionProcessor.startRepeating(TagBundle, SessionProcessor.CaptureCallback) or SessionProcessor.startCapture(boolean, TagBundle, SessionProcessor.CaptureCallback).
captureResult: the capture result that contains the metadata and the timestamp of the capture.

public void onCaptureProcessProgressed(int progress)

Capture progress callback that needs to be called when the process capture is ongoing and includes the estimated progress of the processing.

Extensions must ensure that they always call this callback with monotonically increasing values.

Extensions are allowed to trigger this callback multiple times but at the minimum the callback is expected to be called once when processing is done with value 100.

Parameters:

progress: Value between 0 and 100.