Skip to content

libobs: characterize and extract source type-info queries #4718

Closed

Description

@zackees

Unit

Characterize and verbatim-extract obs_get_source_output_flags, obs_source_get_display_name, and obs_is_source_configurable from libobs/obs-source.c.h (current master lines 1007-1011, 98-102, 990-994) into libobs/obs-source-type-info.c.h in sorted core-source unity position.

Phase and position

Phase 6 source-type metadata, prerequisite under testing-policy.md's extraction and characterization sections, before a separate Rust swap to obs-source. This PR contains no Rust and makes no behavior change.

Dependencies and existing tests

All three bodies call the existing non-static get_source_info declared in obs-internal.h; no private static helper or new seam is needed. #4606 / #4608 owns that shared lookup only, not these wrappers; its planned NULL-ID policy is outside this extraction. Exact-symbol open PR/issue searches found only that distinct lookup work and the unrelated browser packaging issue #1865. Current master still defines all three wrappers in C.

Add a new actual-library cmocka test using public source registration, against hybrid and C-reference libraries before and after extraction. Cover unknown/empty/exact IDs, valid empty-registry NULL IDs, exact get_name callback count/type_data and borrowed result identity (including NULL/empty/raw bytes), flag bits, and all get_properties/get_properties2 presence combinations without invoking callbacks. Defaults alone must not make a source configurable. Existing C tests remain unchanged. Avoid test-graph.json and native.rs edits.

Notes

No source instance is needed. Normal startup/shutdown owns the registry. NULL IDs in a populated C registry and all queries without a live core are outside the C valid domain. A found entry without get_name is likewise outside the valid domain. The prerequisite does not invent a NULL guard. All C constant conversions must avoid MSVC C4310. No public headers, existing C tests, websocket, workflows, or user-visible behavior changes. Tier 1/3 Rust swap coverage is deferred to the follow-up issue; Tier 4 is inapplicable.

Activity

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

    @zackees
    MemberAuthor

    Claiming: source type-info characterization and verbatim extraction, branch test/4718-source-type-info-extract, pool slot obs-studio2.

    1. Add actual-library C characterization for the three wrappers with public registration, pin valid NULL/unknown IDs, callback identity, flags and configurable callback presence. Run against hybrid and C-reference before extraction.
    2. Commit characterization, then move the bodies verbatim into a sorted unity member with no private static dependency or new seam. Re-run the identical tests and symbol parity.
    3. Run full SOLDR_PORCELAIN=0 ./lint exactly once; publish according to backpressure and arm the PR on the verified head. File the Rust swap follow-up. First PR expected this session, subject to the publishing gate.

    Decisions: this owns only the wrappers, not the shared lookup in #4606 / #4608. Configurability is properties/properties2, and defaults-only must remain false. NULL queries are restricted to the observed live empty registry; populated C registries pass NULL to strcmp. No graph changes are planned.

  3. zackees commented on Nov 12, 2026

    @zackees
    MemberAuthor

    Verified complete on origin/master 1273c7e. PR #4728 merged as a4c9c53, an ancestor of that revision.

    The three complete C bodies are present in obs-source-type-info.c.h, byte-identical to their pre-extraction definitions, with the sorted core-source unity include. The registered test_source_type_info fixture covers empty-registry NULL/unknown/exact IDs, borrowed get_name callback results and type_data, every flag bit and callback-presence configurability without invoking properties/defaults. The PR records characterization before extraction and unchanged hybrid/reference replay with symbol parity. This completes the C-only prerequisite; the Rust swap remains separately tracked by #4719.

    Closing as completed. This hygiene pass inspected existing code, registrations, tests and recorded validation; it did not rerun builds or tests.

  4. moved this from In progress to Done in obs-rust Multiviewon Nov 13, 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