MediaProbe

data class MediaProbe(val formatName: String, val durationMicros: Long?, val startTimeMicros: Long, val isSeekable: Boolean, val bitrateBps: Long?, val metadata: Map<String, String>, val chapters: List<Chapter>, val streams: List<StreamInfo>, val programs: List<Program> = emptyList(), val matroska: MatroskaSegment? = null)

Everything a container says about itself, read in one call and with nothing left open.

What it is for: deciding. A library screen wants a duration and a language list, a picker wants to know whether a file is playable at all, a resume dialogue wants chapters. All of that is available from an open MediaSource already, and every one of those callers had to remember to close it. A probe that hands back a value instead of a handle cannot be leaked.

A snapshot, not a view: nothing here changes once it is returned, and the source it was read from is closed by the time you hold it.

Constructors

Link copied to clipboard
constructor(formatName: String, durationMicros: Long?, startTimeMicros: Long, isSeekable: Boolean, bitrateBps: Long?, metadata: Map<String, String>, chapters: List<Chapter>, streams: List<StreamInfo>, programs: List<Program> = emptyList(), matroska: MatroskaSegment? = null)

Properties

Link copied to clipboard

What the container claims its bit rate is, in bits per second, or null when it claims nothing.

Link copied to clipboard
Link copied to clipboard

How long the container says it is, or null when it does not say, which live sources do not.

Link copied to clipboard

The demuxer FFmpeg chose, for example mov,mp4,m4a,3gp,3g2,mj2.

Link copied to clipboard

Whether a seek can be honoured at all.

Link copied to clipboard

What a Matroska file says about its segment and editions, or null; see MediaSource.matroska.

Link copied to clipboard

Container-level tags, as the demuxer read them.

Link copied to clipboard

The first audio stream, which is what a duration or a language usually means.

Link copied to clipboard

The first video stream that is not cover art, which is what a thumbnail or a size wants. A file whose only video is its cover art returns that picture, as MediaSource.primaryVideo does.

Link copied to clipboard

The programmes, each a set of streams that play together. Empty for most containers; see Program.

Link copied to clipboard

Where its timeline starts. Rarely zero for a transport stream.

Link copied to clipboard