Skip to content

refactor(mux)!: container formats name inputs - #6449

Merged
kixelated merged 13 commits into
mainfrom
quest/m1/api-audit/container-format
Oct 24, 2026
Merged

kixelated merged 13 commits into
mainfrom
quest/m1/api-audit/container-format

Conversation

@kixelated

@kixelated kixelated commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes quest quest/m1/api-audit/container-format.md: moq_mux::import::ContainerFormat now names only the input it parses. Each format string means one thing.

Changes

  • ContainerFormat::Cmaf is gone from moq-mux, moq-ffi (MoqContainerFormat::Cmaf), moq-c (MOQ_CONTAINER_FORMAT_CMAF), the Go wrapper constant, and the regenerated Dart bindings. Nothing called it. "cmaf" parses as Fmp4 again. CMAF passthrough is available only in Rust, through fmp4::Import::with_passthrough and moq_hls::import::Config::passthrough, which the CLI already uses.
  • "m2ts" no longer parses as Ts. In the catalog, m2ts means the TS passthrough track, and on disk it means BDAV 192-byte packets, which the TS demuxer cannot read. No caller used the alias.
  • Main's finished-importer release test (fix(mux): finished importers release their input storage #6543) covered passthrough through ContainerFormat::Cmaf. It now builds fmp4::Import::with_passthrough(true) directly, so the coverage stays.
  • import::ContainerStream is deleted. It was a line-for-line copy of Container. Container::new with an empty ContainerInit::data does the same thing, and the split-stream test now covers that path.
  • The ts::passthrough module is private. Only ts::Passthrough is exported. Its decode and finish return moq_mux::Result instead of anyhow. The four error structs are now the moq_mux::Error::{TsPacketSize, PcrRewind, PcrRestart, PcrGap} variants. The public FALLBACK, GROUP_BYTES_MAX, and GROUP_OBJECTS_MAX constants are crate-private, and the module docs moved onto Passthrough.
  • import::Container::cut, fmp4::Import::cut, and fmp4::Import::discontinuity return Result, like import::Track's. Callers in moq-hls, moq-c, and moq-ffi propagate it.
  • Updated doc/lib/{c,cpp,dart,go,kt,py,swift}. Migration notes are in the Public API section below rather than MIGRATE.md, which PRs no longer write since moq-dev/moq#6610.

Choices made without asking

  • No ts::passthrough::{Import, Export} rename. The quest only said to consider it, and it would need the module to be public again, which goes against making it private. ts::Passthrough / ts::Release stay.
  • fmp4::Import::cut also returns Result. The quest named only discontinuity. Container::cut delegates to it, and the HLS importer calls both, so I made the two consistent.
  • doc/lib/layers.md is unchanged. It never mentioned ContainerStream.

Public API

