-
-
Notifications
You must be signed in to change notification settings - Fork 248
feat(publish): advertise the page clock at the catalog root #4082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3018516
chore(quest): claim quest/m1/publisher-clock
kixelated 24a6d5e
feat(publish): advertise the page clock at the catalog root
kixelated 9981d8c
docs(quest): split the remaining publisher clock work
kixelated 3c6c1a3
Merge remote-tracking branch 'origin/main' into merge-4082
kixelated 0c1f02d
test(publish): check the page clock against timeOrigin, not Date.now
kixelated File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # [M] CLI imports publish on the broadcast clock | ||
|
|
||
| ## Goal | ||
|
|
||
| `moq import` of fMP4, TS, and FLV publishes timestamps on the shared broadcast | ||
| clock, like native capture and `js/publish` already do, including source | ||
| restarts, late first frames, and real idle gaps. Today the imports publish | ||
| source PTS verbatim against a wall clock sampled at startup, so a TS feed with | ||
| a large starting PTS or a late first frame advertises the wrong wall time. | ||
|
|
||
| ## Plan | ||
|
|
||
| Use `moq_mux::Clock` and `SourceMap` with the root catalog `clock`; this adds | ||
| no clock API or catalog field. Select each source's initial mapping once, | ||
| account for a delayed first frame, and translate source resets onto the same | ||
| monotonic clock while preserving real idle gaps. System-wall adjustments do not | ||
| retime a running broadcast or old archive records. Preserve allowed B-frame | ||
| ordering within a group. | ||
|
|
||
| - fMP4 is passthrough, so translation must rewrite `tfdt`. | ||
| - A muxed source needs one mapping for all of its tracks, since interleaved | ||
| audio and video can step back further than `SourceMap::MAX_REORDER`. | ||
| - Keep conversion at the adapter boundary and refuse an unmappable source | ||
| explicitly. Discontinuity markers signal the existing playhead contract; | ||
| they do not replace the wall epoch. | ||
|
|
||
| CI fixtures drive the import path, not only the clock helper: simultaneous | ||
| A/V, a late first frame, a restart to zero, a restart after idle, and retained | ||
| archive playback. Update the import docs. | ||
|
|
||
| ## Related | ||
|
|
||
| - [Native clock fixtures](/quest/m1/native-clock-fixtures.md) - the same scenarios through native capture | ||
| - [GStreamer clock](/quest/m1/3021-moq-gst-anchor-generated-media-timelines-to-wall-clock.md) - separate source adapter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # [S] Native capture proves the broadcast clock in CI | ||
|
|
||
| ## Goal | ||
|
|
||
| Per-PR CI drives the native video and audio capture publishers through clock | ||
| edge cases and asserts the published timestamps: simultaneous A/V, a late | ||
| first frame, a restart to zero, a restart after idle, a system-wall | ||
| adjustment, and retained archive playback. Anything they catch is fixed here. | ||
|
|
||
| ## Plan | ||
|
|
||
| Native video already maps the device timeline onto `catalog.clock()` at open, | ||
| and native audio stamps arrival on it. The fixtures exercise publisher | ||
| integration with a synthetic device source and an injected clock, rather than | ||
| only the clock helper. No new clock API or catalog representation. | ||
|
|
||
| ## Related | ||
|
|
||
| - [CLI import clock](/quest/m1/cli-import-clock.md) - the same scenarios through `moq import` |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CatalogProduceris a public standalone API becausesrc/index.tsre-exports./catalog, so callers can use it with media whose timestamps are not based on this realm'sperformance.now(). After this change, those existing callers silently advertise the page origin as an authoritative mapping, causing HLS/DASH and other consumers to derive incorrect wall times. SeedpageClock()inBroadcastor accept an explicit clock instead of changing the generic producer's default.AGENTS.md reference: AGENTS.md:L53-L59
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right that
CatalogProduceris exported, so I corrected the PR description. Keeping the default, though: it matches Rust'scatalog::Producer, which seedsClock::new()and lets a caller override it. Here a standalone caller with a different timeline already controls it viamutate((c) => { c.clock = ... }), and every js/publish source stamps onperformance.now(), so the default is correct for the common case. Adding a constructor option would be new API with no consumer yet.(Written by Claude Opus 5.5)