Package-level declarations

Types

Link copied to clipboard

Decoded PCM, ready for the engine's filter chain.

Link copied to clipboard

Decodes one audio stream: packets in through send, PCM out through receive. The engine closes it.

Link copied to clipboard

Creates audio decoders. The engine tries the factories in order and uses the first one that answers.

Link copied to clipboard
data class AudioFormat(val sampleRate: Int, val channels: Int, val sampleFormat: SampleFormat, val channelLayout: ChannelLayout = ChannelLayout.forChannelCount(channels), val channelLayoutMask: Long? = null)

The shape of PCM: sampleRate sample frames a second, each holding channels samples of sampleFormat.

Link copied to clipboard
fun interface AudioRenderCallback

Called by the audio device on its own real-time thread.

Link copied to clipboard

Converts interleaved float audio from one sample rate to another.

Link copied to clipboard
fun interface AudioResamplerFactory

Makes an AudioResampler for one pair of rates. Set it in AudioConfig.resampler.

Link copied to clipboard

An audio output device.

Link copied to clipboard
interface AudioSinkBuffer

The device's own buffer, to be written in place.

Link copied to clipboard
sealed interface AudioSinkEvent

What a sink reports about its device, on AudioSink.events.

Link copied to clipboard

Creates the audio sink of a session. An OutputBackend carries one.

Link copied to clipboard

One opened media item: the cursor over its packets, and the decoders that can consume them.

Link copied to clipboard

Which speaker each channel drives.

Link copied to clipboard

Where a subsampled chroma sample sits relative to the luma samples it covers.

Link copied to clipboard

How Y, Cb and Cr derive from R, G and B, with the matrices ITU-T H.273 names.

Link copied to clipboard

The red, green and blue the picture was mastered with, as ITU-T H.273 names them.

Link copied to clipboard
data class ColorSpaceInfo(val matrix: ColorMatrix = ColorMatrix.Bt709, val primaries: ColorPrimaries = ColorPrimaries.Bt709, val transfer: ColorTransfer = ColorTransfer.Bt709, val fullRange: Boolean = false, val chromaLocation: ChromaLocation = ChromaLocation.Left, val rangeSpecified: Boolean = true, val matrixSpecified: Boolean = true, val primariesSpecified: Boolean = true, val transferSpecified: Boolean = true)

The colour metadata a renderer must honour to produce a correct picture.

Link copied to clipboard

How coded values map to light, with the transfer characteristics ITU-T H.273 names.

Link copied to clipboard
data class DisplayPrimaries(val redX: Float, val redY: Float, val greenX: Float, val greenY: Float, val blueX: Float, val blueY: Float, val whiteX: Float, val whiteY: Float)

Red, green and blue primaries and a white point, as CIE 1931 xy chromaticity coordinates.

Link copied to clipboard

How a video stream's fields are ordered, in display order.

Link copied to clipboard
sealed interface FrameShape

What a decoder's frames will be, known before the first frame exists.

Link copied to clipboard
data class HdrStaticMetadata(val masteringPrimaries: DisplayPrimaries? = null, val masteringMinNits: Float? = null, val masteringMaxNits: Float? = null, val maxContentLightNits: Int? = null, val maxFrameAverageNits: Int? = null)

The static HDR metadata of a stream or a frame: the display it was graded on, as SMPTE ST 2086 describes it, and how bright the content gets, as CTA-861.3 describes it. A tone mapper reads the content's real peak from it instead of assuming one. Every field is null when the source did not say.

Link copied to clipboard

What kind of hardware surface a frame holds, so a renderer can say whether it can draw it.

Link copied to clipboard
class MediaAttachment(val fileName: String, val mimeType: String?, val data: ByteArray)

One file attached to a container, as the container wrote it. See PlayerMediaSource.attachments.

Link copied to clipboard
interface MediaBackend

Everything needed to read and decode one media item, from one place.

Link copied to clipboard

Registration seam for optional modules on targets without classpath service discovery. Applications normally only add the module dependency. Registration is thread-safe and creates no clients. Registering distinct providers under the same identifier refuses with an error.

Link copied to clipboard

An optional transport module's lightweight discovery entry. Construction must not perform I/O. A provider creates one process-lived resolver on first automatic resolution. That resolver must support concurrent opens, keep player state out of the registry, and give each returned reader ownership of its resources. An unsupported URI returns null so the next provider may handle it.

Link copied to clipboard

Opens media and produces a packet cursor over it.

Link copied to clipboard
value class NativeRingAddress(val rawAddress: Long)

The address of a kprt_ring the sink owns, as an opaque number.

Link copied to clipboard

A sink that owns its device callback in C, and therefore owns the ring that callback reads.

Link copied to clipboard
class NativeRingHandoff(val format: AudioFormat, val ring: NativeRingAddress)

What NativeRingAudioSink.openWithRing hands back: the format the device accepted, and the C ring its callback reads.

Link copied to clipboard
interface OutputBackend

The output half of a platform: one clock, one audio sink factory, and optionally a subtitle rasterizer. It supplies no video renderer: a renderer needs a surface that only the application owns, so the application builds one and passes it to KitePlayer.attachRenderer.

Link copied to clipboard
data class OverlayImage(val x: Int, val y: Int, val bitmap: RgbaBitmap)

One image of a subtitle overlay, with its top left corner at x and y in output pixels.

Link copied to clipboard

A packet cursor over one opened item. The engine closes it with its session.

Link copied to clipboard

One compressed packet.

Link copied to clipboard

A pixel layout the engine models.

Link copied to clipboard
data class PlayerStreamInfo(val index: Int, val kind: TrackKind, val codec: String, val language: String? = null, val title: String? = null, val isDefault: Boolean = false, val isForced: Boolean = false, val isAccessibility: Boolean = false, val bitrate: Long? = null, val startTime: Pts? = null, val videoSize: VideoSize? = null, val rotationDegrees: Int = 0, val frameRate: Double? = null, val colorSpace: ColorSpaceInfo? = null, val isCoverArt: Boolean = false, val isSparse: Boolean = false, val sampleRate: Int? = null, val channels: Int? = null, val vp9: Vp9CodecConfiguration? = null, val codecExtradata: ByteArray? = null, val metadata: Map<String, String> = emptyMap(), val fieldOrder: FieldOrder = FieldOrder.Unknown, val hdr: HdrStaticMetadata? = null, val mirrored: Boolean = false, val dolbyVision: DolbyVisionInfo? = null, val isCommentary: Boolean = false, val crop: PictureCrop? = null)

What the container declares about one stream.

Link copied to clipboard

