Lightningbeam/lightningbeam-ui/gpu-video-encoder/src
Skyler Lehmkuhl ca9a70e10a export: run the zero-copy H.264 encoder on the shared device (Stage 3c-export pt 2)
Makes the common Linux H.264 export fully GPU-resident: decode (HW NV12) →
composite → VAAPI encode all on one device, no CPU round-trips.

- gpu-video-encoder: ZeroCopyEncoder now holds wgpu (device,queue,adapter) handles
  instead of owning a DrmDevice. New `new_on_device(device,queue,adapter,...)` runs
  the RGBA→NV12 render + DMA-BUF import on a passed device; `new` keeps building its
  own. The encoder only *imports* VAAPI surfaces (not export), so the shared
  import-capable device works directly.
- editor: stash the shared device handles on EditorApp (set in the creation closure
  from the eframe render_state when the shared device is active) and thread them
  through start_video_export / start_video_with_audio_export → try_build_zero_copy,
  which uses new_on_device when available. ZeroCopyVideo carries on_shared_device →
  the export composite uses hardware_ok=true (consuming HW-decoded GPU frames from
  pt 1) only then.

Falls back to the own-device encoder (decode downloads to CPU) when no shared
device. Tradeoff: the export now shares the GPU with the UI thread (was a separate
device); acceptable for the GPU-resident-decode win. Compiles; crate tests build.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 05:18:23 -04:00
..
decoder.rs hw: P010 (10-bit) DMA-BUF import for real HDR video 2026-06-26 03:16:28 -04:00
dmabuf.rs fix: P010 plane textures are sample-only (R16 isn't renderable) 2026-06-26 03:20:27 -04:00
encoder.rs export: run the zero-copy H.264 encoder on the shared device (Stage 3c-export pt 2) 2026-06-26 05:18:23 -04:00
lib.rs gpu-video-encoder: VAAPI hardware decode → wgpu texture (Stage 2) 2026-06-26 00:46:53 -04:00
nv12.rs Add gpu-video-encoder crate: zero-copy VAAPI encode (validated) 2026-06-23 19:07:37 -04:00
render_nv12.rs export: H.264 color range toggle (fix dark/oversaturated output) 2026-06-26 00:38:19 -04:00
vaapi.rs gpu-video-encoder: VAAPI driver retry, Vello-capable device, Send 2026-06-25 18:15:05 -04:00
vk_device.rs hw: P010 (10-bit) DMA-BUF import for real HDR video 2026-06-26 03:16:28 -04:00