Stream

abstract class Stream(context: Context) : MediaOutput, MediaOutputDataSource

Base class for streams that encode captured media or decode incoming media.

Constructors

Link copied to clipboard
constructor(context: Context)

Properties

Link copied to clipboard

Specifies the audio codec settings.

Link copied to clipboard

A weak reference to the registered media source, or null when detached.

Link copied to clipboard
open override var hasAudio: Boolean

Whether the source provides audio.

Link copied to clipboard
open override var hasVideo: Boolean

Whether the source provides video.

Link copied to clipboard

Coordinates audio and video playback timing for decoded media.

Link copied to clipboard
open override val screen: Screen

The offscreen renderer for video output.

Link copied to clipboard

Specifies the video codec settings.

Functions

Link copied to clipboard
open override fun append(buffer: MediaBuffer)

Receives a media buffer from the source. Consume or copy its payload before it is reused.

Link copied to clipboard
abstract fun close()

Closes the stream and stops media processing.

Link copied to clipboard
open fun dispose()

Detaches registered outputs and releases audio and video codec resources.

Link copied to clipboard
fun queueOutputBuffer(type: MediaType, index: Int, payload: ByteBuffer?, timestamp: Long, sync: Boolean)

Queues a decoded codec output buffer for playback.

Link copied to clipboard
open override fun registerOutput(output: MediaOutput)

Registers an output instance.

Link copied to clipboard
open override fun unregisterOutput(output: MediaOutput)

Unregisters an output instance. A buffer delivery already in progress can still include this output.