If - for some reason - the name in a scene collection is empty (or
the key doesn't even exist), use the filename stem as a fallback name.
This ensures that the scene collection entry in the cache has a valid
non-empty name.
Using an std::string allows the use of its "empty" method to check for
this otherwise invalid state of the collection data.
Ported from 1baa4619e4.
Co-authored-by: PatTheMav <PatTheMav@users.noreply.github.com>
Empty names for scene collections are not allowed, but this constraint
is only enforced by UI code during text input.
Thus frontend API users are able to create valid scene collections with
empty names which will lead to later possible crashes as the scene
collection is malformed.
As the frontend API uses the related function CreateNewSceneCollection
which handles exceptions by this method, no crashes should occur when
an empty string is provided by an API caller.
Ported from 552c19cab2.
Co-authored-by: PatTheMav <PatTheMav@users.noreply.github.com>
We directly depend on libx11 for various operations in obs-nix-x11.c,
not just xcb. So be sure to link it in too.
fixes#11667
(cherry picked from commit 22f222600a)
The reaction effects that macOS adds by default are confusing to users
as they're turned on by default and users don't know where they come
from or where to turn them off. Setting this flag in the apps Info.plist
prevents them from being turned on by default. The macOS UI makes it
very obvious to the user where they can turn them on should they wish to
do so.
(cherry picked from commit 79f5ba0e1d)
This fixes a bug where the NVIDIA NVAFX filters are migrated but not
kept in their original order, with respect to other filters.
Signed-off-by: pkv <pkv@obsproject.com>
Revert "docs: Add new relative positioning scene functions"
This partially reverts commit 366cfdb963.
The addition of obs_sceneitem_(get/set)_info2 was not removed as that is
still valid.
The new Scene Collection code uses the lazy creation behaviour of
OBSBasic::Load, which itself uses obs_data_create_from_json_file_safe.
The internal implementation will create a new scene collection with the
contents of an existing backup file with the same name however, thus
users would end up with a nominally "new" scene collection that
contains contents of an old backup.
This update will remove any existing backup file colliding with the
name of the new, duplicated, or renamed, scene collection and remove it
before activating it (and having OBSBasic::Load create a new one).
Upon further review, the build directory is never set to build_$arch.
Currently, our CMake Presets on Ubuntu only use build_ubuntu. However,
we can attempt to be flexible here and simply exclude the build
directory configured in CMake.
When custom module and module data paths are provided via environment
variables, the module paths generated by current code will not be
compatible with the plugin bundle structure used on macOS.
Using environment variables is a simple way to test plugins,
as this allows OBS to discover them from alternative user-provided
locations.
This lambda would be called from the Qt event loop rather than the
original call stack when continuing from an error, resulting in the
captured references being invalid.
To solve this must explicitly use a copy instead of reference capture.
The regex was incorrectly excluding any file with build in the name. The
intent was to exclude any build directories, so we should be able to
restrict this.
The code that checked frame types was used by both the MSDK < 1.7 code
and by the debug code afterward that was conditionally enabled with a
preprocessor check. Since the frame type checks are no longer used by
user code, move it to the debug/dev code.
The old MSDK 1.6 code paths were for older devices which we no longer
support. Typically, version 1.0 is reported when QSV fails to
initialize. The lowest version that should be supported is 1.35, so we
should not need code that covers versions 1.0 to 1.6.
Multiple APIs may be set up to capture without being initialized in
graphics-hook when multiple threads are sending present calls. This just
prevents those invalid captures from completing.
The function InitBasicConfigDefaults2's purpose is to set up encoder-
related settings for a profile, which requires all available encoders
to have been discovered first.
As encoders are added by runtime modules, this also means that discovery
needs to be delayed until after modules have been loaded, but modules
themselves require a valid profile to exist and be loaded.
This leads to the requirement of profiles needing to exist in a
half-initialized state when modules are loaded and only becoming
fully initialized after that.
This distinction is not necessary after the initial launch of obs-studio
because runtime plugins are not hot-loadable, so the update can happen
unconditionally at any time a plugin is changed, which implicitly
couples every call to ActivateProfile with a call to
UpdateProfileEncoders.