The seek bar pictures of a source (#433). at reads an image only when it is asked for, through the source's own transport, and keeps a few recent ones, so a finger that scrubs back and forth over one image downloads it once. Safe to call from any coroutine while the source is read.

Link copied to clipboard
@RequiresOptIn(level = RequiresOptIn.Level.ERROR, message = "Raw ring API: the sink owns this C pointer and releases it on close. Opt in only at the native audio handoff boundary.")
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class RawRingApi

Marks the native ring handoff that exposes the real-time core's raw C pointer.

Link copied to clipboard

A PlayerMediaSource that can copy the packets it reads into a file while it plays.

Link copied to clipboard
sealed interface RendererEvent

What a renderer reports about itself on VideoRenderer.events.

Link copied to clipboard

How one sample is stored: bytes wide, as a float when isFloat and as a signed integer otherwise.

Link copied to clipboard

A frame whose pixels can be read, for the cases that genuinely need them: a screenshot, a software renderer of last resort, a video thumbnail strip.

Link copied to clipboard
data class StreamDivergence(val streamIndex: Int, val field: String, val declared: String, val decoded: String)

One field where a container's declaration and its decoder disagree.

Link copied to clipboard

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

Link copied to clipboard

Creates subtitle decoders.

Link copied to clipboard
fun interface SubtitleFileParser

Parses one subtitle file's whole text into timed cues. See MediaBackend.subtitleFileParser.

Link copied to clipboard
class SubtitleFileReading(val cues: List<SubtitleCue>, val format: String, val assumedFrameRate: Double? = null)

What SubtitleFileParser.parseOther read from a subtitle file.

Link copied to clipboard
data class SubtitleOverlay(val images: List<OverlayImage>, val viewportWidth: Int, val viewportHeight: Int, val contentHash: Long)

What to draw above the video, in output pixels.

Link copied to clipboard

Thrown by SubtitleRasterizer.rasterize when the images of the next cue would take the overlay past SubtitleRasterizer.overlayPixelBudget. The engine shows drawn and warns once with io.github.yuroyami.kiteplayer.PlaybackWarning.SubtitlesNotDrawn.

Link copied to clipboard

Turns active text cues into the positioned images a renderer composites.

Link copied to clipboard

A typesetting engine for ASS and SSA subtitles, libass in practice.

Link copied to clipboard

An optional typesetting module's discovery entry. Construction must do no work: providers are instantiated on every player that meets an ASS track, and only create may load a library or scan fonts. Returning null from create means this build cannot typeset here, for example a desktop JVM with no native library for its operating system; the engine then keeps the Kotlin tier and says so once through a warning.

Link copied to clipboard

Registration seam for optional typesetting modules on targets without classpath service discovery. Applications normally only add kiteplayer-libass and never call this. Thread-safe. Registering two different providers under one identifier refuses with an error.

Link copied to clipboard
data class TypesetFrame(val width: Int, val height: Int, val videoWidth: Int, val videoHeight: Int, val marginTop: Int = 0, val marginBottom: Int = 0, val marginLeft: Int = 0, val marginRight: Int = 0, val fontScale: Float = 1.0f, val linePosition: Float = 1.0f, val videoColor: ColorSpaceInfo? = null)

The geometry one SubtitleTypesetter.render call draws into.

Link copied to clipboard

Decodes one video stream: packets in through send, frames out through receive. The engine closes it.

Link copied to clipboard

The send and receive shape below mirrors what libavcodec actually does, including the cases a simpler interface cannot express: one packet producing zero frames, one packet producing several, and a decoder that must be drained before it will accept more input.

Link copied to clipboard

A decoded video frame.

Link copied to clipboard

Draws frames.

Link copied to clipboard

Creates a VideoRenderer for an application to pass to KitePlayer.attachRenderer.

Link copied to clipboard

Bits per sample.

Link copied to clipboard

The chroma subsampling. code names it with the usual digits, such as 420.

Link copied to clipboard
data class Vp9CodecConfiguration(val profile: Vp9Profile?, val level: Vp9Level?, val bitDepth: Vp9BitDepth?, val chromaSubsampling: Vp9ChromaSubsampling?)

The VP9 profile, level, bit depth and chroma subsampling the container declares. A null field was not declared.

Link copied to clipboard

A VP9 level. code is the level times ten, as a codec string writes it.

Link copied to clipboard

A VP9 profile. number is its number in the VP9 bitstream specification.

Properties

Link copied to clipboard

The codec of the subtitle track the engine makes of the closed captions inside a video stream (#236): see VideoFrame.closedCaptions. Named after FFmpeg's A53_CC frame data.

Link copied to clipboard

The content peak a tone mapper rolls this frame off from, in nits: the scene's brightest level when the frame carries one between 100 and 10000 nits, held at most at the title's own peak, else the title's peak from VideoFrame.hdr, else null for the 1000 nits a PQ master is assumed to have.

Link copied to clipboard

The size of the picture this frame shows: VideoFrame.size with VideoFrame.crop's edges taken away, before the turn, which still swaps width and height for a renderer.