SurfaceOutput.Event


@AutoValue
abstract class SurfaceOutput.Event


Events of the Surface retrieved from getSurface.

Summary

Constants

const Int

The Surface provider is requesting to release the Surface.

Public functions

abstract Int

Returns the event associated with the SurfaceOutput.

abstract SurfaceOutput

Gets the SurfaceOutput associated with this event.

Constants

EVENT_REQUEST_CLOSE

Added in 1.3.0
const val EVENT_REQUEST_CLOSE = 0: Int

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 functions

getEventCode

Added in 1.3.0
abstract fun getEventCode(): Int

Returns the event associated with the SurfaceOutput.

getSurfaceOutput

Added in 1.3.0
abstract fun getSurfaceOutput(): SurfaceOutput

Gets the SurfaceOutput associated with this event.