Commit Graph
5 Commits
Author SHA1 Message Date
Christian PillsburyandClaude Opus 4.8 6d26e083a5 feat(spf): collapse relocation tiers into shared-min default (spike)
Replace the per-type "Tier 1" / shared-min "Tier 2" split with one default
`deriveSharedMinStartMediaTime`: relocate every track by the `min` across the
selected A/V origins. Subsumes per-type — aligned origins reduce to each type's
own, skewed origins keep every DTS >= 0 while preserving A/V skew, and a single
selected type reduces to its own origin. Returns undefined until all selected
types are discovered (shared-min barrier). `derivePerTypeStartMediaTime` stays
as a barrier-free opt-out.

The loader stamp is now tier-agnostic: `stampStartMediaTime` applies the same
injected `derive` over `mediaContainerData` (not the raw own-origin), async with
an `awaitDefined` holdback and liveness guard. Engines resolve one
`deriveStartMediaTime` and feed it to both the reactor and
`relocationPipelinesFor(type, derive)` so model and buffer agree.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-13 14:37:10 -07:00
Christian PillsburyandClaude Opus 4.8 b820064b77 wip(spf): per-type relocation keying + non-0th-segment origin fix
- Key mediaContainerData by track *type* (video/audio), not track id: one
  init+media pair per type, ABR rungs share the origin. relocationMessagePipelines
  -> relocationPipelinesFor(type); the engines pass per-type.
- #4 fix: record the discovered segment's 0-based startTime and derive the origin
  as baseMediaDecodeTime/timescale - segmentStartTime, so relocation is correct when
  the first loaded segment isn't the 0th (non-zero initial currentTime, live/DVR).
  Adds segmentStartTime to MediaContainerData.
- Rename derivePerTrackStartMediaTime -> derivePerTypeStartMediaTime; stampTracks
  applies each type's origin to every track of that type.
- Add establish-start-media-time derive unit test.

Unit-verified (segmentStartTime=100 still yields origin 60) and end-to-end
sandbox-verified: start-at-300 buffers around the playhead (0-based); default
start-at-0 A/V + audio-only remain 0-based.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-10 07:20:43 -07:00
Christian PillsburyandClaude Opus 4.8 05a0a6452d wip(spf): non-zero-PTS relocation as establishStartMediaTime reactor + relocation steps
Rebuild relocation from the config-bundle (createRelocation + self-discriminating
origin-discoverer) into a DOM-free per-source reactor plus DOM config-pipeline
steps, per the presentation-timeline design + review.

- behaviors/establish-start-media-time.ts (new, DOM-free): the reactor — 3 states
  (inactive clears the transient slot per source / monitoring runs the injected
  deriveStartMediaTime seam -> writes Track.startMediaTime / established disables it).
  Owns mediaContainerData on state; selection optional/defensive; never touches pipelines.
- behaviors/dom/relocation-steps.ts (new): relocationMessagePipelines — a plain
  config step array. discover writes state.mediaContainerData; stamp reads the
  track's own discovered origin (Tier 1) -> timestampOffset. Steps read composition
  state from call-time deps; coordinate with the reactor only through the slot.
- segment-loader: StepDeps widened with the composition {state,context,config}
  (opaque conduit; the loader never reads them).
- primitives/head-peek.ts (new): generic eager head-peek (replaces origin-discoverer).
- media/types: Track.startMediaTime + MediaContainerData.
- setup-buffer-actors: relocation pipelines from config; threads composition deps.
- engine: composes the reactor + bakes relocationMessagePipelines + mediaContainerData
  + deriveStartMediaTime config, comment-marked for easy removal.
- Deleted relocation.ts, origin-discoverer.ts. Doc + backlog updated.

Deferred (backlog): per-type keying; non-0th-segment origin (#4 — non-zero starts
currently mis-relocate); tier-agnostic apply; text-cue relocation; Tier 2 min;
audio-only wiring.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 14:05:36 -07:00
Christian PillsburyandClaude Opus 4.8 ae1b0beeec wip(docs): reactor-based relocation design + spike backlog
Rearchitect presentation-timeline-model.md around the establishStartMediaTime
reactor (mediaContainerData slot, pure deriveStartMediaTime seam,
Track.startMediaTime consume, abortable awaitDefined apply); resolve the
reduce-hinge and startMediaTime-storage open questions.

Add a living Status & backlog to the spike plan so commits never bury
outstanding refactor/review work.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 12:04:42 -07:00
Christian PillsburyandClaude Opus 4.8 555f9fdacc docs(spf): add presentation timeline coordinate model design doc
Consolidates the design-discovery for the timestampOffset-relocation
approach to non-zero-PTS: the three-timeline coordinate model
(media / presentation / wall-clock, with timestampOffset derived from
startTime - startMediaTime), the orthogonal capability axes
(relocation / parser / coordination), the discover -> reduce -> apply ->
consume architecture with branch-free always-present actors, and the open
hinges -- chief among them generalizing the live establishment behavior
for VOD. Draft; spike-stage.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-07 12:50:28 -07:00