Skip to content

obs-output: Port public encoder width and height getters (#3936) - #3938

Merged
zackees merged 4 commits into
masterfrom
port/3936-encoder-dimensions
Nov 7, 2026
Merged

zackees merged 4 commits into
masterfrom
port/3936-encoder-dimensions

Conversation

@zackees

@zackees zackees commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Fixes #3936. Refs #3856.

Ports obs_encoder_get_width and obs_encoder_get_height to obs-output. Reuses the existing encoder_size routing helper and preserves NULL debug diagnostics, wrong-type warnings with the encoder name, missing-media precedence over scaled dimensions, independent full-width scaled axes, and lazy video fallback. No intentional behavior differences.

The new borrowed field adapter retains the private encoder layout in C and borrows context.name as char *const *. The oracle owns its name buffer, uses the original C size helper, and receives media/getter callbacks instead of calling production libobs functions directly. Adapter discovery requires no build.rs extraction block. Native registration has its own entry and selects only its own target. Existing Core state and Application test binaries are reused.

Commit sequence: actual-library C characterization 905f3e3, separate building verbatim extraction 3b4350e, Tier 1 RED a8e4032, and Rust GREEN e1fdebc. Both RED tests fail at the deliberate stub with exit 101.

Validation:

  • All five focused safe API, real-header layout and differential tests pass. Layout checks cover every borrowed field and the encoder type representation. Deterministic and randomized parity compare both values, complete diagnostics and whole-encoder immutability. Proptest persistence is disabled.
  • Forcing stored dimensions to zero fails both differential tests with exit 101. Restoring GREEN passes all five tests again.
  • Characterization and extraction each passed three repeats against both actual libraries before the Rust swap. The C characterization is unchanged after its first commit.
  • Post-swap Tier 2 passes five encoder tests three times against each library: dimension characterization, output-getter characterization, video reset, size steps and group-reconfigure walk. 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 Docker image lacks Clang; the installed host Clang was mounted read-only for that check.
  • The complete native-build module passes 147 tests and two child probes. Obs-util passes all 914 tests and both doctests. Its negative-path cases emit expected error diagnostics; the command exits zero with no failed tests.
  • Oracle discovery, native registration entries, native portability, graph sorting, README policy, source-group inventory and port metadata checks pass.
  • Full serial lint with porcelain disabled passes formatting, all 360 repository self-tests, workspace Clippy and feature-set Clippy. A subsequent standalone workspace formatter check passes. One primary read-only review found no actionable issues.

Test cost over 25 debug runs per new module: safe API longest 0.02 seconds and peak RSS 10,872 KiB; parity longest 0.01 seconds and peak RSS 17,580 KiB; registration longest 0.04 seconds and peak RSS 10,928 KiB. Each isolated parity child opens one existing video 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. Local Tier 2 covers the five encoder tests above; 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/3936-encoder-dimensions branch from e1fdebc to e30b312 Compare November 7, 2026 21:40
@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Rebased onto current master, replacing e1fdebc with e30b312. Preserved master’s scaling-enabled port and this PR’s dimension extraction: both original implementations remain in their proper reference groups, while hybrid libobs retains the Rust swaps. Characterization, extraction, RED and GREEN order is intact; implementation, oracle and characterization bodies are unchanged. Focused Tier 1 and Tier 3 tests, oracle discovery, registration inventory, the full native-build module, utility tests and doctests, workspace formatting, portability, graph sorting and README checks pass. The conflicted native group compiles with GCC and Clang in the Nix environment. Exact-lease push verified and head-pinned auto-merge re-armed. Full Tier 2 and hosted CI were not rerun locally. Handed back to the pool coordinator.

@zackees
zackees added this pull request to the merge queue Nov 7, 2026
Merged via the queue into master with commit d9c613e Nov 7, 2026
40 checks passed
@zackees
zackees deleted the port/3936-encoder-dimensions branch November 7, 2026 22:48
@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 width and height getters to obs-output

1 participant