Referencia Zigtransmux

transmux/registry.zig

Declaraciones públicas de transmux/registry.zig (transmux).

ImplementadoSin versión del tren todavía· generada desde apps/docs/generated/zig/transmux.json

Página generada desde native/zig/transmux/transmux.zig. No se edita a mano: bun run docs:gen la regenera y bun run docs:check falla si difiere.

Engine selection (dec-0110 §3): which MediaEngine packages a session.

  • Config (daemon start): default = zig | libav | auto, fallback = off | libav (only with auto).
  • Per session the control plane may name the engine (policy decides in Bun; benchmarks and diagnosis override); the daemon VALIDATES it against the engine's declared capabilities and never assumes.
  • auto = zig when zig declares the capability for (container, codecs, fMP4-CMAF), else libav when built in and capable.
  • Hot fallback (zig fails opening, fallback = libav) is never silent: counted by reason and reported in the session's result.

registry.Choice

type · línea 21

pub const Choice = enum

Sin ///.

registry.Choice.parse

fn · línea 26

pub fn parse(s: []const u8) ?Choice

Sin ///.

registry.Fallback

type · línea 31

pub const Fallback = enum

Sin ///.

registry.Fallback.parse

fn · línea 35

pub fn parse(s: []const u8) ?Fallback

Sin ///.

registry.Config

type · línea 40

pub const Config = struct

Sin ///.

registry.Error

const · línea 45

pub const Error = EngineError || error{ /// The requested engine is not built into this daemon (`-Dlibav=false`). EngineUnavailable, /// libav was asked for a file it may not parse in this process /// …

Sin ///.

registry.LibavAdmission

type · línea 56

pub const LibavAdmission = enum

May libav parse this source inside the daemon's process (dec-0117 I6)? Only files of a root the operator marked trusted; the rest get the zig engine or nothing until the sandboxed worker exists (SEC-Z11).

registry.FallbackReason

type · línea 59

pub const FallbackReason = enum

Why the zig engine was replaced by libav on the way.

registry.Opened

type · línea 80

pub const Opened = struct

Sin ///.

registry.Probed

type · línea 86

pub const Probed = struct

Sin ///.

registry.Registry

type · línea 93

pub const Registry = struct

Sin ///.

registry.Registry.init

fn · línea 100

pub fn init(zig: contract.MediaEngine, libav: ?contract.MediaEngine, config: Config) Error!Registry

Rejects a configuration that names an engine that is not built in.

registry.Registry.fallbackCount

fn · línea 105

pub fn fallbackCount(self: *const Registry, reason: FallbackReason) u64

Sin ///.

registry.Registry.engine

fn · línea 112

pub fn engine(self: *const Registry, kind: contract.EngineKind, libav: LibavAdmission) Error!contract.MediaEngine

The engine kind, if built in and admitted for the bytes at hand (dec-0117 I6): libav for a file it may not parse in this process is EngineNotAllowed, never a silent replacement.

registry.Registry.supports

fn · línea 121

pub fn supports(e: contract.MediaEngine, info: *const facts.ContainerInfo, opts: packager.Options) bool

The engine declares what the file needs: its container and the codec of every stream the session would package.

registry.Registry.probe

fn · línea 145

pub fn probe(self: *const Registry, gpa: std.mem.Allocator, src: contract.ByteSource, cancel: *const contract.CancelToken, requested: ?Choice, libav: LibavAdmission) Error!Probed

Facts of src by the engine requested names (or the configured default), under the same rules as open: libav is the admission for src (dec-0117 I6: .refused for a file of an untrusted root, and then libav never sees a byte: by name it is EngineNotAllowed, under auto the zig error stands). Under auto, a container zig does not read (UnknownFormat, Unsupported) goes to libav when built in; a container zig reads but fails on is a hot fallback, only with fallback = libav, and reported in Probed.fallback. The caller owns info.

registry.Registry.open

fn · línea 173

pub fn open(self: *Registry, gpa: std.mem.Allocator, src: contract.ByteSource, cancel: *contract.CancelToken, requested: ?Choice, opts: packager.Options, libav: LibavAdmission) Error!Opened

Resolves requested (or the configured default) for src and opens a packaging session with it. cancel must outlive the session.