Skip to content

rust: Port libobs/obs-encoder-align-frame-rate-divisor.c.h to obs-output #5331

Closed

Description

@zackees

Phase 6 Rust swap of libobs/obs-encoder-align-frame-rate-divisor.c.h into obs-output, after prerequisite #5314 lands. The prerequisite extracts the C body without behavioral changes and adds test_encoder_align_frame_rate_divisor with its canonical graph registration.

Preserve the no-call guards for NULL encoder/media and divisor below two. Otherwise forward exactly once to video_output_align_frame_rate_divisor with the original media, full uint64 timestamp, encoder pointer and EXACT receive_video address used by raw-video registration. The C prerequisite keeps a static declaration in the same O unity group; a Rust swap must expose the real callback address through an internal C seam, rather than inventing another callback. Keep libobs-owned media/encoder lifetime and existing locking behavior.

Port all characterization assertions to safe Rust Tier 1, add the thin ABI shim and real field/callback seam, retain the unchanged source-only C fixture as an oracle and add equivalent external Rust boundary coverage for Tier 2, and add the original C oracle plus Tier 3 randomized differential and mutation coverage. The existing C fixture uses real video-io registration and callback+param lookup, with decoys that differ in just one identity component; preserve that proof. Network Tier 4 does not apply.

Use the shared Rust-static support infrastructure from #5246, never a placeholder or aborting stub. Build EVERY configured Linux *_rust consumer, run the whole native_build:: module, and check both Windows MSVC and Darwin arm64 links. The swap must wait for #5314 and #5246; do not combine it with encoder output-slot extraction work. Public headers and existing C tests remain unchanged.

Prerequisite publication is currently BRANCH-ONLY because ci/backpressure.py returned 75 (runner starvation). Validated and pushed head: d48d033 on test/5314-encoder-align-divisor. No prerequisite PR was opened. Wait for #5314 to be published and merged before starting this swap.

The final C fixture also gives its decoy callback a distinct observable body, protecting its address-based assertions against identical-code folding. Carry that property into any new external Rust boundary fixture. Source-only characterization is not sufficient Tier 2 coverage for the later swap.

Activity

  1. added
    port
    ready
    P2
    size:S
    on Nov 20, 2026
  2. zackees commented on Nov 20, 2026

    @zackees
    MemberAuthor

    Claiming: Rust swap of encoder frame-rate divisor alignment in pool slot obs-studio2, branch port/5331-encoder-align-divisor.

    1. Preserve the real C receive_video callback identity through an internal seam, with a safe Rust core and NULL-safe FFI.
    2. Commit RED then GREEN; add Tier 1, external Tier 2 and original-C Tier 3 parity/mutation coverage using shared Rust-static support.
    3. Validate native_build, every Linux Rust-static consumer, Windows/Darwin links, formatting and lint; merge-tree against libobs: characterize and extract encoder output-list pair (Refs #5313) #5317/obs-output: port hidden service registry lookup to Rust (Refs #5273) #5280, then publish subject to backpressure. Expected first publication this session after validation. Prerequisite libobs: characterize and extract encoder frame-rate divisor alignment (Refs #5314) #5333 is merged at 0f5f3e1.
  3. rdoupe commented on Nov 22, 2026

    @rdoupe
    Collaborator

    Done by #5396 (swap) after #5333 (extraction): the encoder frame-rate divisor alignment now comes from obs-output; the C original is the reference-only libobs.ported-encoder-align-frame-rate-divisor group.

  4. moved this from In progress to Done in obs-rust Multiviewon Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2portreadysize:S

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions