Skip to content

rust: Port media-io/video-frame.c to obs-media-io #151

Closed

Description

@zackees

test/cmocka/test_video_frame.c landed in #117 and is the Tier 2 check. Builds on video-io.h inlines (#114) and video-fourcc/video-matrices (#97/#106).

Acceptance: follows docs/rust-port/testing-policy.md. RED commit (Tier 1 on a todo!() core, plus the C characterization test if missing) then GREEN; Tier 2 passes with ENABLE_RUST_LIBOBS OFF and ON with identical exports; Tier 3 parity against the C oracle; intentional differences listed in the parity test header and rust/README.md.

Claim before coding: comment on this issue and add the claimed label (or ask a maintainer to). Check open PRs first (gh pr list --search "<unit>").

Activity

  1. added
    enhancement
    port
    on Oct 10, 2026
  2. swilk19 commented on Oct 11, 2026

    @swilk19
    Contributor

    Claiming: libobs/media-io/video-frame.c (item 5 in the approved order on #45). One PR, port/video-frame, following the testing policy:

    1. RED: Tier 1 tests in obs-media-io that port test/cmocka/test_video_frame.c 1:1 (from test: characterize video-frame.c before media-io port #117, so no new characterization commit), run against a todo!() core. Also a struct video_frame layout test and oracle_* wrappers for the video-frame.h inlines (video_frame_free / _create / _destroy), under the header-inline rule.
    2. GREEN: a safe core plus FFI for video_frame_init and video_frame_copy, the only two symbols in a new rust-exports.d fragment. video_frame_get_linesizes and video_frame_get_plane_heights stay in the safe core with no C symbol. The CMake guard for video-frame.c goes in the same commit. Tier 3 parity against the C oracle.

    As discussed on #45, the port keeps C's behaviour: the V210 ALIGN-by-48 quirk, u32 wrapping, and VIDEO_FORMAT_NONE still reaching bmalloc(0). #117 pins that last case as a crash. Zero-size frames are listed as parity exclusions.

    I expect to open the PR today.

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

    enhancementport

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions