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

Public constructors

CameraOfflineSession()

Public methods

abstract void close()

Close this offline capture session.

Inherited methods

abstract void abortCaptures()

Discard all captures currently pending and in-progress as fast as possible.

abstract int capture(CaptureRequest request, CameraCaptureSession.CaptureCallback listener, Handler handler)

Submit a request for an image to be captured by the camera device.

abstract int captureBurst(List<CaptureRequest> requests, CameraCaptureSession.CaptureCallback listener, Handler handler)

Submit a list of requests to be captured in sequence as a burst.

int captureBurstRequests(List<CaptureRequest> requests, Executor executor, CameraCaptureSession.CaptureCallback listener)

Submit a list of requests to be captured in sequence as a burst.

int captureSingleRequest(CaptureRequest request, Executor executor, CameraCaptureSession.CaptureCallback listener)

Submit a request for an image to be captured by the camera device.

abstract void close()

Close this capture session asynchronously.

abstract void finalizeOutputConfigurations(List<OutputConfiguration> outputConfigs)

Finalize the output configurations that now have their deferred and/or extra Surfaces included.

abstract CameraDevice getDevice()

Get the camera device that this session is created for.

abstract Surface getInputSurface()

Get the input Surface associated with a reprocessable capture session.

abstract boolean isReprocessable()

Return if the application can submit reprocess capture requests with this camera capture session.

abstract void prepare(Surface surface)

Pre-allocate all buffers for an output Surface.

abstract int setRepeatingBurst(List<CaptureRequest> requests, CameraCaptureSession.CaptureCallback listener, Handler handler)

Request endlessly repeating capture of a sequence of images by this capture session.

int setRepeatingBurstRequests(List<CaptureRequest> requests, Executor executor, CameraCaptureSession.CaptureCallback listener)

Request endlessly repeating capture of a sequence of images by this capture session.

abstract int setRepeatingRequest(CaptureRequest request, CameraCaptureSession.CaptureCallback listener, Handler handler)

Request endlessly repeating capture of images by this capture session.

int setSingleRepeatingRequest(CaptureRequest request, Executor executor, CameraCaptureSession.CaptureCallback listener)

Request endlessly repeating capture of images by this capture session.

abstract void stopRepeating()

Cancel any ongoing repeating capture set by either setRepeatingRequest or setRepeatingBurst(List, CaptureCallback, Handler).

boolean supportsOfflineProcessing(Surface surface)

Query whether a given Surface is able to support offline mode.

CameraOfflineSession switchToOffline(Collection<Surface> offlineSurfaces, Executor executor, CameraOfflineSession.CameraOfflineSessionCallback listener)

Switch the current capture session and a given set of registered camera surfaces to offline processing mode.

void updateOutputConfiguration(OutputConfiguration config)

Update OutputConfiguration after configuration finalization see finalizeOutputConfigurations(List).

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 timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

abstract void close()

Closes this resource, relinquishing any underlying resources.

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.