Repository navigation
Description
Port the public obs_source_enum_full_tree() (declared in libobs/obs.h, defined in libobs/obs-source.c.h) and its hidden stop-source wrapper obs_source_active_child_enum_full_tree() into obs-source. Together with their static helpers enum_source_full_tree() and enum_source_full_tree_callback(), they are the walk over every child of a source, active or not: the scene item recursion check (obs-scene.c.h), the transition recursion check (obs-source-transition-switch.c.h) and obs_source_add_active_child() (obs-source-active-child.c.h, through the hidden wrapper) use it, and plugins call it through the C ABI. It is the sibling of the active-tree walk (#5729, PR #5735). Nothing in the issue list or open PRs covers it.
Contract to keep:
- NULL source: one
LOG_DEBUG"obs_source_enum_full_tree: Null 'source' parameter"line, return (the hidden wrapper logs the same name). Nocontext.data: return silently. - A source that is not a transition and has neither
enum_all_sourcesnorenum_active_sources: return without a reference. - Otherwise take
obs_source_get_ref(); a dying source logs the NULL line and returns. - A transition walks its two slots through
obs_transition_enum_sources(); then the type'senum_all_sourcesruns if it has one, elseenum_active_sources; then the reference is released. - Per child (the wrapped callback): the stop source's edge is reported at once with no descent (the admission rule
obs_source_add_active_child()relies on); otherwise a transition child's slots, then itsenum_all_sources(elseenum_active_sources) when it has context data, are walked first, then the edge(parent, child)is reported. Depth first, post-order; no references taken on children.
Stays C, reached through a hidden non-EXPORT -fields.c.h adapter: the type, callback and context-data reads and the plugin calls. obs_transition_enum_sources(), obs_source_get_ref() and obs_source_release() are called by symbol.
Plan (pattern of #5729 / #5831): extract the four bodies verbatim into their own file in the live core-source group; characterize with a new cmocka test calling the export against hybrid libobs and the C reference (NULL, no data, no callbacks, enum_all_sources preferred over enum_active_sources, transition slots, nested post-order, a child without data, the stop source through obs_source_add_active_child()); Tier 1 RED against todo!() in obs-source's existing test binary; then the Rust swap with a Tier 3 differential against the original C that records every call and edge in order. The existing scene, transition and active-child tests run unchanged. No public-header, existing-C-test, WebSocket or workflow edits. Tier 4 does not apply.
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
rdoupe commentedon Nov 27, 2026
Claiming: I'll extract, characterize, Tier 1 RED, then GREEN with Tier 3 parity, on branch port/5833-enum-full-tree. Adjacent to #5729 (PR #5735) in obs-source.c.h; whoever lands second rebases.
obs-source: port obs_source_enum_full_tree to Rust (Fixes obs-rust#5833…