API reference

Capability Interface

Extends Closeable
Contract for all capabilities that can be attached to a Session.
Capabilities represent session-scoped features like camera streaming or photo capture. They are created via session methods (e.g., Session.addStream) and can be stopped individually via Capability.stop or automatically when the parent session stops (cascading stop).
Capabilities implement Closeable for resource management compatibility. The Capability.close method delegates to Capability.stop.

See Also

Signature

interface Capability : Closeable

Methods

close ()
Signature
abstract override fun close()
stop ()
Stops this capability, releasing its resources and removing it from the parent session.
After calling Capability.stop, the capability is invalidated and cannot be reused. The parent session's capability slot is released, allowing a new capability of the same type to be added.
Calling Capability.stop on an already-stopped capability is a no-op.
Signature
abstract fun stop()