Expand description
In-process codec registry.
Every codec crate declares itself with one CodecInfo value —
capabilities, factory functions, the container tags it claims, and
(optionally) a probe function used to disambiguate genuine tag
collisions. The registry stores those registrations and exposes
three orthogonal lookups:
- id-keyed —
make_decoder(params)/make_encoder(params)walk the implementations registered underparams.codec_id, filter by capability restrictions, and try them in priority order with init- time fallback. - tag-keyed —
resolve_tag(&ProbeContext)walks every registration whosetagscontainsctx.tag, calls each probe (treatingNoneas “returns 1.0”), and returns the id with the highest resulting confidence. First-registered wins on ties. - diagnostic —
all_implementations,all_tag_registrations.
The tag path explicitly DOES NOT short-circuit on “first claim with no probe” — every claimant is asked, so a lower-priority probed claim can out-rank a higher-priority unprobed one when the content is actually ambiguous (DIV3 XVID-with-real-MSMPEG4 payload etc.).
Structs§
- Codec
Implementation - Internal per-impl record held inside the registry’s id map. Kept
distinct from
CodecInfoso the id map stays cheap to walk duringmake_decoder/make_encoderlookups. - Codec
Info - A single registration: capabilities, decoder/encoder factories, optional probe, and the container tags this codec claims.
- Codec
Registry