libobs: Save and restore resolution of canvases#13102
libobs: Save and restore resolution of canvases#13102exeldro wants to merge 1 commit intoobsproject:masterfrom
Conversation
The primary canvas doesn't store its video properties in the scene collection, so I figured I'd keep things consistent here and require the API user to set it to the desired configuration when loading. Additionally, by leaving this empty until it is set, any canvases that are not in use are not rendered, which might save some resources e.g. if the user disables a feature or plugin that is using it. |
As I mentioned on #13310 I think we need to move away from "global" video functions that use the main canvas under the hood and instead make our code explicitly set up a canvas as the "main" canvas and use common API functions to manage it. Thus the "main" canvas should be indistinguishable from other canvases as far as the canvas APIs are concerned and it's only the code utilising that canvas that makes the difference. And by that token every canvas would need to have output resolutions set to be considered "complete" (the resolution becomes an invariant of the canvas). Otherwise we have this weird bifurcation in the canvas internals were some canvases are considered incomplete without this data and some magically aren't.
This is an important concern, but wouldn't it make more sense to have an explicit activity state on a canvas rather than interpreting the lack of an output resolution as an implicit state? |
Description
Save and restore resolution of canvases
Motivation and Context
When a canvas is loaded it needs a resolution otherwise all scenes on the canvas will have divide by 0 issues on the scene items.
How Has This Been Tested?
On windows 11 by having a scene collection with an extra canvas, but the plugin controlling that canvas disabled.
Types of changes
Checklist: