Package-level declarations

Types

Link copied to clipboard

One immutable hardware image and its explicit ImageReader lease.

Link copied to clipboard

Turns direct MediaCodec output into immutable RGBA hardware Bitmap frames for a GPU client.

Link copied to clipboard

Android's monotonic clock, on the exact time base AudioTimestamp.nanoTime reports: System.nanoTime(), which is CLOCK_MONOTONIC.

Link copied to clipboard

The Android output half: AndroidMonotonicClock paired with AudioTrackSinkFactory, and null for video.

Link copied to clipboard

Draws frames into a Surface the caller owns.

Link copied to clipboard
object AnnexB

Converts AVC and HEVC container records and packets to Annex B start-code framing.

Link copied to clipboard

What an AppKitWindow hosts for the picture.

Link copied to clipboard

Draws frames into an AppKitWindow.

Link copied to clipboard
class AppKitWindow(title: String, width: Int, height: Int, surface: AppKitSurface)

A window to draw video into.

Link copied to clipboard

Who owns the process-wide iOS audio-session category and activation policy.

Link copied to clipboard

The one clock the engine and the audio device share on Apple platforms.

Link copied to clipboard

Apple output: CoreAudio, on CoreAudio's own clock.

Link copied to clipboard

The Android audio output: one AudioTrack in MODE_STREAM behind the engine's pull contract.

Link copied to clipboard

Creates AudioTrackSinks for the engine. One sink per playback session.

Link copied to clipboard
class AwtCanvasVideoRenderer(painter: AwtFramePainter, onVideoGeometry: (VideoSize, Int) -> Unit = { _, _ -> }) : VideoRenderer

Draws frames onto an AWT canvas, on a thread of its own.

Link copied to clipboard
fun interface AwtFramePainter

Fills a packed integer raster with one frame's pixels, one ARGB value per pixel, no row padding.

Link copied to clipboard
class CodecSpecificData(val csd0: ByteArray, val csd1: ByteArray?, val nalLengthSize: Int)

Decoder configuration converted to the start-code form expected by MediaCodec.

Link copied to clipboard

Audio output through CoreAudio, owned in C.

Link copied to clipboard
Link copied to clipboard

The desktop JVM audio output: one javax.sound.sampled.SourceDataLine behind the engine's pull contract.

Link copied to clipboard

Creates DesktopAudioSinks for the engine. One sink per playback session.

Link copied to clipboard

The desktop JVM monotonic clock: System.nanoTime(), the base every deadline DesktopAudioSink publishes is computed on.

Link copied to clipboard

The desktop JVM output half: DesktopMonotonicClock paired with DesktopAudioSinkFactory, and null for video. One object lights up macOS, Linux and Windows, because javax.sound.sampled and java.awt are in the JDK on all three.

Link copied to clipboard
sealed class MetalPicture
Link copied to clipboard

Renders one picture offscreen through Metal and reads the RGBA bytes back (the hardware path on Apple). This is what replaces the CPU colour conversion for a consumer that needs BYTES rather than a layer, KiteVideo above all: the YUV-to-RGB arithmetic runs in the fragment shader, a VideoToolbox frame is wrapped with no copy at all, and the CPU pays exactly one readback memcpy, which is the no-CPU-RGBA law with the one copy its Android sibling also pays.

Link copied to clipboard
fun interface MetalPictureResolver

How a Metal renderer reads a frame's pixels. The output module never depends on the FFmpeg backend, so a consumer that owns both sides supplies this resolver, exactly the way the CG renderers take their convert lambda. The two shapes are the two truths a frame can have: a CVPixelBuffer straight from VideoToolbox (zero copies), or software planes read out of the decoder's buffers (one memcpy per plane, no colour conversion on the CPU, which is law 2 of YUV until the GPU).

Link copied to clipboard

The GPU renderer: one Metal core for macOS and iOS, drawing into a caller-owned CAMetalLayer.

Link copied to clipboard

Presents frames into an AVSampleBufferDisplayLayer, on iOS and on macOS.

Link copied to clipboard

Converts software frames away from the caller and presents the newest finished image in its layer.

Link copied to clipboard
class WebCanvasVideoRenderer(canvas: JsAny, painter: WebFramePainter, keepDisplayAwake: Boolean = true) : VideoRenderer

Draws frames onto an HTML canvas.

Link copied to clipboard
class WebCanvasVideoRendererFactory(canvas: JsAny, painter: WebFramePainter, keepDisplayAwake: Boolean = true) : VideoRendererFactory
Link copied to clipboard

Keeps a page's screen awake while it shows a playing picture (#238), through the W3C Screen Wake Lock API. A browser keeps the screen on by itself only for a playing video element, and the player draws onto a canvas, so without this the display dims and locks in the middle of a film.

Link copied to clipboard
fun interface WebFramePainter

Fills a JS byte array with one frame's RGBA, tightly packed, no row padding.

Link copied to clipboard

performance.now(), which is the page's monotonic clock.

Link copied to clipboard

The web output side: a clock and a sink, and no renderer.

Link copied to clipboard

The page's half of the sound of a player that runs in a Web Worker (#100): the AudioContext and the AudioWorklet, which only a page may own, and the port a worker writes the sound to.

Functions

Link copied to clipboard
fun workerOutputBackend(port: JsAny, sampleRate: Int, channels: Int, outputLatencySeconds: Double?, control: (resume: Boolean) -> Unit): OutputBackend

The output backend of a player that runs in a Web Worker (#100): the worker's clock, and a sink that writes to the page's worklet through port, the WebWorkletAudio.workerPort the page transferred. sampleRate, channels and outputLatencySeconds are the page's figures.