Breaking:

  • moq-mux: ContainerFormat::Cmaf, import::ContainerStream, container::ts::passthrough::* (except ts::Passthrough) are removed. The "m2ts" alias is gone. Passthrough::{decode, finish} return moq_mux::Result. Container::cut and fmp4::Import::{cut, discontinuity} return Result. Four Error variants are added (the enum is #[non_exhaustive]).
  • moq-ffi: MoqContainerFormat::Cmaf is removed.
  • moq-c: MOQ_CONTAINER_FORMAT_CMAF is removed.
  • Wrappers: py, swift, kt, dart, cpp, and go lose their CMAF ContainerFormat value. Go's was the hand-written media.ContainerFormatCmaf. The others re-export the generated enum.

The CMAF enum values were added in moq-dev/moq#6250 and never released. For a binding user, the net change since the last release is the corrected #6250 note below.

For the breaking cut: the ## Unreleased fMP4 entries #6250 left on main tell readers to pass the CMAF format value this PR deletes (rs/moq-ffi, rs/moq-c, py/moq-rs, swift, kt/moq, dart/moq, and go/wrapper MIGRATE.md), and rs/moq-mux/MIGRATE.md says "cmaf" selects ContainerFormat::Cmaf. The notes below supersede those entries; collapse them at the cut.

How to migrate:

  • Bindings (feat(moq-mux)!: unwrap fMP4 import to Legacy by default #6250's note, corrected): a container import with the Fmp4 format (MoqContainerFormat::Fmp4 / .fmp4 / .FMP4 / MoqContainerFormatFmp4, moq::ContainerFormat::kFmp4, MOQ_CONTAINER_FORMAT_FMP4, media.ContainerFormatFmp4) now publishes one Legacy frame per sample instead of one CMAF frame per fragment. A reader that follows the catalog's container needs no change. Republishing each fragment whole as CMAF is Rust-only, through moq_mux::container::fmp4::Import::with_passthrough. Drop any use of the unreleased CMAF format value.
  • moq-mux, fMP4: import::ContainerFormat::Fmp4 (and "cmaf", still its alias) unwraps to Legacy; import::Container has no passthrough, so build an fmp4::Import with .with_passthrough(true) to keep CMAF.
  • moq-mux, ContainerStream: call import::Container::new with ContainerInit::new(format, Bytes::new()) instead; a container recovers its own framing, so it takes chunks split anywhere.
  • moq-mux, "m2ts": it no longer parses as ContainerFormat::Ts; pass "ts", "mpegts", or "mpeg2ts".
  • moq-mux, ts::passthrough: the module is private; ts::Passthrough stays, and its decode and finish return moq_mux::Result. Match moq_mux::Error::{TsPacketSize, PcrRewind, PcrRestart, PcrGap} where you downcast to PacketSizeError, PcrRewindError, PcrRestartError, or PcrGapError. passthrough::{FALLBACK, GROUP_BYTES_MAX, GROUP_OBJECTS_MAX} are gone; the ts::Passthrough docs describe the bounds.
  • moq-mux, cuts: import::Container::cut, fmp4::Import::cut, and fmp4::Import::discontinuity return Result<()>, like import::Track's; propagate it with ?.

Wire: none. CLI: none, since --passthrough is unchanged and no flag parses these strings.

Checks

Re-merged main through 83df8615c6 after a third conflict drop (the api-audit quest file only: main edited it for moq-dev/moq#6610, and this branch's deletion wins). just check (including the rs, py, js, cpp, obs, and dart checks) and just test interop --all (172 checks) pass on the merged head.

Re-merged main again through f206893047 after a second conflict drop: main finished the CLI flags quest (moq-dev/moq#6522), so its deletion wins over this branch's edit to cli-flags.md. just check (including the rs, js, and py tests) and just test interop --all pass on 636c8f3.

Before that: re-merged main through 4ccf05aac6 after the queue dropped this PR on a conflict (MIGRATE.md and the api-audit quest README only; every MIGRATE.md takes main's version and the notes moved to Public API above). just check and just test interop --all (172 checks) pass on the merged head.

Earlier: After merging main: just check passed (js, rs, quest, py, kt, swift, go, dart, plus the rs/js/py tests). The dart RSS leak test a non-null optional argument is released failed twice under machine load and then passed, and it passed on main, so it is load noise, not this PR. quest check --base origin/main passed. just test interop --all passed.

Follow-ups

  • fmp4::Import::discontinuity only resets decode times. Track::discontinuity publishes hang's discontinuity marker. An HLS EXT-X-DISCONTINUITY probably should publish the marker too, which would give the new Result a real failure path.
  • ts::Import, ts::Export, and ts::Release still report errors through anyhow (Error::Other). Folding them into typed moq_mux::Error variants is the same work this PR did for passthrough, at a larger scale.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EeyiEy5FWz3z44DYZVo7vU

(Written by Claude Opus 5.5)

kixelated and others added 4 commits October 22, 2026 19:51
Delete ContainerFormat::Cmaf (and its moq-ffi, moq-c, and wrapper
mirrors) so a format names only what is parsed; "cmaf" parses as fmp4
again and "m2ts" is no longer a TS alias. Delete ContainerStream, a
copy of Container. Make ts::passthrough private, folding its errors into
moq_mux::Error. Container::cut and fmp4::Import::{cut, discontinuity}
return Result.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EeyiEy5FWz3z44DYZVo7vU
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EeyiEy5FWz3z44DYZVo7vU
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EeyiEy5FWz3z44DYZVo7vU
@kixelated kixelated changed the title Container formats name inputs refactor(mux): container formats name inputs Oct 23, 2026
@kixelated
kixelated marked this pull request as ready for review October 23, 2026 03:22
@kixelated

Copy link
Copy Markdown
Collaborator Author

Outcome: quest finished with no open decisions, marked ready. just check passed. Choices made without asking are listed in the body: no ts::passthrough::{Import, Export} rename (the module is now private), and fmp4::Import::cut also returns Result so it matches discontinuity.

(Written by Claude Opus 5.5)

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4396a6a3-564f-492d-992d-2e7d7a403bb1
📥 Commits

Reviewing files that changed from the base of the PR and between 05a9e5b and 5eef649.

📒 Files selected for processing: 38
  • cpp/moq/MIGRATE.md
  • dart/moq/MIGRATE.md
  • dart/moq_ffi/MIGRATE.md
  • dart/moq_ffi/lib/src/moq.dart
  • doc/lib/c/index.md
  • doc/lib/cpp/index.md
  • doc/lib/dart/index.md
  • doc/lib/go/index.md
  • doc/lib/kt/index.md
  • doc/lib/py/index.md
  • doc/lib/swift/index.md
  • go/ffi/MIGRATE.md
  • go/wrapper/MIGRATE.md
  • go/wrapper/media/media.go
  • kt/moq-ffi/MIGRATE.md
  • kt/moq/MIGRATE.md
  • py/moq-rs/MIGRATE.md
  • quest/m1/api-audit/README.md
  • quest/m1/api-audit/cli-flags.md
  • quest/m1/api-audit/container-format.md
  • rs/moq-c/MIGRATE.md
  • rs/moq-c/src/api.rs
  • rs/moq-c/src/publish.rs
  • rs/moq-ffi/MIGRATE.md
  • rs/moq-ffi/src/media.rs
  • rs/moq-hls/src/import.rs
  • rs/moq-mux/MIGRATE.md
  • rs/moq-mux/src/container/fmp4/import.rs
  • rs/moq-mux/src/container/fmp4/import_test.rs
  • rs/moq-mux/src/container/ts/mod.rs
  • rs/moq-mux/src/container/ts/passthrough.rs
  • rs/moq-mux/src/container/ts/passthrough_test.rs
  • rs/moq-mux/src/error.rs
  • rs/moq-mux/src/import/container.rs
  • rs/moq-mux/src/import/format.rs
  • rs/moq-mux/src/import/mod.rs
  • swift/MIGRATE.md
  • swift/ffi/MIGRATE.md
💤 Files with no reviewable changes: 4
  • quest/m1/api-audit/README.md
  • go/wrapper/media/media.go
  • rs/moq-c/src/api.rs
  • quest/m1/api-audit/container-format.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.

Walkthrough

The change removes the distinct CMAF container format and maps cmaf to fMP4. Container imports accept split chunks, and cut and discontinuity errors now propagate through importer call paths. MPEG-TS passthrough reports errors through the crate error type, with several public passthrough items removed or restricted. Language bindings, migration guides, API documentation, and API-audit notes are updated to reflect these changes.

Priority: Low

Merge Risk: Minimal · up to 5eef6

No actionable merge-blocking issue is established. The change is ready for normal merge checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 51.35% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 37 functions across 12 files. (22 skipped… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely identifies the main refactor: container formats now name parsed inputs.
Description check Passed The pull request description is specific and directly relevant to the changeset. It explains the removal of ContainerFormat::Cmaf across moq-mux, moq-ffi, moq-c, and the Go and Dart wrappers, the remo…
Full details: Description check

Explanation

The pull request description is specific and directly relevant to the changeset. It explains the removal of ContainerFormat::Cmaf across moq-mux, moq-ffi, moq-c, and the Go and Dart wrappers, the removal of the m2ts alias and ContainerStream, the privatization of ts::passthrough with its errors moved into moq_mux::Error, and the Result return-type changes for cut and discontinuity. It also gives migration steps and test results. The description matches the raw summary's files and the PR objectives.

Full details: Docstring Coverage

Explanation

Docstring coverage is 51.35% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 37 functions across 12 files. (22 skipped: 22 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T22:10:41.396110Z — New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8e55967474

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread dart/moq_ffi/lib/src/moq.dart
kixelated and others added 2 commits October 23, 2026 17:38
Replaces main's new ContainerFormat::Cmaf release test with fmp4 passthrough,
and adds the #6250 Fmp4 entry to the raw binding MIGRATE files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

@codex review

(Written by Claude Opus 5.5)

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 5b6e9635ca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# Conflicts:
#	quest/m1/api-audit/cli-flags.md
@kixelated
kixelated added this pull request to the merge queue Oct 24, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 24, 2026
# Conflicts:
#	dart/moq_ffi/MIGRATE.md
#	go/ffi/MIGRATE.md
#	kt/moq-ffi/MIGRATE.md
#	quest/m1/api-audit/README.md
#	quest/m1/api-audit/container-format.md
#	swift/ffi/MIGRATE.md
@kixelated kixelated changed the title refactor(mux): container formats name inputs refactor(mux)!: container formats name inputs Oct 24, 2026
@kixelated
kixelated added this pull request to the merge queue Oct 24, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1ce0f0e239

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread rs/moq-ffi/src/media.rs
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 24, 2026
Main finished the CLI flags quest, so its deletion wins over this
branch's edit to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated added this pull request to the merge queue Oct 24, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 24, 2026
@kixelated
kixelated enabled auto-merge October 24, 2026 17:41
@kixelated
kixelated added this pull request to the merge queue Oct 24, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 24, 2026
@kixelated
kixelated added this pull request to the merge queue Oct 24, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 24, 2026
# Conflicts:
#	quest/m1/api-audit/container-format.md
@kixelated
kixelated added this pull request to the merge queue Oct 24, 2026
Merged via the queue into main with commit 74b9ff5 Oct 24, 2026
11 checks passed
@kixelated
kixelated deleted the quest/m1/api-audit/container-format branch October 24, 2026 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant