Expand description
Turning compressed packets into pictures.
One trait, several backends, and a runtime choice between them. The choice
is the interesting part: which decoder exists depends on the platform and
on what was compiled in, and the two fail differently. A build without
decode-av1 and a Linux box without VA-API both produce “no decoder”, and a
person needs to know which one they are looking at — so open says.
§Where the decoders come from
vtome reads two encodings, H.264 and AV1 (Encoding::is_in_scope);
anything else is refused as out of scope before a backend is asked.
| Backend | Platform | What it decodes for vtome |
|---|---|---|
| VideoToolbox | macOS, iOS | H.264, and AV1 on hardware that has it |
| Media Foundation | Windows | H.264, AV1 |
| MediaCodec | Android | H.264, and AV1 where the device ships it |
| VA-API | Linux | whatever the driver exposes |
| dav1d | anywhere | AV1, in software |
The platform decoders come first: they are hardware-accelerated, and the patent licence for H.264 is the operating system’s rather than ours. dav1d is the floor — it is what makes “vtome can always play AV1, which it writes” true everywhere.
§What is implemented
H.264 through VideoToolbox (Apple targets), Media Foundation (Windows), and
MediaCodec (Android), each with decode-platform. For everything else open refuses
honestly, naming the backend that would have taken the work, rather than
returning a decoder that produces nothing. See planning/TODO.md §2.
Structs§
- Decoder
Config - What a decoder needs to know before the first packet.
- Stub
Decoder - A stub decoder for Phase 1 testing — returns empty frames.
Enums§
- Backend
- Which implementation decodes.
- Hardware
- Whether a codec may, must, or must not use dedicated hardware — for decoding and for encoding alike.
Constants§
Traits§
- Decoder
- Something that turns packets into frames.
Functions§
- backends_
for - Which backends could decode this, here, in this build.
- open
- A decoder for this configuration.
- open_
with open, with a say in whether the decoder runs in hardware.