SurfaceOutput.Event


@AutoValue
public abstract class SurfaceOutput.Event


Events of the Surface retrieved from getSurface.

Summary

Constants

static final int

The Surface provider is requesting to release the Surface.

Public methods

abstract int

Returns the event associated with the SurfaceOutput.

abstract @NonNull SurfaceOutput

Gets the SurfaceOutput associated with this event.

Constants

EVENT_REQUEST_CLOSE

Added in 1.3.0
public static final int EVENT_REQUEST_CLOSE = 0

The Surface provider is requesting to release the Surface.

Releasing a Surface while it's still being written into is not safe on some devices. This is why the provider of the Surface will not release the Surface without the CameraX's permission. Once this event is received, the implementation should stop accessing the Surface as soon as possible, then mark the SurfaceOutput as closed by calling close. Once closed, CameraX will notify the Surface provider that it's safe to release the Surface.

Public methods

getEventCode

Added in 1.3.0
public abstract int getEventCode()

Returns the event associated with the SurfaceOutput.

getSurfaceOutput

Added in 1.3.0
public abstract @NonNull SurfaceOutput getSurfaceOutput()

Gets the SurfaceOutput associated with this event.