Declaraciones públicas de transmux/plan.zig (transmux).
apps/docs/generated/zig/transmux.jsonPágina generada desde
native/zig/transmux/transmux.zig. No se edita a mano:bun run docs:genla regenera ybun run docs:checkfalla si difiere.
Segment plan: where each HLS/CMAF segment starts and ends, decided from the keyframe index before any media is read. Every segment starts on a keyframe of the reference (video) track, so any segment can be produced on its own (seek + mux): the playlist is known up front (VOD), and a seek in the player only costs the segments it asks for.
Common to both engines: the plan is the same whether engine=zig or
engine=libav produce the segments, as long as their keyframe indexes
agree (the head-to-head harness checks that they do).
plan.Segmenttype · línea 16
pub const Segment = structSin ///.
plan.Segment.durationUsfn · línea 20
pub fn durationUs(self: Segment) i64Sin ///.
plan.Plantype · línea 25
pub const Plan = structSin ///.
plan.Plan.deinitfn · línea 28
pub fn deinit(self: *Plan, gpa: std.mem.Allocator) voidSin ///.
plan.Plan.targetDurationSfn · línea 34
pub fn targetDurationS(self: Plan) u64EXT-X-TARGETDURATION: the longest segment, rounded up to whole seconds.
plan.Plan.segmentAtfn · línea 41
pub fn segmentAt(self: Plan, t_us: i64) usizeIndex of the segment that contains t_us (clamped to the ends).
plan.Errorconst · línea 52
pub const Error = error{ OutOfMemory, Unsupported, TooLarge }Sin ///.
plan.max_segmentsconst · línea 56
pub const max_segments: usize = 1 << 20Segments of one plan at most (2^20 x 6 s = 72 days): a hostile duration cannot turn the time-based cutting into an unbounded loop.
plan.max_span_usconst · línea 59
pub const max_span_us: i64 = 1 << 42Longest presentation a plan covers (2^42 us, about 50 days): beyond it the timestamps are hostile or corrupt, not a recording.
plan.buildfn · línea 67
pub fn build(gpa: std.mem.Allocator, keyframes: []const facts.Keyframe, start_us: i64, end_us: i64, target_us: i64, segment_cap: usize) Error!PlanCuts at the first keyframe at least target_us after the current cut.
keyframes = PTS keyframe index of the reference track (may be empty:
audio-only, or cut every target_us from start_us). end_us = end of
the presentation. A plan of more than segment_cap segments (at most
max_segments) is TooLarge, however it is cut: the cap bounds what
the plan, and every playlist rendered from it, can weigh (ZT4-P1-01).