forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on b123ba7f7bfd18355bf7219c3fecdfd2c458eee9Filtered to crates/ec-hw/src/error.rsClear filter

2026-08-14

feat(hw): the VA-API parameter buffers, surface pool and frame readbackAhmet Kaan Gümüş · 89d28a7
feat(hw): the VA-API parameter buffers, surface pool and frame readback

The foundation of the hardware crate: every codec parameter struct
libva defines for the paths this family uses, transcribed by hand from
the system headers and checked field for field by a `const` assertion
against `crates/ec-hw/abi-probe.c`. A transcription slip is a compile
error rather than a driver reading garbage.

Around them:

- `SurfacePool`, which allocates once and recycles: a surface returns to
  the free list when the reference buffer and the caller are both done
  with it, so nothing leaks and nothing is reallocated per frame.
- `Frame`, with the two ways to reach the pixels — DRM PRIME export for
  the zero-copy path, and `vaGetImage` readback into I420 (8 or 10 bit)
  for callers that want the samples. The readback image is created once
  per stream: one `vaCreateImage`/`vaDestroyImage` pair per frame costs
  ~20 ms at 1080p on this driver, more than the decode itself.
- A typed error for every failure. Nothing here panics: edith loads this
  path as a dlopen'd plugin whose fall back to software is only as good
  as that promise.