CameraOfflineSession

public abstract class CameraOfflineSession
extends CameraCaptureSession

java.lang.Object
   ↳ android.hardware.camera2.CameraCaptureSession
     ↳ android.hardware.camera2.CameraOfflineSession


A camera capture session that was switched to offline mode via successful call to CameraCaptureSession#switchToOffline.

Offline capture sessions allow clients to select a set of camera registered surfaces that support offline mode. After a successful offline mode switch all non-repeating pending requests on those surfaces will continue to be processed by the camera stack even if clients close the corresponding camera device.

Offline capture session instances will replace the previously active capture session arguments in all capture callbacks after CameraCaptureSession#switchToOffline completes.

Processing of pending offline capture requests will begin only after the offline session moves to ready state which will be indicated by the CameraOfflineSessionCallback#onReady callback.

In contrast to a regular CameraCaptureSession an offline capture session will not accept any further capture requests. Besides CameraOfflineSession#close all remaining methods will throw UnsupportedOperationException and are not supported.

Summary

Nested classes

class CameraOfflineSession.CameraOfflineSessionCallback

 

Public constructors

CameraOfflineSession()

Public methods

abstract void close()

Close this offline capture session.

Inherited methods

Public constructors

CameraOfflineSession

public CameraOfflineSession ()

Public methods

close

Added in API level 30
public abstract void close ()

Close this offline capture session.

Abort all pending offline requests and close the connection to the offline camera session as quickly as possible.

This method can be called only after clients receive CameraOfflineSessionCallback#onReady.

Immediately after this call, besides the final CameraOfflineSessionCallback#onClosed notification, no further callbacks from the offline session will be triggered and all remaining offline capture requests will be discarded.

Closing a session is idempotent; closing more than once has no effect.

Throws
IllegalStateException if the offline session is not ready.