Repository navigation
refactor(mux,gst,hls,rtmp,webrtc,hang): lifecycles hold one phase each #8211
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
18 commits
Select commit
Hold shift + click to select a range
ed2a0b1
chore(quest): claim quest/m1/explicit-state/mux-gst.md
kixelated b616826
refactor(mux,gst): export source, gst pads and source readers hold on…
kixelated c13f685
refactor(hls): the segment window, claim and import generation hold o…
kixelated 8a62b0c
fix(mux,hang): a skip records where the skipped group ended
kixelated 8870dc3
refactor(rtmp): the connected app name lives in the session's Connect…
kixelated 84bac6d
fix(webrtc): an ICE agent's failure is a phase every later next reports
kixelated 19c0df2
refactor(webrtc): the p2p channel handout is one phase
kixelated 3ce232e
refactor(mux): a jitter track's admission is one phase
kixelated 2ae14b3
Merge remote-tracking branch 'origin/main' into quest/m1/explicit-sta…
kixelated cd9a7da
style: rustfmt
kixelated c2d4d39
quest: rewrite mux-gst to the TS and fMP4 export lifecycles that remain
kixelated f2526ca
refactor(hls): a window's lists check stays inside the crate
kixelated 8e51176
fix(gst): a rendition already draining keeps draining across catalog …
kixelated 8e236bf
test(gst): the second catalog update is awaited on pad-added, not polled
kixelated efcea55
Merge remote-tracking branch 'origin/main' into fix/mux-gst-iteration
kixelated c288713
fix(hls,mux): a restart clears an ended window; drop the unobservable…
kixelated c87c2b1
Merge remote-tracking branch 'origin/main' into HEAD
kixelated 902c8ca
Merge remote-tracking branch 'origin/main' into quest/m1/explicit-sta…
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,57 +1,38 @@ | ||
| # [M] moq-mux and moq-gst lifecycles | ||
| # [M] TS and fMP4 export lifecycles | ||
|
|
||
| ## Goal | ||
|
|
||
| The lifecycles of moq-mux and moq-gst export and ingest are explicit state: | ||
| export sources, TS and fMP4 export tracks and programs, the HLS segment | ||
| window, the container consumer's startup, and the GStreamer sink and source | ||
| pads. Each phase's data lives in its variant, and no `.expect()` or flag | ||
| ordering stands in for a phase. | ||
| The TS and fMP4 export lifecycles in moq-mux are explicit state: the TS | ||
| export program and its tracks, the TS follower, passthrough, and group | ||
| buffer, and the fMP4 export track. Each phase's data lives in its variant, | ||
| and no `.expect()` or flag ordering stands in for a phase. | ||
|
|
||
| ## Plan | ||
|
|
||
| The shared decisions are in the [epic](/quest/m1/explicit-state/README.md). | ||
|
|
||
| No confirmed bug is folded into this child. Reproduce these two first: | ||
| No confirmed bug is folded into this child. Two suspected ones were checked | ||
| and are not defects: | ||
|
|
||
| - **fMP4 export** (`rs/moq-mux/src/container/fmp4/export.rs`): a track that | ||
| ends before it is ever described, while the catalog stays live, may keep | ||
| `init_ready()` false forever. | ||
| - **TS export track** (`rs/moq-mux/src/container/ts/export.rs`): | ||
| - Withdrawing a track keeps its parked frames, so it can become both | ||
| `withdrawn` and `listed`. | ||
| - `finished` carries five meanings, and the "gone" predicate ANDs eight | ||
| conditions. | ||
| - An fMP4 export track that ends before it is described, while the catalog | ||
| stays live, keeps `init_ready()` false. That wait is bounded: once other | ||
| tracks have media it fails at the init queue limit, naming the track. | ||
| Otherwise the live catalog can still move the rendition. | ||
| - A withdrawn TS track whose parked frames already went out stays listed. | ||
| This is intended, and `revision_test.rs` covers it. | ||
|
|
||
| Instances to redesign: | ||
|
|
||
| - **TS export `Program`**: `catalog`, `catalog_ended`, `cataloged`, | ||
| `retired`, `left`, `psi`, and others. `resume` hand-resets six fields. | ||
| - **`ExportSource`** (`container/source.rs`): `media`, `priority_control`, | ||
| `instance`, `live`, and `after` belong inside the `SourceState` variants. | ||
| - **Container `Consumer`** (`container/consumer.rs`): the startup phase and | ||
| the `track`/`track_error` reader state. The JS twin is | ||
| `js/hang/src/container/consumer.ts`, whose `#checkMaxDelay` moves `#active` | ||
| without `#recordPresented`. Change both together. | ||
| - **HLS** (`rs/moq-hls`): | ||
| - The segment window keeps `ended`, `cut`, and `failed`, and `push` after | ||
| `end()` isn't refused. | ||
| - Retiring a `Claim` takes two locks. | ||
| - The importer's `TrackState` generation fields. | ||
| - **Catalog publish gate** (`catalog/producer.rs`): `Reservations` writes its | ||
| predicate twice, in two shapes. | ||
| - **TS `Follower.refused`** belongs inside `Serving`. The TS `Passthrough` | ||
| start and clock, and the `GroupBuffer` content kind, also become explicit. | ||
| - **moq-gst sink pads** (`rs/moq-gst/src/sink/request_pad.rs`, `pad.rs`, | ||
| `imp.rs`): | ||
| - The `ended` bool means something different from `Status::Ended`. | ||
| - `releasing` is cleared after removal. | ||
| - The element's `drained`/`lingering`/`eos_delivered` and the pad's | ||
| `reserved`/`track`/`catalog`/`caps`/`failed` encode phases. | ||
| - **moq-gst source** `Entry`'s `reader`/`draining`. | ||
| - **Others**: | ||
| - The RTMP `ServerSession`: the connected app name belongs inside | ||
| `SessionState::Connected`. | ||
| - The moq-webrtc ICE `Agent`: its failure isn't sticky. | ||
| - The p2p channel handout. | ||
| - The jitter `Track`. | ||
| - **TS export `Program`** (`rs/moq-mux/src/container/ts/export.rs`): | ||
| `catalog`, `catalog_ended`, `cataloged`, `retired`, `left`, `psi`, and | ||
| others. `resume` hand-resets six fields. | ||
| - **TS export track**: `finished` carries five meanings, and the "gone" | ||
| predicate ANDs eight conditions. | ||
| - **TS `Follower.refused`** (`ts/follower.rs`) belongs inside `Serving`. The | ||
| TS `Passthrough` start and clock, and the `GroupBuffer` content kind, also | ||
| become explicit. | ||
| - **fMP4 export track** (`rs/moq-mux/src/container/fmp4/export.rs`): | ||
| `source`, `described`, `finished`, `resume`, and `group_finished` encode | ||
| its phases. Land after | ||
| [moq-dev/moq#7916](https://github.com/moq-dev/moq/pull/7916), which | ||
| rewrites this file. | ||
Oops, something went wrong.
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.
Script executed:
Repository: moq-dev/moq
Length of output: 2083
Script executed:
Repository: moq-dev/moq
Length of output: 5038
Keep the fMP4 init wait open for investigation.
If media stops below the timestamp-span limit and the catalog stays live and unchanged, the exporter can wait indefinitely without emitting init or queued media. The limit does not bound elapsed time.
Correct the quest