Implicitly capturing "this" with the capture default "=" is deprecated
with C++20. We fix this by either explicitly passing this, or by copying
the required members manually.
While this exposes some rather expensive copies like the QList
selectedItems in OBSBasic_Preview, it doesn't introduce them ("=" copies
implicitly).
Implicit capture of 'this' with a capture default of '=' is deprecated
in C++20.
# Conflicts:
# frontend/settings/OBSBasicSettings.cpp
# frontend/settings/OBSHotkeyEdit.cpp
# frontend/settings/OBSHotkeyWidget.cpp
Qt strict mode disables APIs deemed "'suboptimal' or 'dangerous'" [1]
and "clearly undesirable" [2] by Qt that will be removed in the long
term.
Usages of the APIs in OBS have been removed in the previous commits, and
by setting this flag we keep ourselves from using them again.
The versioning works in a way where e.g. a new addition to this in 6.9
would only be disabled if at least 0x060900 is set. By setting 0xFF0000,
we're effectively disabling any APIs that are deemed to be bad in any
future Qt version (up to 255).
While this could lead to OBS not being buildable against bleeding edge
Qt, it also means that it will be noticed early. Should the disabled API
turn out to be too complex to remove, the value can be downgraded to the
last working one then.
[1] qt/qtbase@3a6c8e02b6
[2] qt/qtbase@f9163ae7a8
SetComboByName, SetComboByValue and SetInvalidValue all pass their
parameters to Qt functions which only take QStrings. As a consequence,
we have cases we'd convert a QString to a const char* to call these
functions, only for the functions to implicitly convert them back into
QStrings. We can avoid this by passing QStrings directly. In cases where
we did actually pass const chars, the (implicit) conversion now just
takes place earlier.
Improves app shutdown in a few ways, including separating out different
pieces of the OBSBasic close handler into their own functions.
Removes the crash handler sentinel earlier when the main window is closed,
preventing unclean shutdown warnings when a plugin causes issues. While not
ideal, the dialog is not useful when we cannot specify which plugin caused the
problem.
Increases shutdown priority of the main application so that when OBS interrupts
the session ending, CEF is not closed at the same time. This fixes a crash.
Additional safeguards and event handling to try to ensure a smoother shutdown.
By explicitly setting the OAuth dialog as the parent of the CEF widget,
it will automatically by cleaned up as soon as the dialog is closed
itself.
This also detaches the destruction of the widget from the browser
cleanup code.
This removes the need to provide an undocumented launch argument to
enable custom RTMP service configurations to use multitrack encoding
and also provide a custom configuration.
The default of 2500 kbps was chosen 10 years ago and times have changed.
Logs and forums posts show that many users of OBS for recording don't
change their bitrate and end up with a 2.5 mbps recording which looks
terrible.
Now that service bitrate enforcement exists, this will be automatically
capped to the maximum bitrate for streaming services, so the only time
this should result in a problem is if the user's upload speed is the
limiting factor, hopefully rarer these days with increasing internet
speeds.
There is a Qt bug introduced around Qt 6.8.3 that causes the application
to hang when double clicking the sources list and the Windows setting
'Snap mouse to default button in dialog boxes' is enabled. Work around
this by using a timer if the setting is enabled.
While the Metal renderer is displayed as "Metal (Experimental)", the
"Experimental" part doesn't need to be stored to the config. Otherwise,
anyone having selected the Metal renderer will have it get unselected
once the "Experimental" part is removed, and presumably the people who
have it selected while it's experimental would also be the people who
would want it once it's stable.
Putting the crash sentinel in the main "obs-studio" directory carries
the risk of unwanted deletion of files in the same directory, which
usually contains user configuration files like "user.ini" and
"global.ini".
Even though the code will ignore any file that does not start with the
crash sentinel prefix string, the code itself would allow changing the
prefix to "global.ini" and thus inadvertently delete the global
configuration file as well.
To further reduce the risk, this change will put the sentinels in a
separate sub-directory that should only ever contain sentinel files,
all of which can possibly deleted without any data loss for the user.
Current code isn't catching a parse error exception if an invalid config
file is loaded by the plugin manager. This change wraps the plugin
manager config json parse call with a try/catch, and handles invalid
config files by creating a new config file, and logs an error that the
existing config file is invalid.
For phase 1 of the plugin manager, the ability to toggle off/on plugins
to be loaded at launch is provided.
This commit adds a new Plugin Manager dialog which can be accessed from
the Tools menu, which shows a list of all installed 3rd party plugins
with a checkbox to toggle them off or on. If a change is made, the user
is prompted to restart OBS. To allow this, the plugin manager uses a
json based config file stored in the OBS config directory. Additionally
for sources in the source tree, a sample UI has been provided that
indicates any sources whose parent module is disabled, by turning its
title red.
This reverts commit 3dcf68f8ed.
The bug that this was meant to work around was most likely QTBUG-102718,
which was fixed in Qt 6.2.5, 6.3.1, and 6.4.0. The minimum version of Qt
we currently support is Qt 6.4.2 because it is what is available on
Ubuntu 24.04. Thus, we should not need this workaround now.
https://bugreports.qt.io/browse/QTBUG-102718
Current code assumes that the overflow texture and the render target
always share the same color format including transfer function.
This assumption is incorrect however as OBS might use a 16-bit floating
point texture with a linear gamma transfer function when a high-bitrate
format is selected. On top of that OBS Studio wants rendering code to
ensure that linear color blending is used throughout the application.
The DrawOverflow function had not been updated to reflect this. This
change brings it in line with other functions involved in preview
rendering, which enable automatic sRGB conversion for the framebuffer
and the texture used in the fragment shader.