Skip to content

fix(video): declare confirmed encoder reorder bounds - #6670

Merged
kixelated merged 5 commits into
mainfrom
quest/m1/encoder-reorder
Oct 25, 2026
Merged

kixelated merged 5 commits into
mainfrom
quest/m1/encoder-reorder

Conversation

@kixelated

@kixelated kixelated commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

When parameter sets omit their reorder bound, encoder probing leaves it unknown even after confirming controls that prohibit frame reordering. Readers then infer a decode clock unnecessarily.

Approach

Fill the probed rendition's existing reorder hint from the backend's applied controls. A confirmed preset declares zero; an unconfirmed backend preserves the parsed bound or leaves it inferred. The producer already copies this hint into its catalog.

Impact

  • Public API: unchanged.
  • Catalog: the existing reorder field explicitly declares zero for confirmed presets, including when parameter sets omit the bound. Wire and format schemas are unchanged.

Alternatives

The original quest assumed every encoder could promise no reordering. Source inspection shows V4L2 leaves B-frames to the driver, MediaCodec requests advisory hints, and MediaFoundation reports unconfirmed controls. Unconditionally declaring zero would be incorrect. Use the existing Applied::preset confirmation contract; backend controls are unchanged.

Validation

  • Missing-bound policy regression failed before the fix (None instead of Some(0)).
  • Confirmed and unconfirmed control policy test and OpenH264 published-rendition roundtrip: passed.
  • just ci: passed.

Follow-ups

None. Unconfirmed backends intentionally retain their existing parsed or inferred clock; this PR makes no unsupported promise about their controls.

(Written by GPT-6)

kixelated and others added 2 commits October 24, 2026 11:09
Use applied preset controls to advertise zero reordering when bitstream metadata omits it. Preserve parsed or inferred bounds for unconfirmed drivers. Policy and OpenH264 roundtrip tests and the full local CI gate pass.

Co-Authored-By: GPT-6 <noreply@openai.com>
@kixelated kixelated changed the title moq-video encoders declare no reordering fix(video): declare confirmed encoder reorder bounds Oct 24, 2026
@kixelated
kixelated marked this pull request as ready for review October 24, 2026 18:21
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 22 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

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: 91a92d42-6f69-4b47-b532-4531e97c84d2
Commits

Reviewing files that changed from the base of the PR and between c8b426b and 64b4fc2.

Files selected for processing: 5
  • quest/m1/README.md
  • quest/m1/encoder-reorder.md
  • rs/moq-video/src/encode/encoder.rs
  • rs/moq-video/src/encode/producer.rs
  • rs/moq-video/src/encode/sink.rs
  • 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 24, 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-25T05:42:18.827702Z 64b4fc2 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.

@kixelated

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: a9929f2115

ℹ️ 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".

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merge summary: no changes made by the merge pass. CI is green on a9929f2115, Codex reviewed that head with no findings, and quest check passes (the PR deletes the finished quest/m1/encoder-reorder.md and its link).

Checked that every backend reporting a confirmed Applied::preset (OpenH264, NVENC with frameIntervalP = 1, VA-API IDR/P only, VideoToolbox with frame reordering disabled) actually rules out B-frames, so declaring reorder: 0 holds. V4L2, MediaCodec, and MediaFoundation stay unconfirmed and keep the parsed or inferred bound.

(Written by Claude Opus 5.5)

@kixelated
kixelated added this pull request to the merge queue Oct 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 25, 2026
kixelated and others added 2 commits October 24, 2026 21:39
Main's API audit (#6517) dropped Sink::applied, which the reorder bound
reads when probing through a sink. Restore it crate-private, sending the
backend's report back with the opened encoder.

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

Copy link
Copy Markdown
Collaborator Author

The merge queue dropped this at a9929f2 (run): a semantic conflict with newer main, not a flake. moq-dev/moq#6517 removed Sink::applied, so probe_sink's sink.applied().reorder(...) stopped compiling (E0599).

b6ddda1 merges origin/main and restores Sink::applied as pub(crate) only (no public API change): the encode thread sends the backend's Applied back with the opened encoder, and Encoder::applied is no longer test-only. h264_roundtrip_publishes_avc3 (openh264, threaded sink) covers the crossing via reorder == Some(0). just check passes locally.

(Written by Claude Opus 5.5)

@kixelated
kixelated added this pull request to the merge queue Oct 25, 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 25, 2026
@kixelated

Copy link
Copy Markdown
Collaborator Author

Merged origin/main into the branch (64b4fc2) after the merge queue dropped b6ddda1 for a conflict.

  • Only conflict: quest/m1/README.md, where this PR removed the finished encoder-reorder entry and main removed the finished resume-compress entry next to it. Both lines dropped.
  • moq-video encode files auto-merged with the Rate to FrameRate rename from refactor(moq-video)!: rename Rate to FrameRate #6653; Sink::applied() stays pub(crate).
  • just check (moq-video and dependents) and quest check pass locally; Codex gave a thumbs-up on the new head.

(Written by Claude Opus 5.5)

@kixelated
kixelated added this pull request to the merge queue Oct 25, 2026
Merged via the queue into main with commit e8f3bed Oct 25, 2026
10 checks passed
@kixelated
kixelated deleted the quest/m1/encoder-reorder branch October 25, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant