PrismCore / API reference / Probing and input

Structure

ProbeTiming

struct ProbeTiming

Declared in Sources/PrismCore/Probe/ProbedSource.swift · PrismCore 3.5.4

A source that has been opened and read once, holding both the answer (info) and the open context that produced it.

A playback used to open its source twice: the host probes to decide how to play, then the remuxer opens again to produce. Over a network that second open is a real round trip and a real download — measured at a median of 54 ms even capped, on a link with no latency at all — and it happens inside the wait a user is watching.

The tempting shortcut is to keep the first open's conclusions and let the second context skip its analysis. That was tried in 1.1.2 and reverted: avformat_find_stream_info also fills fields the muxer needs (an EAC3 track's frame size, most sharply), so a context that never ran it produces a correct-looking manifest and a failing av_interleaved_write_frame. The analysis isn't redundant knowledge — it is state that lives in the context.

So the context itself moves. consumeContext() hands it over exactly once; whoever takes it owns closing it, and a ProbedSource that is never consumed (the host declined the source, or never started a session) closes its own on the way out.

Threading: an AVFormatContext is not safe for concurrent use, and this deliberately does not make it so. The handover is a move across threads — the probing side must be finished with it, which consuming it exactly once enforces structurally — not a share. The probe's cost, phase by phase. Each phase blocks on the transport, so on a network source these are transport numbers, not CPU numbers.

Instance properties

let open: Duration

avformat_open_input: connect + container header.

let streamInfo: Duration

avformat_find_stream_info: the bounded stream analysis.

let describe: Duration

Per-stream description, including the interlace verification when it ran — the phase that DECODES, so a declared-interlaced H.264 source pays for real packets here.

let hdr10PlusScan: Duration

The opt-in HDR10+ packet scan (HDR10PlusScan); zero when it was not asked for. Separate from describe so its cost is visible on its own — it is the one phase a host chooses to pay.

var total: Duration { get }

No documentation comment in the source.

Generated from the public symbols of PrismCore 3.5.4. All types