Implements the Undo/Redo for scenes and sources, ranging from renaming,
deletion, addition. It also adds several elements to libobs that were
designed to facilitate undo/redo, and should not affect the rest of
libobs.
This changes cleans up some deprecated functions that were removed in
Qt6. Some are placed behind version ifdefs and others are replaced for
their non-deprecated Qt5 version.
This is a dangerous operation on Wayland, and is crashing not only
OBS Studio but also the whole compositor. Let's disable it for now
when running as a native Wayland client.
Some compositors (GNOME Shell, Plasma) still allow setting this
option on the window menu.
This adds functions to the frontend api to start/stop the virtual
camera, to check if it is active and adds function to get the output
reference. It also adds api events for when the virtual camera is
started or stopped.
This reverts commit 4e5f20dcbe.
This originally was added because of a faulty assumption that it would
change defaults, but defaults were apparently broken from 26.0.2 -> 26.1
because primaryScreen->size() changed its behavior, so the original code
technically fixed the original behavior.
The new scaling behavior affects defaults, so only apply it to new
installs of 26.2 or greater, while maintaining the previous behavior if
the user is upgrading from an older version.
Without this change, new profiles created on systems using a fractional
scaling factor (e.g., 125%, 150%, 175%) will get an incorrect (X, Y)
pair for the new canvas size. For a display with 125% scaling, OBS would
set (1536, 864) instead of (1920, 1080). With this change, it will set
(1920, 1080).
With the queued connection in d68484e7, the "Deselect" signal for
sources which are being deleted is never fired, as the object is gone by
the time the queued signal is processed. This results in the context bar
not updating.
This commit adds a new UpdateContextBarDeferred function, allowing
queuing of only the context bar update instead of the whole signal
handler.
This significantly simplifies the
configuration setting's initial load.
This also fixes as issue where the source toolbar
would initialise as "TextLabel" with enabled
buttons if the user had not yet toggled the setting.
Fixes#3722
The Elgato Streamdeck plugin ships their own Qt5Network.dll on Windows,
which may be ABI incompatible with newer Qt DLLs if we decide to update
our Qt version. So to prevent that plugins (and other plugins) from
using their Qt5Network.dll, we need to explicitly load our
Qt5Network.dll first so that we can prevent it from trying to load
theirs beforehand.
For context on this, previously, we didn't ship Qt5Network on Windows
because we would have to ship OpenSSL with it, but we didn't want to
ship it without SSL support. Because of that, Elgato's Streamdeck plugin
would ship their own Qt5Network.dll library (that didn't have SSL
support anyway). However, Qt recently added support for windows
schannel, which allows SSL support via the Windows API, making it so we
don't have to ship extra libraries to get SSL. So now we can start
shipping Qt5Network without worry.
Moves the "Enforce streaming service bitrate" option from simple output
mode to the stream section, renames it to "Ignore streaming service
setting recommendations" (inverting it). When trying to check it, it
will now also display a message box warning the user that it's generally
a not-so-good idea.
Also displays recommended settings for the service.
Adds a VOD track option (specific to Twitch) that allows a user to
specify which audio track to use for their Twitch VODs, which uses a
separate encoder to encode the track. This allows users the ability to
choose what audio goes on their VOD, separately from the live stream.
The frontend API event OBS_FRONTEND_EVENT_REPLAY_BUFFER_SAVED was not
being triggered when hotkeys were used because it was only set to
trigger when the replay buffer button was clicked, not when a hotkey was
used. This fixes it so that the frontend event sends a signal to the
frontend so that hotkeys will actually work.
* obs-frontend-api: add the event of saving replay buffer
Add OBS_FRONTEND_EVENT_REPLAY_BUFFER_SAVED as given by RFC 33
* UI: Emit the replay buffer saved event to the api
Send the OBS_FRONTEND_EVENT_REPLAY_BUFFER_SAVED to api (as in rfc33)
* docs/sphinx: Add replay buffer saved event
Documentation provided for OBS_FRONTEND_EVENT_REPLAY_BUFFER_SAVED (RFC33)
If the tray is disabled in settings, we no longer allow the command line
parameter to override it and create a tray icon regardless. This matches
the behavior in the UI, where "minimize to tray on startup" becomes
unavailable if the "tray enabled" setting is unselected.
Due to the fact that a global was used on GenerateSpecifiedFilename to
save the remux file name, when a screenshot was made, it would overwrite
the filename being remuxed, because screenshots use the same function to
generate filenames as well.
This solves that problem by removing the global and the changes to
GeneratedSpecifiedFilename, and isolating that to the output handler.
Coincidentally, this bug probably also happened with replay buffers
under certain circumstances.
Fixesobsproject/obs-studio#3497Closesobsproject/obs-studio#3498
This object should not always be created on startup. Instead, only load
it specifically when the user wants to load it.
This fixes a freeze some users were experiencing due to the text widget.
Unfortunately, it is not yet known how that freeze occurred with the log
viewer, so for the time being do not load the log viewer object unless
explicitly created.
Fixes the browse button in the remux file dialog not having the proper
style applied. This is a bit of a workaround because it is still unknown
why the button was white.
It was possible to enable the bandwidth test and disconnect your Twitch
account, resulting in a confusing prompt about streaming in bandwidth
test mode when trying to start a stream.
The old version of the device toolbar was a complex situation. Because
of the fact that device properties can take significant time to query,
this put an unpleasant burden on the UI thread; so to fix this problem,
the device toolbar was made to be threaded. However, threading is a
complex and dangerous thing, and there is a fear that this could cause
complications down the line whenever users are simply selecting devices.
So for the time being, as a safety precaution, simplify the device
toolbar down to just the "activate" button, and make it so that if users
really need to query and change the devices, that they need to
explicitly open the properties. That way the devices aren't being
queried constantly every time a device source is selected.
Alternatively in the future, device enumeration could be cached, but
seeing as that's a significant amount of work and needs to take in to
account whether a user adds/removes a device while the process is
active, that's not going to happen any time soon.
It seems like YouTube applies nonlinear-to-linear sRGB, and
linear-to nonlinear-709 transformations to uploaded videos now. This
makes sRGB too dark on their platform for video players that alias 709
as sRGB, which is almost everyone. Make 709 the default to keep peace.
When the feature was added to allow slashes in recording/replay
filenames to automatically create directories, auto-remux was not
accounted for, and all filenames were assumed to be complete. It used
fi.completeBaseName() to construct the new name which would only add the
last part after the last slash as the filename, causing the remuxed file
to save in the base directory rather than the intended directory. This
fixes that by simply using the input string as the output string,
removing the extension, appending the new extension.
Because the virtual camera stops immediately when you call
obs_output_stop() rather than with a delay like other outputs, it
exposed a bug where the tray icon would show OBS as active when stopping
the source, regardless of the fact that it was stopped. The bug was
that the expression used to activate the tray icon did not check to make
sure that the output was actually active, so add that to the expression.
While editing a scene name, the Qt shortcut key for the renameScene
action remained active. If the user pressed the shortcut key while
actively editing a scene name, the widget would retrigger the action,
causing the name edit to fail and discard the current changes to the
scene name. The scene name would be reset to its previous saved value
and reselected as if the user had pressed the shortcut key for the first
time.
This commit removes the QAction associated with the shortcut key from
the scenes dock widget when editing starts and adds the action back to
the widget once editing is done.
Fixes#3044.
Because devices can take significant time to enumerate, defer the
properties creation to a separate thread. The author of this commit
feels a great amount of displeasure over having to write this.
This changes the "View Current Log" option in the
Help menu from a toggle to always open the log viewer,
and bring it to the front when it's already open.
Apparently, on Linux, you cannot update the window flags while it is
still open, so just close the projectors and reopen them again when the
setting changes.
Fixes bug where multiview won't update when reordering scenes with drag
and drop. Was originally fixed with #2114, but bcddf4d caused a
regression where it didn't work anymore.
In a discussion on Discord the consensus was that 48 kHz is a better
default. This was prompted by the merge of the rnnoise library which can
only handle 48 kHz natively. 48 kHz is also more commonly used as a
default on personal computers.
The source toolbar allows quick and easy access to properties and
filers, and shows common properties/features of a source type. For
example, when you select a media source, VLC source, or the slideshow
source, you'll get media controls to control playback of the media. If
you select a text source you can edit the font, color, or text if
applicable. Or if you select a capture source, you can select the
display/window/etc to capture for that source.
If the source toolbar is not desired and is viewed as taking up valuable
space in the window, it can be disabled via the view menu.
Co-authored-by: Clayton Groeneveld <claytong1214@gmail.com>
Co-authored-by: Jim <obs.jim@gmail.com>
When distributing OBS via third party platforms that have their own
update systems we want to be able to disable the OBS updater without
having to resort to having a separate build entirely.
Adds a virtual camera button to the main user interface. If virtual
camera is not installed, it will not add the button. On Windows, it
detects whether the virtual camera filters are properly registered, and
will only add the button if the virtual camera filter is confirmed
registered.
Also adds a virtual camera option to the auto-configuration wizard,
which will just simply set the user's resolution/scale to 1920x1080 at
30 FPS.
Depending on the circumstances, these buttons can start with width
values that are much larger than their height, and that value wouldn't
be corrected immediately. Setting an explicit policy to lock their
width to the same as their height value enforces the behavior that was
intended from the beginning.
AllDockWidgetFeatures is now deprecated. Use underlying values instead.
Use default QFlags constructor instead of nullptr/0.
Use QWheelEvent::angleDelta() in place of orientation() and delta(), and
position() in place of x() and y().
Since libobs internally rounds to various powers of 2 to support SSE
functions, resolutions that are too low can get rounded to zero. libobs
will fail to startup with a zero resolution, so if a user accidentally
entered anything that rounded to zero OBS would become unusable without
manual fixing by editing the profile .ini.
This reverts commit f91d3baf43.
From @pkv: the reason some of these vars were global is because Qt was not deleting them at all; as a result memory leaks have been reintroduced for: previewProjector, trayMenu, studioProgramProjector, multiviewProjectorMenu ;
Building with Clang 10 on FreeBSD 13-CURRENT emitted a warning about
logical not (!) applying only to the left hand side of a comparison.
Update the expression to match the style of other flags conditionals.
Verified that object code is the same.
Request from support-team.
Currently only sources in Scenes are logged with their filters.
This excludes global audio sources set in Settings > Audio.
This patch remedies this.
The program can get stuck waiting for the browser within a event queue,
so instead mark that the program is closing, do it in a separate thread,
signal the window when it's finished, and then check whether it's in the
process of closing before actually showing the dialog.
(This also modifies image-source, obs-text, text-freetype2, and UI)
This improves source definition versioning. To do this, it now stores
two identifier names. One "unversioned" which is the original name, and
one "versioned" with the version number appended.
This fixes both backward compatibility with older OBS versions, and
fixes the inability to use "add existing" in OBS itself on sources
created from older version definitions.
This ensures that the OBSBasicSettings destructor has been run before
the restart prompt appears, preventing bugs related to OBS shutting down
with the settings window still having active callbacks.
-If the user were in the middle of a transition and clicked
the cut transition, the transitions would become borked.
-This actually disables the transition widgets, so the
user doesn't click them. Before, the disabling of the
widgets didn't work as expected. The code for enabling/disabling
them was also simplified.
-This loading of studio mode was moved in OBSInit because
the loading of transitions needs to happen first. This fixes
a bug when enabling/disabling the t-bar when the program
is first loaded. The t-bar would be disabled even if a
cut or stinger transition was not used.
-When the user would click the quick transitions, the
t-bar would be enabled even when it was not supposed
to.
When we use the server error to respond to user's failing to start a
stream it is slow to return an error and unclear to the user what went
wrong. This diff introduces a simple settings check before attempting
to stream and catch and explain specific URL/key issues to the user.
In the case of preset services we check there is a Stream Key before
attempting to start a stream.
In the case of "custom" we only verify there is a URL since for some
services that's all that is required or the user may use user/password
authentication.
Pull UI validation and its helpers to their own class. This class will
be used to validate forms and perform UI-action checks such as
checking stream keys aren't empty and in this diff now holds the logic
to ensure there is a source before the person starts a stream.
Adds an option to the right click menu in the scenes widget to switch
modes. When in regular list mode, it'll let you select grid mode, and in
grid mode, it'll let you select list mode. Grid mode changes the scenes
widget to have a grid of buttons for scenes rather than a list, much
like XSplit.
Fixes pause icon getting stuck if you stream or use replay buffer while
recording, pause, then stop recording while paused. The icon would get
stuck on the pause icon until all outputs were stopped.
Both BTTV and FFZ are fairly popular however they do occasionally
interfere. To give users the option to chose whichever one they like
most we add a new setting that allows BTTV, FFZ, both, or neither.
Defaults to "None" for new users. Existing users will be migrated to
"Both" as that's the previous behavior.
When using custom FFmpeg output mode, the check would instead use the
standard recording path which is no longer visible in the settings. This
commit also simplifies the checks by moving the duplicated code to a new
function.
If audio is determined to be deactivated via the audio source (via the
new "audio_activate" and "audio_deactivate" signals), hide the audio
source in the mixer.
This reverts commit b5843caa48.
This breaks some hotkeys because the signals are tied to a signal which
is now triggered because "toggled" is used instead of "clicked", so just
revert it for now for the release and look at it later post-patch.
This commit fixes various issues with screen readers in the main OBS
interface. These were tested using NVDA on Windows 10 1903.
Checkboxes or buttons which toggle, when receiving an activate signal
from the screen reader would visually update, but not perform any
action. This is because they're listening only for clicks. They should
all now be listening for toggles instead.
The screen reader would navigate through the UI in the order that
elements are defined in the .ui XML, and not by their row positions.
The XML has been reordered so that things should be defined in their row
order.
Audio track selection now says Track 1, 2, etc, rather than just the
number. Various checkboxes that just say "Enable" now have accessible
text that says what the enable is for (since it says "checkbox", the
fact it's an enable should hopefully be clear). Type in the recording
tab of output now has accessible text which says "Recording Type".
All the right side buttons in hotkeys now have tooltips, and by
extension, accessible text. Currently it does not yet say what hotkey
the action is in relation to, but that would require more locales.
Allows the ability for users to add custom browser widget docks that
they can use for their third party services if they feel the need,
mostly as a convenience tool so they don't have to open extra browsers
alongside the program.
OBS has an option to warn before stopping a stream, but it doesn't have
a similar warning for recording. This can result in a recording being
unintentionally stopped.
Add an option to warn when the "Stop Recording" button is pressed.
Note: While OBS also has an option to warn on stream start, this
patch purposefully does not add similar warn on recording start option.
This is because accidentally starting to record isn't risky in the same
way that accidentally starting to stream is.
It's a waste of GPU time to do two fullscreen passes to render final mix
previews. Use blend states to simulate the black background of
DrawBackdrop() for the following situations:
- Main preview window (Studio Mode off)
- Studio Mode: Program
This does not effect:
- Studio Mode: Preview (still uses DrawBackdrop)
- Fullscreen Projector (uses GPU clear to black)
- Windowed Projector (uses GPU clear to black)
intel GPA, SetStablePowerState, Intel HD Graphics 530, 1920x1080
Before:
DrawBackdrop: ~529 us
main texture: ~367 us (Cheaper than drawing a black quad?)
After:
[DrawBackdrop optimized away]
main texture: ~383 us
Adds support for pausing recordings. When settings are eligible for
recordings, a pause button will appear next to the recording button. If
the settings are not eligible, it will warn the user in the output
settings that they cannot pause recordings if those settings are used.
Code submissions have continually suffered from formatting
inconsistencies that constantly have to be addressed. Using
clang-format simplifies this by making code formatting more consistent,
and allows automation of the code formatting so that maintainers can
focus more on the code itself instead of code formatting.
Apparently certain versions of Qt have a bug where the tray icon's
internal "visible" variable is set to false despite the fact that it
still shows. Calling show() first before calling hide() sets the
internal boolean value and fixes the issue with the hide call.
(This commit also modifies the UI, obs-ffmpeg, and obs-output modules)
Fixes a long-time regression where the program would lock up if an
encode call fails. Shuts down all outputs associated with the failing
encoder and displays an error message to the user.
Ideally, it would be best if a more detailed error could be displayed to
the user about the nature of the error, though the primary problem is
the encoder errors are typically not something the user would be able to
understand. The current message is a bit of a generic error message;
improvement is welcome.
Another suggestion is to try to have the encoder restart seamlessly,
though it would take a significant amount of work to be able to make it
do something like that properly, and it sort of assumes that encoder
failures are sporadic, which may not necessarily be the case with some
hardware encoders on some systems. It may be better just to use another
encoder in that case. For now, seamless restart is ruled out.
This commit adds a preview to the properties window for transitions.
The preview will play back the transition at the global transition
duration or the transitions fixed duration, between two private scenes
with an A and B label, and different background colors.
The workarounds were made because of conflicts with running multiple UI
threads at once on macOS, which macOS can't do very well, and would be
susceptible to crashes. This would cause crashes not only on startup
but seemingly at random when using the browser source on macOS. The
original "fix" was a hack to try to minimize UI code and browser UI code
from executing at the same time. The macOS initial scene loading was
deferred until all Qt-related and main window initialization was
completed. Although this worked to some extent to prevent conflicts, it
made it so that there was an initial period on startup where the entire
UI seemed "blank" for users, and it was still possible for the main UI
thread and the browser UI thread to clash, causing crashes seemingly at
random for users.
The external message pump method of CEF is the solution to the problem,
which is the method which allows the main UI thread to share events with
CEF. To do this, all CEF operations need to be performed in the UI
thread (Qt's main thread), and CefDoMessageLoopWork() needs to be called
when CefApp::OnScheduleMessagePumpWork callback is triggered. A number
of other issues had to be solved as well, such as CefBrowser references
getting "stuck" in the Qt event queue.
With this, macOS no longer needs to do the "deferred load" hack, and
browsers are now much more stable and no longer as susceptible to
seemingly random crashes, improving overall program stability when
browsers are used.
Add D3D/GL debug markers to make RenderDoc captures easier to tranverse.
Also add obs_source_get_name_no_null() to avoid boilerplate for safe
string formatting.
Closesobsproject/obs-studio#1799
This solves the issue of users who close the primary dock widgets and
can't figure out how to get them back, who for whatever reason choose
not to read the message box when closing dock widgets that tells them
how to get it back. The users can still hide the primary dock widgets
via the View menu, but they can no longer close them via the [x] button
on the dock widget. This change does not apply to secondary dock
widgets, such as a chat window, stats, etc.
Closesobsproject/obs-studio#1804
Fixes a crash that can happen if you try to use the settings window
while in an even subloop, or if you try to close OBS while in an event
subloop. Continually retries (defers) the actions every one second
until the subloop has finished.
This new scale filter computes pixels by weighing the coverage area of
source pixels over the target pixel. This algorithm works well for both
upsampling and downsampling, but was mainly designed to upscale
high-quality low-resolution sources like RGB/HDMI retro consoles. I've
heard of people using odd workarounds like scaling up to very high
resolutions before scaling back down to preserve pixel shartpness. This
algorithm directly addresses this use-case in a much more direct
fashion.
The Area scale filter does a better job of preserving the thickness of
thin features than the Point filter.
The Area scale filter does not look at source pixels that lie outside
of the target pixel, leading to a much sharper image than Bilinear,
Bicubic, and Lanczos filters.
This filter should interpolate pixels in linear space, but OBS is not
equipped to do that at the moment.
libobs: Add GPU effect, and wire up scene serialization.
obs-filters: Add Area as an option for scale_filter.
UI: Add Area as an option for both scene items, and canvas downscaling.
Users don't realize that dockable windows can be closed (hidden) and can
be shown again via the View menu. This adds an explicit warning when
the user first closes a dockable window for their first time. In future
versions, this should be changed to a dialog box with a "Do not show
again" checkbox.