subscribe

suspend fun subscribe(@IntRange(from = 1) bufferSize: Int = DEFAULT_BUFFER_SIZE): Result<DataTrackStream>

Subscribes to the track and returns a DataTrackStream of incoming frames.

Subscribing more than once is allowed: the streams share one pipeline, each receives every frame from the moment it subscribes (nothing is replayed), and later calls don't change the buffer size.

Return

A successful Result containing the DataTrackStream, or a failure containing DataTrackSubscribeException.

Parameters

bufferSize

Maximum number of received frames buffered internally before the oldest is dropped. Values below 1 are clamped to 1.