Expand description
Deterministic test-media generators with a local gitignored cache.
Cache hits are validated with BLAKE3 against an expected digest — same
path alone is not enough. Binaries must not be committed — see
docs/conventions/testing.md.
Enums§
- Test
Media Error - Errors from fixture ensure / generate.
Constants§
- DEFAULT_
CACHE_ DIR_ NAME - Default cache directory name under the workspace root.
- PCM_
SILENCE_ 48K_ STEREO_ 20MS_ BLAK E3 - BLAKE3 hex digest of 20 ms of silent 48 kHz stereo 16-bit PCM (
pcm/silence_48k_stereo_20ms.pcm). - SOLID_
GRAY_ NV12_ 64X64_ BLAK E3 - BLAKE3 hex digest of a 64×64 mid-gray NV12 frame (
solid/gray_nv12_64x64.yuv). - SOLID_
RED_ 64X64_ BLAK E3 - BLAKE3 hex digest of a 64×64 opaque red RGBA8 frame (
solid/red_64x64.rgba).
Functions§
- cache_
dir - Resolve the local fixture cache directory.
- ensure
- Ensure
relative_nameexists under the cache and matchesexpected_blake3_hex. - ensure_
pcm_ silence_ 48k_ stereo_ 20ms - Ensure 20 ms of silent 48 kHz stereo 16-bit PCM (
pcm/silence_48k_stereo_20ms.pcm). - ensure_
solid_ gray_ nv12_ 64x64 - Ensure a 64×64 mid-gray NV12 fixture (
solid/gray_nv12_64x64.yuv). - ensure_
solid_ red_ 64x64 - Ensure a 64×64 opaque red RGBA8 fixture (
solid/red_64x64.rgba). - hash_
bytes - BLAKE3 hex digest of an in-memory buffer.
- hash_
file - BLAKE3 hex digest of a file (streaming).
- pcm_
silence_ bytes - In-memory silent interleaved 16-bit PCM buffer (
frames_per_channel * channels * 2bytes, all zero). - solid_
nv12_ bytes - In-memory solid-color NV12 buffer (layout matches
write_solid_nv12). - solid_
rgba8_ bytes - In-memory solid RGBA8 buffer (for digest computation / tiny fixtures).
- write_
pcm_ silence - Write a silent interleaved 16-bit PCM buffer.
- write_
solid_ nv12 - Write a solid-color NV12 frame:
width * heightluma bytes, thenwidth * height / 2bytes of interleaved chroma (U, V, U, V, …per row). - write_
solid_ rgba8 - Write a solid-color packed RGBA8 frame (
width * height * 4bytes).