Skip to content

test: Characterize and extract encoder group started-count accessor #5316

Closed

Description

@zackees

C-only Phase 6 prerequisite for obs_encoder_group_num_started in libobs/obs-encoder.c.h:464-473, targeting a later obs-output Rust swap.

The current hidden accessor locks the group's mutex, reads num_encoders_started as uint32_t, unlocks, and returns the snapshot. NULL group is outside the existing precondition. Merged #1599 introduced the accessor, #1603 imports it from Rust interleaving with fixture-owned fakes, and #2934 uses it to reject moves into started groups. None extracted or ported this function; the production body remains C.

Extract this function verbatim into libobs/obs-encoder-group-num-started.c.h in sorted core-output unity position, following recent encoder extractions (#5215 and #5153). Add a portable cmocka C-source characterization with the real private group layout, recording mutex calls, full-range count edges (0, 1, UINT32_MAX), exact group selection, read-after-lock and snapshot-before-unlock behavior. Do not define NULL behavior or change any existing test/header. Keep the hunk separate from slot3 add/remove-output and slot5 align-divisor work, plus #5246/#5280 weak-reference hunks.

Acceptance: RED extraction-contract failure then GREEN; focused cmocka execution; warning-clean GCC/Clang including a strict conversion proxy; canonical tests.d/graph registration and all sibling native source inventories; full ./lint once; publication through ./push. No Rust implementation, link-support files, public-header edits, existing C-test edits, WebSocket changes or workflow additions. File a separate swap issue covering the existing fakes and later four-tier parity/linkage obligations.

Activity

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

    @zackees
    MemberAuthor

    Claiming: encoder group started-count C characterization/extraction in pool slot obs-studio7; branch test/5316-encoder-group-num-started. 1. Pin current count and mutex ordering with RED extraction-contract evidence. 2. Move only this accessor verbatim, register all native inventories and validate focused C tests, warning proxy and full lint. 3. Publish this session and file the separate Rust-swap follow-up. Related history #2934/#1599/#1603 is not a duplicate port; sibling encoder hunks remain separate.

  3. rdoupe commented on Nov 21, 2026

    @rdoupe
    Collaborator

    Done by #5322 (merged): libobs/obs-encoder-group-num-started.c.h is extracted verbatim in the core-output group and test_encoder_group_num_started pins it. It merged with "Refs", so this stayed open and blocks the Rust swap in #5319. Reopen if something here is still outstanding.

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