Declaraciones públicas de media-daemon/ipc/media_engine_ipc.zig (media-daemon: IPC del motor de medios (empaquetado)).
apps/docs/generated/zig/media-daemon-ipc-media-engine.jsonPágina generada desde
native/zig/media-daemon/ipc/media_engine_ipc.zig. No se edita a mano:bun run docs:genla regenera ybun run docs:checkfalla si difiere.
Packaging handlers of the control socket (dec-0110 §3, dec-0120;
protocols/session-ipc messages/media-engine.md): Bun decides (engine per
session, tracks, segment length), the daemon validates and executes. Bytes
of media never travel here: the reply to cmd.media.openPackaging carries
the HTTP/3 URLs the player fetches.
The request arrives already verified by spire (signature, allowlist, contract: engine enum, segmentMs bounds, digest shapes); what is left here is what the schema cannot say (a half binding, the asset itself, capacity).
dec-0117 I1/I2: capActor/capResource bind the packaging session in the
capability authority, so /styx/pkg/<id>/... serves only a request carrying
an SCT playback-svc signed for that pkg_*; closing unbinds it first
(revocation). A session opened without a binding exists but no request can
ever read it (deny-by-default).
H3Endpointtype · línea 30
pub const H3Endpoint = structHTTP/3 endpoint advertised in an openPackaging reply.
Contexttype · línea 39
pub const Context = structWhat the packaging handlers need from the daemon (nothing owned).
replyErrorfn · línea 52
pub fn replyError(comptime Reply: type, code: []const u8, message: []const u8, recoverable: bool) ReplyBusiness error of a reply whose error field is ?E (every daemon reply
shares the shape {code, message, recoverable}, one generated type each).
ErrorCodetype · línea 59
pub const ErrorCode = structContract error code of an engine/source error and whether retrying can help.
errorCodefn · línea 62
pub fn errorCode(err: anyerror) ErrorCodeMaps an engine or source error to its contract ErrorCode.
parseBindingfn · línea 80
pub fn parseBinding(actor_hex: ?[]const u8, resource_hex: ?[]const u8) error{InvalidBinding}!?authority_mod.BindingcapActor + capResource: both → a binding, neither → null, only one →
error. Shapes (32/64 hex) are already guaranteed by the contract.
openPackagingfn · línea 96
pub fn openPackaging(ctx: Context, arena: std.mem.Allocator, req: contracts.MediaOpenPackagingRequest, deadline_ms: ?u64) std.mem.Allocator.Error!OpenReplycmd.media.openPackaging. Strings of the reply live in arena.
deadline_ms is the request envelope's (null = it had none): the open
stops there, or at Store.max_open_ms (ZC7-P2-01).
closePackagingfn · línea 165
pub fn closePackaging(ctx: Context, req: contracts.MediaClosePackagingRequest) contracts.MediaClosePackagingReplycmd.media.closePackaging: revoke first (dec-0117 I2), so a request
racing the close is refused before the entry goes away.