SubtitleDecoder

Turns subtitle packets into cues. The engine drains it on the actor between packets and flushes it on every seek; see SubtitleDecoderFactory.

Once a track's packets have run out at the end of its stream, the engine sends null, once, and receives what that gives: a decoder that holds its last cue until the next packet, as a closed caption decoder holds the caption on screen, gives it then. A decoder that refuses the null packet is offered it again after its output is received, a few times at most. The next packet after a drain comes only after a flush.

Functions

Link copied to clipboard
expect abstract fun close()
Link copied to clipboard
abstract suspend fun flush(newGeneration: Generation)

The only epoch boundary. See VideoDecoder.flush.

Link copied to clipboard
abstract suspend fun receive(): List<SubtitleCue>
Link copied to clipboard
abstract suspend fun send(packet: PlayerPacket?): Boolean

Offers a packet, or null to start the drain. False means receive before offering again, as for VideoDecoder.send.