Skip to content

libobs: characterize and extract obs_get_video #5353

Closed

Description

@zackees

C-only prerequisite for the Phase 6 libobs core migration: characterize obs_get_video at libobs/obs.c.h:1742-1748, then extract its body verbatim into libobs/obs-get-video.c.h and register it alphabetically in the core unity group.

The core is required. Pin exactly these cases: a main canvas with a mix returns the same borrowed video_t * without taking a reference; NULL main canvas returns NULL; a main canvas without a mix returns NULL. Preserve the original API, all existing C tests and public headers. This does not port the function to Rust or change its behavior.

Add a focused portable cmocka test, canonical test graph registration and tests.d marker following merged #5334. Register any Rust-static link support only in test/cmocka/build/rust-static-support.json. Use no implicit narrowing conversions so new C builds under MSVC /W4. Validate the focused test, verbatim extraction and full ./lint. Track the later Rust swap separately.

Activity

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

    @zackees
    MemberAuthor

    Claiming: obs_get_video C characterization/extraction in slot obs-studio4, branch test/h7-get-video. 1. Pin borrowed pointer identity and unchanged reference counts, NULL main canvas and absent mix. 2. Extract verbatim and register the unity member and test. 3. Run focused validation and ./lint; open the prerequisite PR this session and file the separate Rust swap issue.

  3. moved this from In progress to Ready in obs-rust Multiviewon Nov 21, 2026
  4. rdoupe commented on Nov 21, 2026

    @rdoupe
    Collaborator

    Claiming: obs_get_video C characterization and verbatim extraction into libobs/obs-get-video.c.h (the earlier claim was released without a branch or PR).

    1. Add a portable cmocka characterization: a main canvas with a mix returns its borrowed video_t by identity with no reference taken; NULL main canvas returns NULL; a main canvas without a mix returns NULL. Record RED registration evidence.
    2. Extract the body verbatim into the core unity group, register the test (graph, tests.d) and run it against hybrid libobs and the C reference.
    3. ./lint and open the PR this session.
  5. rdoupe commented on Nov 21, 2026

    @rdoupe
    Collaborator

    PR #5419 is up with the RED and GREEN commits. Full Linux Tier 2 passes against both libraries (1074/1074 each), and the new test's three cases ran on each. The NULL-main-canvas case moves to #5354 (the core global is hidden from tests); the PR body explains. It waits on PR CI.

  6. moved this from Ready to In progress in obs-rust Multiviewon Nov 21, 2026
  7. rdoupe commented on Nov 22, 2026

    @rdoupe
    Collaborator

    Done in #5419 (merged as 7b81739): obs_get_video is characterized and extracted into its own group, and #5421 then moved it to Rust.

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

Metadata

Metadata

Assignees

Labels

P2enhancementportreadysize:S

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions