Properties

Link copied to clipboard
open override val attachments: List<MediaAttachment>

Matroska attachments, read once from the container's attachment streams. FFmpeg keeps an attachment's bytes in that stream's codec extradata and its name and type in the stream's tags, so no packet is ever read for one. Fonts are what the subtitle typesetter loads.

Link copied to clipboard
open override val chapters: List<Chapter>

The container's chapters, empty only when the file declares none.

Link copied to clipboard
open override val containerBitrateBps: Long?

The container's own claim, read once at open. Null when it declares none.

Link copied to clipboard
open override val duration: Pts?

The length of the content. A file still being written grows (#430), so its length is the open's, scaled by how much the file has grown since, which is the open's own bit rate.

Link copied to clipboard
open override val durationIsEstimate: Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val metadata: Map<String, String>

The container's tags as they stand, which a packet that brings new ones replaces (#423): a radio station's next song, a chained Ogg's next comments. Written by the demux lane, read by the engine's snapshot from any thread.

Link copied to clipboard

Where this source's decoders report a degradation they had to accept and carry on through.

Link copied to clipboard
open override val programs: List<MediaProgram>

The channels of a multiplex (#505), as they stand after the latest read, because a live transport stream can change them (#509). Only a programme the container numbers is one, which leaves out those FFmpeg makes for the variants of an HLS master playlist and for a DASH presentation, and a programme keeps only the streams streams lists.

Link copied to clipboard
open override val realTime: Boolean

True for a stream with no duration that came over udp, rtp, rtsp or rtmp, or from an SDP file: a sender pushes it at the pace it plays. An RTMP server's recording has a duration and is not one, and neither is anything read through the item's own reader.

Link copied to clipboard
open override val recordingPath: String?
Link copied to clipboard
open override val seekable: Boolean

Read from the input, never assumed. False for a pipe or a capture device, and a player that offers a seek bar for one of those offers a control that fails on every use.

Link copied to clipboard
open override val selectedVariant: Int?
Link copied to clipboard
open override val separateAudioRenditions: Boolean

FFmpeg's HLS reader downloads each rendition of a master playlist on its own, and a DASH presentation reaches it as one, so a sound nobody hears there costs its download (#455).

Link copied to clipboard

Read on every call rather than cached: the library fills this in as decoders produce their first output, so a value read at open would always be empty.

Link copied to clipboard
open override val streams: List<PlayerStreamInfo>

What the container lists, as it stands after the latest read: a live stream can add to it (#509).

Link copied to clipboard
open override val thumbnails: PlayerThumbnails?

The seek bar pictures an HLS stream, or a DASH one through its stand-in, names (#433).

Link copied to clipboard
open override val timestampsMayJump: Boolean

MPEG-TS and friends declare that their timestamps may jump. The engine uses this to pick a 10 second rather than a 3600 second ceiling on a frame's duration, and to decide how large a jump is a discontinuity rather than drift. HLS joins segments that may each start a new timeline, and FFmpeg passes those jumps on.

Link copied to clipboard
open override val variants: List<StreamVariant>

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun interrupt(): Boolean
Link copied to clipboard
open override fun pauseReading(): Boolean

KiteFFmpeg's pause (#441): RTSP's PAUSE once and then its keepalive whenever one is due, or RTMP's pause command. Every other input answers false.

Link copied to clipboard
open suspend override fun readPacket(): PlayerPacket?
Link copied to clipboard
open override fun resumeReading(): Boolean

KiteFFmpeg's resume, which asks the sender to play on only while a pause is in effect.

Link copied to clipboard
open suspend override fun seekToKeyframe(target: Pts): Pts?

open suspend override fun seekToKeyframe(target: Pts, choice: KeyframeChoice): Pts?

Finds the keyframes either side of target by reading the first picture after a forward seek and, for KeyframeChoice.Closest, after a backward one, then lands with a backward seek aimed at the chosen keyframe's own time, which KiteFFmpeg lands on exactly (#496). A source with no picture has nothing to choose between, because every sound packet is a keyframe.

Link copied to clipboard
open override fun selectStreams(indices: Set<Int>)

The first call opens the reader. A later one, between reads, changes which streams it delivers without moving it, which is how the demux lane adds a stream that appeared after the open; the packets of it that FFmpeg read before then come first on the next read (#509).

Link copied to clipboard
open override fun startRecording(path: String)

Records every stream this source reads, except cover art, which is one picture the file would never show again, and a subtitle format Matroska cannot hold.

Link copied to clipboard
open override fun stopRecording()
Link copied to clipboard

Video decoders for this source. The factory applies the caller's platform policy at open.