Skip to content

obs-output: Port public encoder audio getters (#3941) - #3944

Merged
zackees merged 4 commits into
masterfrom
port/3941-encoder-audio-getters
Nov 7, 2026
Merged

zackees merged 4 commits into
masterfrom
port/3941-encoder-audio-getters

Conversation

@zackees

@zackees zackees commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Fixes #3941. Refs #3856.

Ports obs_encoder_get_sample_rate, obs_encoder_get_frame_size and obs_encoder_get_mixer_index into obs-output. Preserves NULL defaults and debug diagnostics, wrong-type warnings with the encoder name, current rather than original encoder type, missing-media precedence over stored sample rate, lazy audio fallback and independent full-width frame size and mixer index. No intentional behavior differences.

Follows #3938 and #3927: new per-port files, a borrowed private field-pointer adapter, automatic adapter discovery without a build.rs extraction block, and a native registration entry that selects only its own target. The name is borrowed as char *const * and the oracle owns its name buffer. Sample-rate routing reuses the existing Rust helper and its original C counterpart. The oracle receives production getter and media callbacks instead of directly calling production libobs getters. Existing Core state and Application test binaries are reused.

Commit sequence after rebase: actual-library C characterization c806a2f, separate building verbatim extraction 8d62430, Tier 1 RED f7a64fd and Rust GREEN 16543aa. Both RED tests fail at deliberate stubs with exit 101. Characterization and extraction each passed three repeats against both libraries before the Rust swap. The characterization C test is unchanged after its first commit. Its first run lacked an X display; running under Xvfb resolved startup without changing the assertions.

Validation:

  • All five focused safe-API, real-header layout and differential tests pass on the rebased head. Layout checks cover every borrowed field and the encoder type representation. Deterministic and randomized parity compare values, full diagnostics and whole-encoder immutability. Proptest persistence is disabled.
  • Forcing valid frame sizes and mixer indices to zero makes both differential tests fail with exit 101. Restoring GREEN passes all five tests again.
  • Final Tier 2 passes five encoder tests three times against each library: audio getters, output-getter characterization, audio-start steps, audio-start frame conversions and size steps. Linkage resolves to the intended hybrid and C-reference directories. Both libraries have identical sets of 1,767 dynamic exports.
  • GCC and Clang accept the oracle, fixture callbacks, extracted group and existing blog log-link stub with nonliteral-format warnings treated as errors. The installed host Clang executable was mounted read-only for the Docker replay.
  • The complete native-build module passes 149 tests and two child probes. Obs-util passes all 914 tests and both doctests with exit zero; its negative-path cases emit expected error diagnostics.
  • Oracle discovery, native registration entries, native portability, graph sorting and README policy checks pass after rebase.
  • Final serial full lint with porcelain disabled passes formatting, repository self-tests, workspace Clippy and feature-set Clippy. One primary read-only review found no actionable issues. A fresh fetch and rebase immediately before the final push required no further changes; the lease-protected push preserves the three earlier commits as verified by range-diff.

Test cost over 25 debug runs per new module: safe API longest 0.01 seconds and peak RSS 11,564 KiB; parity longest 0.06 seconds and peak RSS 17,480 KiB; registration longest 0.04 seconds and peak RSS 10,876 KiB. Each isolated parity child opens one existing audio-output worker and joins it on cleanup. Safe API and registration cases start no threads. No new Rust test executable.

Public headers, pre-existing C tests, WebSocket and workflows are unchanged. No behavior change or features-ledger entry. Tier 4 is inapplicable. The full cmocka suite, full workspace execution, native Windows/macOS and hosted CI were not verified locally. No native-coverage label exists in this repository. There is no local-gate attestation, so hosted validation remains enabled.

@zackees
zackees force-pushed the port/3941-encoder-audio-getters branch from 4dbc4db to 16543aa Compare November 7, 2026 21:21
@zackees
zackees marked this pull request as ready for review November 7, 2026 21:21
@zackees
zackees enabled auto-merge November 7, 2026 21:22
@zackees
zackees added this pull request to the merge queue Nov 7, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 7, 2026
@zackees
zackees added this pull request to the merge queue Nov 7, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 7, 2026
@zackees
zackees force-pushed the port/3941-encoder-audio-getters branch from 16543aa to d170930 Compare November 7, 2026 23:08
@zackees
zackees enabled auto-merge November 7, 2026 23:08
@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Rebased onto master d9c613e, replacing 16543aa with d170930. Kept master’s dimension and core-global ports alongside the audio field adapter, registration and shared test modules. Characterization, extraction, RED and GREEN order is preserved, and the characterization C test is unchanged. All five focused Tier 1 and Tier 3 tests, the complete native_build module, obs-util and doctests, oracle discovery, registration, portability, graph sorting, README, Rust formatting and pinned clang-format checks passed. GCC and Clang compiled the affected native unity groups under Nix. The lease-protected push is verified and auto-merge is re-armed on this head; hosted CI remains the merge gate.

@zackees
zackees added this pull request to the merge queue Nov 7, 2026
Merged via the queue into master with commit eeace9c Nov 7, 2026
40 checks passed
@zackees
zackees deleted the port/3941-encoder-audio-getters branch November 7, 2026 23:52
@obs-rust-project-manager obs-rust-project-manager Bot moved this from In review to Done in obs-rust Multiview Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

rust: Port obs-encoder.c.h public audio getters to obs-output

1 participant