Referencia Zigmedia-daemon: IPC de qry.media.probe

media-daemon/ipc/probe_ipc.zig

Declaraciones públicas de media-daemon/ipc/probe_ipc.zig (media-daemon: IPC de qry.media.probe).

ImplementadoSin versión del tren todavía· generada desde apps/docs/generated/zig/media-daemon-ipc-probe.json

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

qry.media.probe (dec-0110 ME1; protocols/session-ipc messages/media-engine.md): the facts of an asset by the daemon's media engine, in process. It replaces the ffprobe that workers-svc spawned as a process (cmd.workers.probe, retired): FFmpeg is only ever a library here (dec-0110 §1), and the Zig engine answers first.

The request arrives verified by spire (signature, allowlist, contract). What is left is what the schema cannot say: the path guard (the source opens fd-relative under the media root, dec-0117 I3), the engine the registry resolves (libav only for a file of a trusted root, dec-0117 I6), and the untrusted facts of the file: every value that goes back is checked against the reply contract here, so a hostile file can drop a field but never make the reply invalid (an invalid reply would be a handler_error, i.e. no facts at all for a legitimate file).

max_streams

const · línea 33

pub const max_streams = 64

MAX_PROBE_STREAMS of the contract.

Context

type · línea 39

pub const Context = struct

What the probe handler needs from the daemon (nothing owned).

max_probe_ms

const · línea 53

pub const max_probe_ms: u64 = engine_source.max_request_ms

Longest a probe may run, whatever deadline the request carries (or none): the ceiling every engine call made for a control request shares (engine_source.max_request_ms).

probeBudgetMs

fn · línea 57

pub fn probeBudgetMs(deadline_ms: ?u64, now_ms: u64) u64

Milliseconds the probe may still run: up to the request's deadline, never more than max_probe_ms; 0 if the deadline already passed.

ProbeSource

type · línea 64

pub const ProbeSource = struct

The source a probe reads: opened under root://<rootId>/<relPath> as its label, never the bare relPath (dec-0135 D5: the label reaches the source's own log lines and, if it ever keys a cache, the cache's).

ProbeSource.open

fn · línea 71

pub fn open(gpa: std.mem.Allocator, ref: media_core.AssetRef) !ProbeSource

Opens ref fd-relative under its root (dec-0117 I7) with the root:// label; the caller owns the result and releases it with close.

ProbeSource.close

fn · línea 78

pub fn close(self: *ProbeSource) void

Closes the file and frees the label.

probe

fn · línea 85

pub fn probe(ctx: Context, arena: std.mem.Allocator, req: contracts.MediaProbeRequest) std.mem.Allocator.Error!Reply

qry.media.probe. Strings and the stream array of the reply live in arena.