Lightningbeam/lightningbeam-ui/gpu-video-encoder
Skyler Lehmkuhl 255e16434e gpu-video-encoder: VAAPI hardware decode → wgpu texture (Stage 2)
Headless decode primitive, the mirror of the encoder: VaapiDecoder opens a file,
hardware-decodes H.264 into VAAPI NV12 surfaces (hw_device_ctx + a get_format
callback selecting AV_PIX_FMT_VAAPI), maps each surface to a DRM-PRIME DMA-BUF,
and imports it as two wgpu plane textures via the existing dmabuf::import_raw —
the same path the encoder uses, in the read direction. Frames stay GPU-resident
(no CPU copy).

Validated by a round-trip test: encode solid gray with ZeroCopyEncoder, decode
it back, read the Y plane (mean ≈ 128). All 9 crate tests pass on the container's
Intel GPU.

Next (Stage 3): wire this into VideoManager/get_frame so the compositor consumes
a GPU texture directly (no write_texture upload), with software decode fallback.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 00:46:53 -04:00
..
src gpu-video-encoder: VAAPI hardware decode → wgpu texture (Stage 2) 2026-06-26 00:46:53 -04:00
tests gpu-video-encoder: VAAPI hardware decode → wgpu texture (Stage 2) 2026-06-26 00:46:53 -04:00
Cargo.toml Add gpu-video-encoder crate: zero-copy VAAPI encode (validated) 2026-06-23 19:07:37 -04:00