AsyncPacketReader

Reads the packets of an AsyncMediaSource. It is the suspending form of PacketReader. A source has one read position, so it has one open reader at a time.

Functions

Link copied to clipboard
open suspend override fun close()

Gives the read position back to the source.

Link copied to clipboard
suspend fun read(): AsyncPacket?

The next packet of the selected streams, or null at the end. The read may wait for the byte source. The caller owns the packet and closes it.

Link copied to clipboard
suspend fun reselect(streams: List<StreamInfo>)

Changes the streams this reader hands out. See PacketReader.reselect.

Link copied to clipboard
suspend fun seek(micros: Long, direction: SeekDirection = SeekDirection.Backward, notEarlierThan: Long? = null)

Moves the read position. The parameters mean what they mean in PacketReader.seek.