Repository navigation
Description
Unit
Scene-item transform and bounds read getters in libobs/obs-scene.c.h, targeting the existing obs-scene crate.
Phase and position
Phase 6, native child of #444. Follows selected/locked #3859; disjoint from item ID #3869 and render getters #3891.
Dependencies and existing tests
Preflight at origin/master 58d2c1155f9507da4728576f24f8aa68e2efefae: individual git grep -l '\b<fn>\b' origin/master -- rust/ checks found only bindings/callers for get_pos/get_scale/get_rot, and no Rust references for get_alignment/get_bounds_type/get_bounds_alignment/get_bounds_crop/get_bounds/get_crop/get_info2. Inspected all three sibling PR bodies, comments, changed-file lists and their obs-scene.c.h patches. No overlapping implementation or active transform/bounds getter PR found.
These are not unlocked field readers. All ten take item_fields_lock, which snapshots item->parent, locks that parent's video_mutex when non-null, returns the captured parent, and unlocks the same parent after the read. Detached items skip locking. The null checks happen before locking.
| Getter | Current C behavior beyond the lock |
|---|---|
| get_rot | NULL returns +0.0f; otherwise copies stored rotation |
| get_alignment | NULL returns 0; otherwise copies align |
| get_bounds_type | NULL returns OBS_BOUNDS_NONE; otherwise copies bounds_type |
| get_bounds_alignment | NULL returns 0; otherwise copies bounds_align |
| get_bounds_crop | NULL returns false; otherwise copies crop_to_bounds |
| get_pos | NULL item leaves output untouched; relative coordinates use pos_to_absolute, otherwise vec2_copy |
| get_scale | NULL item leaves output untouched; relative coordinates use item_canvas_scale, otherwise vec2_copy |
| get_bounds | NULL item leaves output untouched; relative coordinates use size_to_absolute, otherwise vec2_copy |
| get_crop | Validates item then output with obs_ptr_valid (debug diagnostics); memcpy of the crop under the lock |
| get_info2 | Only proceeds when item and output are non-null; copies all transform fields and crop_to_bounds under one lock; relative position/scale/bounds conversions apply |
Sources: libobs/obs-scene.c.h:149-164, 2753-2872, 3121-3131. Conversion helpers at 297-377 read canvas/scene dimensions and group/scene flags; they must not be replaced with direct copies.
Notes and acceptance
Start with C-only characterization against both actual libraries, including parented/detached/null items and observable synchronization. A narrower first port can select the scalar readers, but must preserve the parent's lock; none of the requested getters qualifies for an unlocked plain-copy slice. A C/private locking adapter or equivalent portable lock boundary needs to be characterized before applying the sibling getter pattern.
Then verbatim extraction in its own commit, Tier 1 RED before Rust GREEN, real-header layout checks, Tier 3 differential plus mutation (proptest persistence disabled; NaN payloads, signed zero, infinities copied bit-exactly), unchanged Tier 2 via docker_task_command/warm volume with ldd proof and identical exports. Use the existing Core state test binary. Tier 4 does not apply.
Preserve conditional OBS::w32-pthreads, portable printf-format callbacks, Windows LLP64/MSVC layouts and exact native source/dependency registration. Replay with GCC and host Clang -Wformat-nonliteral -Werror. Run the assignment's three Python checks and any affected canonical_rust_static_ checks. Keep the README record in its sorted obs-scene table row, combine graph entries, rebase before the final push and run merge-tree. No existing C tests, public headers, websocket, workflow additions or out-of-scope units.
This issue records source inspection only: no runtime characterization or port has been performed yet.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Nov 7, 2026
Claiming: investigation of the synchronized scene-item transform/bounds getter slice (pool port-scene4, slot obs-studio3).
zackees commentedon Nov 7, 2026
Releasing the port-scene4 investigation. Source inspection is recorded in the body: all requested getters take the captured parent video mutex, and four also convert relative coordinates. The plain unlocked-reader slice is empty. No runtime characterization, Rust port, RED/GREEN commits or PR was produced; the synchronized port remains unfinished. No claim-bot refusal was present at the final check. Returning obs-studio3 clean and detached for the pool; a future worker must preserve and characterize the locking contract rather than copy the unlocked sibling getter implementation.
zackees commentedon Nov 7, 2026
Claiming: implementation of a small synchronized scalar bounds-getter group for pool port-3897 in obs-studio3.
First PR expected after characterization and the RED commit in this worker session. Checking for claim refusal before implementation and again before PR/auto-merge.
zackees commentedon Nov 7, 2026
/ready
The synchronized scalar bounds subset now has actual-library C characterization (commit dd751cf, pushed on port/3897-scene-bounds-getters): NULL defaults, parented/detached items, recursive ownership, and a started getter blocked by the parent video mutex until unlock. Three repeats pass against each actual library alongside unchanged canvas characterization; ldd confirms both loader paths and all 1,767 exports match. The original extraction is committed separately (ec92aab); Tier 1 RED fails both safe-core tests at todo!("#3897") (local-test-sILd3V.log).
coordination.md section 2 delegates Ready to the claimant after investigation; the linked org WORKFLOW.md permits /ready by the claimant or a maintainer. The implementation claim is still pending behind the backlogged claim workflow; no refusal or conflicting claim is visible. Continuing only the three scalar bounds getters, with the other transform/bounds getters left for follow-up.
refactor(scene): extract scalar bounds getters verbatim (#3897)
test(scene): add RED safe bounds getter tests (#3897)
refactor(scene): extract scalar bounds getters verbatim (#3897)
test(scene): add RED safe bounds getter tests (#3897)
wip(scene): preserve incomplete synchronized bounds getter port (#3897)
58 remaining items
obs-scene: Port synchronized scene item crop getter (obs-rust#3897) (o…
rdoupe commentedon Nov 18, 2026
Claiming: the last three synchronized getters of #3897 still in C on master:
obs_sceneitem_get_pos,obs_sceneitem_get_boundsandobs_sceneitem_get_info2(libobs/obs-scene.c.h), on branchport/3897-scene-pos-bounds-info-getters.One PR; draft expected this session.
zackees commentedon Nov 18, 2026
Coordination for #5090: pool slot obs-studio6 is extracting only obs_sceneitem_set_alignment from obs-scene.c.h into obs-scene-item-alignment-setter.c.h, reusing obs_sceneitem_fields_lock/unlock and obs_sceneitem_bounds_update_transform. Your three getters remain untouched. The only shared append point is the sorted libobs.core-source+.h.c group; I will check merge-tree against the in-flight #5098 source extraction and rebase on its merge before publication if necessary.
test(scene): characterize synchronized position, bounds and info gett…
refactor(scene): extract synchronized position, bounds and info gette…
test(scene): add RED position, bounds and info getter characterizatio…
feat(scene): port synchronized position, bounds and info getters to R…
rdoupe commentedon Nov 18, 2026
Done: the last three synchronized getters (pos, bounds, info2) landed in #5110, after scale, rotation, alignment and the bounds getters in earlier PRs. Every getter in this unit now has its Rust definition.
obs-scene: Port synchronized position, bounds and info getters (Refs o…