Expose the relative-coordinate migration to Desktop - #1764
Open
aleksandr-voitenko wants to merge 13 commits into
Open
Expose the relative-coordinate migration to Desktop#1764aleksandr-voitenko wants to merge 13 commits into
aleksandr-voitenko wants to merge 13 commits into
Conversation
Preserve unassigned scene-item routing when no canvas is provided, reject invalid canvas references, and expose unassigned canvases as null.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ultimate goal of the task is:
Description
This is the OSN part of a three-repository change:
obs-studioimplements canvas-aware relative transforms and crop references.Enable canvas-aware relative scene coordinates obs-studio#764
obs-studio-nodeexposes the native lifecycle and metadata.desktopmigrates collections and applies Base Resolution changes transactionally.Scene collections: migrate layouts to relative coordinates desktop#6100
The components must ship as a matched set.
The components must ship as a matched set because scene-item and crop IPC payloads have changed.
Relative-coordinate contract
AbsoluteCoordinates=falseduring global OBS initialization, before any public, private, or group scene graph is created.SceneFactory.invalidateItemTransformCache()invalidates cached position, scale, and crop values after a Base Canvas reset. It does not mutate transforms itself; subsequent access reads the effective absolute values from libobs.Legacy absolute scene-collection migration and Base Resolution transactions remain Desktop responsibilities.
Canvas assignment and routing
Scene.add()now exposes the existing optional canvas argument:When provided, the canvas is assigned before the initial transform is applied.
Providing a canvas requires a transform.
When the canvas is omitted or
undefined, the item remains unassigned and renders on every canvas.addItems()likewise creates initially unassigned items.ISceneItem.videonow returnsIVideo | null;nullrepresents all-canvas routing. The setter accepts a liveIVideo, but does not currently acceptnullto unassign an existing item.Assigning an item to another canvas preserves its caller-visible position, scale, bounds, and crop.
Invalid or destroyed canvas handles are rejected without leaving a partially created scene item.
A shared
osn::common::INVALID_IDvalue represents a missing OSN object reference instead of incorrectly treating the real canvas ID0as “unassigned.”Scene::AddSourcevalidates its IPC request shape before reading transform fields.Canvas lifetime
Video.destroy()now reports native removal outcomes accurately:Nested-scene crop references
ICropInfocan includereferenceWidthandreferenceHeight.Additional fixes
blendingMethoddeclaration toISceneItemInfo.obs_sceneitem_set_bounds().cropToBoundstoITransformInfoand exposed it as an individual scene-item property.Breaking API changes
OBS initialization
OBS_API_initAPIno longer accepts positional arguments. It now requires exactly one options object:All four fields are required strings. Pass an empty
crashServerUrlto use the built-in endpoint for the current release channel.Scene and transform types
IScene.add()exposes the optionalvideoparameter.ISceneItem.videonow has a nullable getter.ISceneItemInforequiresblendingMethod.ITransformInforequirescropToBounds.ICropInfovalues may includereferenceWidthandreferenceHeight.How Has This Been Tested?
Manual + Automated tests, Windows only.
Types of changes