Skip to content
QuaLix
On this page

Five engine targets & HDR

How QuaLix integrates across Web/Vue/React/Svelte, Native wgpu/Metal, Cocos Creator, Godot 4.7, and Unity 6.3 targets.

The host engine coordinates play, pause, seek, loop transitions, and QPK lifecycles. After inspecting the four-byte 51 4C 58 07 (QLX\x07) signature, the host dispatches playback to the matching binding, requests floor(seconds * fps_num / fps_den), uploads decoded rows [firstRow, endRow) to its texture target, and emits completion events.

Five build targets

Target Entry Point Runtime Integration Notes
Web / Vue / React / Svelte @quajs/qualix & @quajs/qualix/web QuaLixCanvasPlayer or attachQuaLixToVideoElement drives <canvas> / <video> elements with dirty-row upload
Native (wgpu / Metal) Rust qualix crate (default-features = false) or include/qualix.h On-demand streaming decoder inside VideoBackend; supports open_into UMA zero-copy and Metal EDR HDR
Cocos Creator 3.8+ @quajs/qualix/cocos & C static library createQuaLixSpriteTexture uploads RGBA8888 to cc.Texture2D in Creator Web; C ABI on native JSB
Godot 4.7+ bindings/godot GDExtension (QuaLixClip) Retains CoW PackedByteArray and updates ImageTexture, preserving shader/mask compositing and straight alpha
Unity 6.3 bindings/unity (QuaLixClip + QuaLixTexture C#) Pins ArraySegment<byte> via GCHandle, uploads RGBA32 / A2B10G10R10 (uvRect = (0, 1, 1, -1) for top-down origin)

[!TIP] On Unity HDR materials, PQ10 and HLG10 upload encoded BT.2020 A2B10G10R10_UNormPack32 texels so the shader owns transfer decoding and display tone mapping.

Staging cross-platform SDK binaries

Shell
cargo build --locked --release -p qualix-fficargo build --locked --release -p qualix-ffi --target wasm32-unknown-unknowncargo build --locked --release -p qualix-godotpython3 tools/stage-sdk.py web .local/export/web --wasm target/wasm32-unknown-unknown/release/qualix_decoder.wasmpython3 tools/stage-sdk.py native .local/export/native --lib target/release/libqualix_decoder.apython3 tools/stage-sdk.py cocos .local/export/cocos --lib target/release/libqualix_decoder.a --wasm target/wasm32-unknown-unknown/release/qualix_decoder.wasmpython3 tools/stage-sdk.py godot .local/export/godot --lib target/release/libqualix_godot.dylibpython3 tools/stage-sdk.py unity .local/export/unity --lib target/release/libqualix_decoder.dylib

For iOS or static host linking:

Shell
cargo rustc --locked --release -p qualix-ffi --target aarch64-apple-ios --crate-type staticlib

Host lifecycle & memory rules

  • GPU hazard synchronization: When sharing a canvas with qlx_open_into or Decoder::open_into, guarantee GPU texture reads finish before calling the next decode() or closing the handle.
  • Bounded working set: Adaptive motion (115-row circular stripe buffer), 8×8 loop metadata, and symmetric 5-tap Wiener line buffers alias one reusable scratch allocation alongside the single width × height × 4 canvas. Stream readers account for a 64 KiB buffer inside budget. See Decoder storage.
  • Godot pre-registration: Run python3 tools/register-godot.py PATH_TO_PROJECT when installing into standalone Godot 4.7 projects to preserve existing GDExtensions cleanly.