Repository navigation
Description
Phase 6 Rust swap following the C-only characterization and behavior-neutral extraction in #5295. The prerequisite must land first. Port only obs_canvas_has_valid_video_info from libobs/obs-canvas-has-valid-video-info.c.h to obs-core, preserving its existing hidden C callable seam and exact behavior.
This is a thin wrapper: Rust already implements canvas_rules::size_set and canvas_rules::format_set. Reuse those rules for the four dimensions and (int)output_format; do not duplicate their logic. Preserve all five conjuncts, direct unlocked reads, no allocation or mutation, and the current valid-canvas precondition. Do not invent NULL behavior: the original C dereferences NULL.
Acceptance: RED then GREEN. Port every assertion of the immutable C characterization (independent zero/nonzero width/height boundaries, format NONE/nonzero and signed boundaries/out-of-enum cases, all 32 predicate combinations, no canvas mutation or allocation) to Tier 1 in the existing Core state category. Add Tier 3 differential and mutation coverage against the extracted original C, and real layout/field projection checks as needed. Use the fixture's CANVAS_VALID_INFO_EXTERNAL mode so unchanged C assertions exercise the actual Rust shim through real C adapters, rather than retaining a source-only test and claiming it covers the swap. Preserve unchanged C tests and public headers. No network surface: Tier 4 is inapplicable.
Move the extracted source's unity inclusion to its own ported group and keep C-reference coverage and symbol parity. Reuse the shared native link support from #5246; never use aborting placeholders. Build EVERY configured Linux *_rust target plus the characterization and validate Windows MSVC and Darwin arm64 standalone consumer links. Run the whole native_build:: module and repository lint. Keep the original function's visibility and public ABI unchanged.
Scope excludes all other canvas APIs, obs-websocket and unrelated rules. Priority P2, size:S. The prerequisite carries the callable C extraction; this issue remains blocked until it lands.
Prerequisite publication: #5348 (Refs #5295), head 4ebdb42. The C-only prerequisite is ready with auto-merge armed; this Rust swap must wait for that PR to merge. Validation passed 322 native_build:: tests, full ./lint, the new Linux Tier 2 fixture and every one of the 68 configured *_rust targets, with all 69 tests passing against both libraries and matching 1,769-symbol export sets. The fixture additionally passed 25 repetitions per library.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
rdoupe commentedon Nov 20, 2026
/ready
Its prerequisite #5295 landed in #5348 (the extracted file is in the live core-source group on master).
rdoupe commentedon Nov 20, 2026
Claiming: Rust swap of obs_canvas_has_valid_video_info on branch port/5310-canvas-video-info, batched with #5326 (same crate and canvas group) in one PR.
github-actions commentedon Nov 20, 2026
Claim bot: @rdoupe, this can't be claimed yet: it is blocked by 1 open issue(s) (see "Blocked by" on the issue); claim it once they close.
rdoupe commentedon Nov 20, 2026
Claiming: Rust swap of obs_canvas_has_valid_video_info on branch port/5310-canvas-video-info, batched with #5326 in one PR (plan as in my comment above). Its prerequisite #5295 is now closed (done in #5348).
rdoupe commentedon Nov 20, 2026
Done in #5360 (merged 2026-11-20 12:37 UTC): obs_canvas_has_valid_video_info now runs through safe Rust in obs-core; the C unit moved to its reference-only ported group. Master push run of the merge commit is green.
obs-core: swap canvas video-info validity and mix clearing to safe Ru…