Skip to content

rust: Port libobs/obs-output-get-last-error.c.h to obs-output #5308

Closed

Description

@zackees

Phase 6 Rust swap of libobs/obs-output-get-last-error.c.h into obs-output, after prerequisite #5294 lands. The prerequisite characterizes the original C implementation with real C output/encoder objects and unchanged public-API assertions. Preserve the public C API/ABI.

Port the selection rules into a safe core, with a thin FFI wrapper and real private C field projections for C-owned storage. Preserve obs_output_valid's exact NULL diagnostic and validation before field reads. Read the output's own last_error_message first; otherwise scan video encoder slots in ascending order, then audio encoder slots in ascending order, returning the first non-NULL error pointer or NULL. Lower-priority fields must not be queried after a result is found. Empty strings and non-UTF-8 bytes remain valid borrowed errors. No copying, caching, reference ownership change or added locking; do not substitute a locking encoder getter or change stop-signal ownership.

Acceptance: RED then GREEN, Tier 1 cases mirroring every prerequisite assertion, layout/field boundary checks, unchanged C characterization against both C reference and hybrid libobs, and Tier 3 original-C differential plus a demonstrated mutation failure. The prerequisite test's OUTPUT_LAST_ERROR_EXTERNAL mode exercises the linked replacement without compiling the original body. Extracted source moves as a whole into a ported unity group; exported symbol sets stay identical. Network Tier 4 does not apply.

Discover and use the shared real native link support from #5246. No aborting stubs, fake core globals or per-consumer support fragments. Validate the whole native_build:: module, the new fixture plus EVERY configured *_rust target on Linux and the Windows MSVC/Darwin arm64 links; preserve real adapter binding on both linkers. Full lint once. No existing C test/public-header edits, WebSocket changes or new workflows.

Dependency: #5294 must merge first. Do not claim until that prerequisite is complete.

Prerequisite PR: #5307. It contains the immutable characterization and behavior-neutral extraction for #5294. Its signed validated head is b127671; the Rust swap must start from master after that prerequisite lands.

Activity

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

    @rdoupe
    Collaborator

    Claiming: port the extracted output last-error query (libobs/obs-output-get-last-error.c.h, landed in #5307) to obs-output, RED then GREEN, Tier 1-3 per the issue.

  3. rdoupe commented on Nov 20, 2026

    @rdoupe
    Collaborator

    Done in #5339 (merged): obs-output-get-last-error.c.h now builds only in its ported group and the entry points are Rust on master. The PR said Refs, so closing by hand.

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

Metadata

Metadata

Assignees

Labels

P2portreadysize:S

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions