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
The enum members being getting the bitwise or here are from different
enums, and bitwise operations on members from different enums are
deprecated in C++20. kAudioFormatFlagsNativeFloatPacked is the
equivalent value (see its defintion), but removes the manual bitwise or.
std::find is used in enumerate_frame_rates already, so the equality
operator is needed there. Until C++17 this is defined implicitly, but
since C++20 it's needed explicitly.
The Qt components are from the same repo as other dependencies.
The KDE Platform was never a good fit for OBS Studio for multiple
reasons:
- Life cycle too short and misaligned with OBS Studio causing users to
get EOL notification too often.
- Third-party Qt plugins were allowed which could change Qt's behavior.
- KDE exclusives sandboxed holes were inherited.
To reduce compile time and prepare for aarch64 support, dependencies
compilation except CEF is moved to a BuildStream project junctionned
with Freedesktop SDK.
The BuildStream project is configured to build dependencies in a
Flatpak-like environment.
efca325 already increased the default bitrate for various encoders.
However, some were missed and this commit fills the gap:
* Mac-VT
* OpenH264
* Texture AMF
* VAAPI
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.
The default device retrieved was the one used for system sounds.
This fixes it by retrieving the one used to output audio.
It seems the bug has been there since the initial writing of this bit of
code (so 2017).
For 'pulse_output_capture', calls are added when devices are either
changed, started or removed.
The calls trigger a check against the monitoring device.
Signed-off-by: pkv <pkv@obsproject.com>
For 'coreaudio_output_capture', calls are added when devices are either
changed, started or removed.
The calls trigger a check against the monitoring device.
Signed-off-by: pkv <pkv@obsproject.com>
For 'wasapi output capture', calls are added when devices are either
changed, started or removed.
The calls trigger checks against the monitoring device.
Signed-off-by: pkv <pkv@obsproject.com>
The monitoring deduplication was previously checking at each audio tick
the whole audio tree for Audio Output Capture (AOC) devices used for
monitoring. The profiling did not show any big impact on the audio
callback. But due to reports of a significant slowdown for scenes with
numerous audio sources, we have moved the check on AOC from the audio
thread to the UI thread.
So we implemented obs_source_audio_output_capture_device_changed which
is triggered whenever:
- a monitoring device is changed in Settings > Audio,
- an Audio Output Capture source changes its device or on startup.
This function compares the AOC device with the monitoring device in UI
thread. If they are identical, a signal is sent to the audio thread to
add an audio task updating the AOC duplicating source pointer at the end
of an audio tick.
This triggers monitoring deduplication if the ptr is not NULL.
The calls in the AOC are implemented in next commits.
The rest of the logic in obs-audio.c is the same except on one count,
which is that we check against the muted state of the AOC rather than
its user_muted; with the new logic, muted works better.
Signed-off-by: pkv <pkv@obsproject.com>
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.
This adds the devices_match function to null monitor to fix linking
issues on linux when pulse audio is disabled.
Fixes#12810
Signed-off-by: pkv <pkv@obsproject.com>
This adds comparison to default devices to the monitoring deduplication.
When a user picks a default device, the device_id setting is 'default',
which prevents any comparison.
The comparison is done by leveraging the libobs/audio-monitoring
devices_match function.
For macOS, some special care is taken because the devices list differ
for 'Desktop Audio' and 'monitoring' since coreaudio sdk has no pure
audio capture; so 'default' in the two lists do not match in general.
One then retrieves the device_id for the default desktop audio for macOS
through get_desktop_default_id function.
Signed-off-by: pkv <pkv@obsproject.com>