Package-level declarations

Types

Link copied to clipboard
object Dash

Opens DASH presentations: fetches a manifest, and builds a playable item from it.

Link copied to clipboard
data class DashAdaptationSet(val contentType: String?, val mimeType: String?, val segmentTemplate: DashSegmentTemplate?, val representations: List<DashRepresentation>, val lang: String? = null, val id: String? = null, val label: String? = null, val roles: List<String> = emptyList(), val contentProtectionSchemes: List<String> = emptyList())

One AdaptationSet: the interchangeable representations of one kind of content.

Link copied to clipboard
data class DashBaseUrl(val url: String, val serviceLocation: String? = null, val priority: Int? = null, val weight: Int? = null)

One location of a manifest's segments, resolved. serviceLocation names the network it is on, so a player that loses one location leaves the others on the same network for last; priority and weight are DVB-DASH's (ETSI TS 103 285, 10.8.2.1), null when the manifest states none, which DVB reads as 1.

Link copied to clipboard
data class DashBaseUrls(val primary: String, val locations: List<DashBaseUrl>)

One base address and its other locations (#440). primary is the resolved base that the segments' addresses below it are built from, and locations every location of the same segments, primary first, in the order the manifest asks for: DVB's priority, the lowest first, then its weight, the highest first, then the document's order.

Link copied to clipboard
data class DashManifest(val isDynamic: Boolean, val durationMicros: Long?, val periods: List<DashPeriod>, val baseUrl: String, val availabilityStartTimeMicros: Long? = null, val minimumUpdatePeriodMicros: Long? = null, val timeShiftBufferDepthMicros: Long? = null, val suggestedPresentationDelayMicros: Long? = null, val location: String? = null, val utcTimings: List<DashUtcTiming> = emptyList(), val alternativeBaseUrls: List<DashBaseUrls> = emptyList())

A DASH MPD parsed in pure commonMain Kotlin, because libxml2 was refused as a dependency. The model keeps what segment resolution needs and nothing else: periods, adaptation sets, representations, the three segment addressing forms (template with number or timeline, an explicit list, and one file with a segment index), BaseURL chains, and the clock of a live presentation.

Link copied to clipboard

Parses a DASH MPD into a DashManifest.

Link copied to clipboard
class DashMediaIo(plan: DashSegmentPlan, fetch: suspend (String) -> ByteArray) : MediaIo

One representation's segments read as a single forward stream (the adaptive layer's first tier): the initialization segment when one exists, then every media segment in plan order, byte-concatenated. FFmpeg demuxes the join exactly as it demuxes a file, which is the media3 shape chosen here: Kotlin segment logic FEEDING the decoder, never FFmpeg's own dash demuxer.

Link copied to clipboard
data class DashPeriod(val baseUrl: String, val durationMicros: Long?, val adaptationSets: List<DashAdaptationSet>, val startMicros: Long? = null, val id: String? = null)

One Period of a manifest, with its BaseURL already resolved.

Link copied to clipboard
data class DashRepresentation(val id: String?, val bandwidth: Long, val codecs: String?, val mimeType: String?, val width: Int?, val height: Int?, val baseUrl: String, val segmentTemplate: DashSegmentTemplate?, val segmentUrls: List<String>, val initializationUrl: String?, val frameRate: Double? = null, val segmentList: DashSegmentList? = null, val segmentBase: DashSegmentBase? = null, val audioChannels: Int? = null, val videoRange: String? = null, val tiles: DashTiles? = null)

One Representation: one encoding of the content, with its segments addressed by a template or a list.

Link copied to clipboard

A response that passed the size ceiling before it was fully read.

Link copied to clipboard
data class DashSegmentBase(val timescale: Long, val indexRange: LongRange?, val initializationUrl: String?, val initializationRange: LongRange?, val presentationTimeOffset: Long = 0)

A SegmentBase: one file at the representation's BaseURL, whose own segment index (sidx) names its segments. indexRange says where the index is; without it the index is looked for at the start of the file.

Link copied to clipboard
data class DashSegmentList(val timescale: Long, val duration: Long?, val startNumber: Long, val timeline: List<DashTimelineEntry>, val initializationUrl: String?, val initializationRange: LongRange?, val segments: List<DashSegmentUrl>, val presentationTimeOffset: Long = 0)

A SegmentList, with every URL base-resolved. A SegmentURL without media names a byte range of the representation's own BaseURL.

Link copied to clipboard
data class DashSegmentPlan(val initializationUrl: String?, val mediaUrls: List<String>)

The resolved segment plan for one representation: what to fetch, in order.

Link copied to clipboard
data class DashSegmentTemplate(val initialization: String?, val media: String?, val startNumber: Long, val timescale: Long, val duration: Long?, val timeline: List<DashTimelineEntry>, val presentationTimeOffset: Long = 0, val endNumber: Long? = null)

A SegmentTemplate, merged from every level that declares one, the lowest level winning each attribute.

Link copied to clipboard
data class DashSegmentUrl(val url: String, val range: LongRange?)

One SegmentURL: a URL, and the bytes of it that hold the segment, or null for all of it.

Link copied to clipboard
data class DashTiles(val columns: Int, val rows: Int)

The grid of a DASH thumbnail image: columns by rows tiles, in reading order (#433).

Link copied to clipboard
data class DashTimelineEntry(val t: Long?, val d: Long, val r: Long)

One S element: an explicit start t (timescale units), duration d, and r repeats.

Link copied to clipboard

A manifest that the DASH door does not play: an encrypted one, whose every picture and sound set has a ContentProtection element, because digital rights management is out of scope, or one whose segments the HLS path cannot carry, in a container other than fragmented MP4, MPEG-TS or WebM, when it has several Periods, is live or carries its audio in an adaptation set of its own. It is refused rather than played wrong, so an application can fall back to another route.

Link copied to clipboard
data class DashUrlPolicy(val allowedSchemes: Set<String> = setOf("http", "https"), val allowSchemeDowngrade: Boolean = false, val sameOriginOnly: Boolean = false)

What a manifest is allowed to point this player at.

Link copied to clipboard

A URL a manifest asked for and DashUrlPolicy refused.

Link copied to clipboard
data class DashUtcTiming(val schemeIdUri: String, val value: String)

One UTCTiming element (ISO/IEC 23009-1, 5.8.4.11): a schemeIdUri that says how to read the time, such as urn:mpeg:dash:utc:http-xsdate:2014 or urn:mpeg:dash:utc:direct:2014, and its value, an address to fetch or the time itself.

Properties

Link copied to clipboard

Default ceiling for one MPD. Real manifests are kilobytes; this is three orders above them.

Link copied to clipboard

Default ceiling for one media segment. A 10 second 4K segment is well inside this.