Instead of calling App()->quit() directly, which may shut down the event
loop prematurely, invoke it and put it in the event queue so other
events can be processed first.
Again, this may be redundant, but we want to make sure any remaining
events are taken care of before the main window gets completely
destroyed, and before the program shuts down. This should help ensure
that.
Plus it also says you're supposed to do it this way in the documentation
rather than call it correctly so uh... yea. Probably should have done
this sooner.
On destruction of the window, send remaining QEvent::DeferredDelete
events just to ensure there are no lingering actions remaining in the
queue. May cause additional events to be posted, which should be covered
by the final sendPostedEvents call.
(Jim note: I admit this is probably unnecessary, and this may be
redundant, but the reason such redundant precaution is being taken is
because we want to make sure that browser panels in particular are
properly cleaned up. To be quite frank I'm adding this mostly out of
paranoia.)
After stepping into this function with a debugger, it's been determined
that App() won't do anything because it'll marked as a recursive call,
and 'this' will only clear events for this specific object. Instead, we
should be using nullptr to send all posted events for the program.
This fixes an issue where posted events would not be processed on
shutdown as expected before destroying the main window.
(This also modifies the UI)
The purpose of deferring destruction of sources is to ensure that:
1.) Hard locks from enumeration cannot occur with source destruction.
For example, if the browser source is destroyed while in the graphics
thread, the browser thread would wait for the graphics thread, but the
graphics thread would still be waiting for the browser thread, causing
a hard lock.
2.) When destroys occur during source enumeration, that the integrity of
the context's next pointer in the linked list can no longer be
compromised
3.) Source releases are fully asynchronous rather than having the risk
of stalling the calling thread
4.) We can wait for source destruction when switching scene collections
or when shutting down rather than hoping for threads to be finished
with sources.
This introduces a new requirement when cleaning up scene/source data:
the obs_wait_for_destroy_queue() function. It is highly recommended that
this function be called after cleaning up sources. It will return true
if at least one or more sources were destroyed. Otherwise it will return
false. Forks are highly advised to call this function manually on source
cleanup -- preferably in a loop, in conjunction with processing
outstanding OBS signals and UI events.
Causes QObject::deleteLater() events to be processed immediately in
OBSBasic::ClearSceneData() to ensure no lingering source or scene item
references remain
Updates the filters window to use a QSplitter layout for the properties area.
The handle is disabled for audio filter windows. The handle and property area are hidden when there are no filters.
Some Twitch dashboard panels now require a UUID, it is not used for
anything but local storage right now, and according to Twitch we can
generate it ourselves (or even use a static string). To be safe we can
just use QUuid to generate a "real" UUID and then store it locally until
the user disconnects the account.
These are more fields that app stores such as GNOME Software
and Discover show. Nothing fancy, but the more information we
provide, the better it looks!
Kudos are read by app centers such as GNOME Software and Discover
to calculate the "awesomeness" level of the application. OBS Studio
qualifies for two of these kudos: the "hi-dpi icon" kudo, since we
have 128x128 and bigger icons; and the "modern toolkit" icon, since
we use Qt5.
Add these kudos to the AppData file, and let app centers tell the
world how awesome OBS Studio is :)
This change removes the minimum total size from the context bar, instead
removing certain elements when the size is too small. This means that
users will still be able to make OBS smaller in width while keeping the
context bar enabled.
First, the properties, filter and interact buttons will get reduced to
just the symbols, if it gets even smaller the source specific menus are
hidden.
Until now, we've been installing the UI/forms/images/obs.png asset
as the logo. However, that's not officially the logo we should
be using.
Install the correct logo assets. Add 128x128, 256x256, 512x512,
and scalable variants.
* aja: Initial commit of AJA capture/output plugin
* aja: Fix clang-format on aja-output-ui code
* aja: Remove script used during dev/testing
* aja: Address pull request feedback from @RytoEX
* aja: Remove the SDK sources and update CMakeLists to point to new headers-only/static libs dependency distribution.
* aja: Only build AJA plugin on x64 on macOS for now
* aja: Remove the non-English placeholder locale files. The english strings/files will be produced via crowdin, according to @ddrboxman.
* aja: Add FindLibAJANTV2.cmake script to locate the ajantv2 headers and static libs in the OBS external deps package(s). Tested on Windows x64. macOS and Linux x64 TBD.
* aja: Add ajantv2/includes to FindLibAJANTV2 include search paths
* aja: Remove commented code from aja CMakeLists
* aja: Remove debug code and comments that are no longer needed.
* aja: Fix indentation
* aja: Remove disablement of clang-format in routing table and SDIWireFormat map
* aja: Use spaces for all indentation in widget crosspoint arrays where we disable clang-format
* aja: Address code style comments made by @RytoEX
* aja: Fix uneven indentation
* aja: More fixes to if/else placement and remove superfluous comments.
* aja: Rename 'dwns' to 'deactivateWhileNotShowing' for clarity. The DeckLink plugin still uses the variable name 'dwns' and should be changed, if desired, in a separate PR.
* aja: Remove X11Extras dependency from AJA Output frontend plugin
* aja: Add patch from Jim to find AJA release/debug libs
* aja: Improve AV sync of queued video/audio sent to the AJA card in the AJA Output plugin.
When a window with an OBSQTDisplay is closed, the surface can be
destroyed before the display is, opening a gap for OBS to attempt to
draw to the invalid surface.
This deletes the underlying OBSDisplay object when the actual surface
is destroyed, closing that gap.
Note: This appears to have been an issue previously with Wayland, as
hinted by the existing ifdefs.
Previously, calling `obs_source_remove()` on an input would not fully
remove it if there was a scene item of the input on the current scene.
Now, when calling `obs_source_remove()` and there is a scene item of
the removed input on the current scene, the UI refreshes the scene
items, allowing the scene item to be released completely and the
input destroyed.
Add support for importing the Screen Capture source type from Streamlabs
scene collections. Since the Screen Capture source type is essentially
an abstraction layer for Display Capture, Game Capture, and Window
Capture, this adds some translation logic to translate Screen Capture
sources into one of those source types.
Move the python linkage after the obs target is defined so that we can
also add linker flags to preserve the unused python linkage. This is
required before GCC 11.
This fixes#2222 by ensuring python symbols are in the global symbol
table through a direct linkage to the executable. When python is
normally linked via frontend-tools.so its symbols are not global since
we dlopen frontend-tools.so. This causes issues for native python
modules which stopped directly linking python around 3.8 as the symbols
will not resolve.
This is pretty much a hack, but it minimizes the number of extra symbols
we add and hopefully isnt too terrible to maintain.
Applies transformations correctly to copy/pasted sources when copy and
pasting multiple. Previously the transformation/crop state was stored in
a single variable on copy so it would only apply the transformations to
one of the selected sources on paste instead of what the state was when
copied.
Adds the following events:
- `OBS_FRONTEND_EVENT_SCENE_COLLECTION_CHANGING`
- `OBS_FRONTEND_EVENT_PROFILE_CHANGING`
Both emitted right before the change occurs. Can provide plugins with
better awareness of these critical operations happening, so that they
can react accordingly.
The system tray assumed all outputs are inactive when it's initiated,
however outputs can be active if started via command line options. This
caused the wrong (only) text to be set if the output was in fact active.
When the filter view is created, the first item of the asyncFilters list
would be selected (if the source supports asyncFilters) and have its
properties shown.
This means that when no items were in the asyncFilters list, no
properties would be shown, even if an effect filter was present.
Adds a check to focus the effectFilters list in case there are only
effect filters, which makes the correct properties appear.
(This commit also modifies UI)
This makes it more trivial for encoder plugins to communicate to users
why specifically an encoder error might have occurred mid-stream.
Plugins using a QListView widget (e.g. obs-ptz) do not get the theme
settings that are applied to QListWidget. However, QListWidget directly
inherits from QListView, so a theme specifying the QListView will also
get applied to QListWidget. Change the themes to all specify QListView
so that theming is consistent.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
If the transform position alignment was set to anything but
top left, or the item was flipped, the item would be moved to
the the wrong position when centering vertically or horizontally.
As all the .ui files follow a set schema, providing a way to validate
that schema is useful for manual XML modifications.
XML-Schema-Qt5.15.xsd source: https://doc.qt.io/qt-5/designer-ui-file-format.html
Note: some lines had to be commented out as they are not valid in XSD.
When a new version of Qt is used, compare the diff and update as necessary.
This file doesn't do anything on its own, but can be paired with an IDE
or a standalone linter to perform validation.
This removes the AdvAudioPropsClicked and AdvAudioPropsDestroyed
functions. The click function was not being used anywhere and the
destroy function was redundant because the dialog is set
to be deleted on close.
Importers are written to convert third-party collection formats to a
Windows OBS scene collection. The Studio importer is capable of
translating scene collections to the correct types for the current
operating system. This change makes it so all imports will be ran
through the Studio translation, not just Studio and SL collections.
This change makes it so any strings in a scene collection that start
with "./" are checked as being a relative path. As long as the resulting
absolute path is contained within the same directory as the collection
being imported, it will be replaced with an absolute path.
This allows scene collections to be effectively "packaged" with assets,
so long as the assets are contained somewhere within the folder the
collection is being imported from.
The default settings were saved in the oldSettings variable of the
properties dialog in `86eb7ae` to be able to restore default settings in
undo/redo, but this doesn't actually do anything.
Besides this, it introduced a bug where clicking "Cancel" in the
properties dialog would save all settings, including default ones, as
well as a bug where not changing anything in the properties dialog would
still add an undo action.
This change makes it so that when copying filters or sources, that it
stores a weak reference to the source(s) or filter(s) being copied
rather than relying on their names.
Originally, the states of the items in the Edit menu would only update
when a context menu popup was created for sources. This moves that code
out of the context menu creation, and into its own dedicated function.
That function is then used both before the Edit menu is shown, and
before the context menu is created.
Fixesobsproject/obs-studio#3827
- If the stream is already live or going live, do not reset or
transition
- If the stream is testing, transition but do not reset
- If the stream is starting a test, error out since this can take a
while
- If the attempted transition was redunant, still return a success
Fixes#5403
This single line in the entire project causes a difference between
clang-format 12.0.0 and 12.0.1. So, just rearrange the code so it works
with both instead.
When a profile changes settings that require a restart, show a dialog to
ask the user whether they'd like to restart.
Co-authored-by: Jim <obs.jim@gmail.com>
Closesobsproject/obs-studio#3207
Adds a new setting to the general OBS settings, which can be checked
in order to no longer show the "confirm close" dialog when there are
still streams/recordings running.
This reverts commit f832d14220.
Reverting this until we do more investigation. Currently, any text
that can be typed in a dialog requires the dialog to re-enable hotkeys
on destruction, which is frustrating. There has to be a better way.
#5187 added a minimum size enforcement on the source toolbar to ensure
it remains functional at lower window sizes.
That minimum size was set to 800 pixels, which causes issues for
users on 1366x768 monitors in a vertical orientation.
This is still a rather common resolution, so this reduces the minimum
size below 768
Fix the service check for services where its name in the UI does not
match its Auth::Def service string.
In Restream's case, the service name in the UI and rtmp-services is
"Restream.io" while the service name in its Auth::Def is "Restream".
This mismatch causes the `service_check` bool to be false, whereas the
previous condition (`!!main->auth && service.find(main->auth->service())
!= std::string::npos`) would have evaluated to true.
This was broken in commit e6f1daab8c.
Fixes GitHub Issue 5290.
Fixes an issue where enter/escape/return would not work in the program
if hotkeys were disabled while in focus. No other known keys were
affected by this filter issue.
For Linux distros still living in the stone ages, use the old
randomization code. Fixes CI not building. We can change it later when
we finalize good random stuff.
Setting this to zero breaks reconnecting (and OBS) entirely as various
parts of the reconnect system do not handle zero values properly, and
there are also possible race conditions with the reconnect thread. Set a
minimum of 1 second to avoid this.
mt19937 is a deterministic RNG and was not seeded, so the state
parameter was identical for all runs. Switch to using Qt's
QRandomGenerator::system() which is implemented as a CSPRNG on
all platforms we care about.
Very low risk of anything bad here since we use a random port and the
chance of a CSRF attack is tiny, but this is a best practie to do when
using OAuth.
Reorder styling so that checked buttons can still
get hover styling.
Add a distinct background color for disabled
buttons. Fixes the text being the same color
as the button when disabled.
In order to be able to POST binary data that may contain NULL-bytes we
must manually specify the size of the array, otherwise cURL will fall
back to `strlen()`.
Appears to be a remnant left by the undo/redo system changes, not used
at all by any parts of the UI. This slot does not have undo/redo
system functionality, so it is not useful in its current form.
Commit 60d95cb5 introduced some code that used the + operator on two
Qt::Modifier items. Using a pipe operator instead fixes the compilation
error on Qt5 and Qt6.
The YouTube integration changes introduced code that does not build on
Qt6. The errors were:
* void QLocale::setDefault(const QLocale &)': cannot convert argument 1
from 'QString' to 'const QLocale &'
* no suitable user-defined conversion from "QString" to "const QLocale"
exists
This commit creates a new QLocale in place from a QString using the
`QLocale(const QString &name)` constructor, and passing that QLocale to
QLocale::setDefault.
Disable hotkeys when a user starts an interaction with the UI where they
are expected to type text and re-enable hotkeys when the interaction is
completed.
The YouTube integration auto-start and auto-stop checkboxes are only
made visible when scheduling an event. However, they are disabled by
default so users can't change them when they're visible.
I suspect these checkboxes used to always be visible and were on an
enable/disable flip which got changed to a visibility flip.
#5125 added icons to the source toolbar but no icon is displayed when nothing is selected.
This adds a spacer on the right side of the label that gets toggled inversely to the source icon, to maintain the same width
Sets a minimum size on the source toolbar itself to prevent shrinking the main window too small for it to be useable in some cases.
Also sets some sane limits on the toolbars with dropdown menus and the image source toolbar filepath
Allows the ability to override the default keyframe interval via
advanced output mode as long as that interval is smaller than the
recommended keyframe interval.
Fixes an issue where it was impossible to set a lower keyframe interval
than the recommended keyframe interval.
Since embedded browsers are no longer allowed to log into Google from the chat
dock is effectively read-only.
To prevent users from even trying to log in the input field is hidden
via custom CSS.
Having these widgets visible but disabled will only serve to confuse
users, so these widgets don't even need to be visible if the user isn't
performing a scheduled broadcast. There really isn't a purpose in having
them visible.
The helper link associated with starting a scheduled broadcast was not
helpful, as it linked to developer API documentation. Instead, have the
helper widget pop up a tooltip so the user understands what it is doing,
and adjust the wording slightly so that the user knows it's a setting
primarily used for scheduled broadcasts (normal streams always start
right away)
Fixes an issue where if creating a new source was re-done from a
different scene, the source would be created first in that scene and
then OBS would switch to the scene where the source originally was
created.
Changes the order of these two operations, which makes OBS create the
source in the correct scene.
Adds an entry to the "Scene Collection" tab of the menu bar that makes
the missing files dialog come back in case it got dismissed of files got
removed while OBS was open
All these fixes are interlinked but to explain them further:
Event selection would only partially work, the code to re-use an
existing liveStream was never hit and so didn't work. It would also
break going live because broadcast_id would never be set. Additionally
it called StartBroadcast for no reason if autostart was enabled.
API usage was unoptimal. Instead of only fetching the events we need
(active, ready) it would fetch *every single livestream* on the youtube
channel, 7 at a time, and then throw away every single result in the
majority of use cases.
This commit changes it to only fetch "active" and "ready" broadcasts and
then only filters out active ones that cannot be resumed (because
they're stil live).
Resuming existing streams also didn't work because they were just thrown
out by the selection. Now they get included if the attached liveStream
is not receiving data. The're distinguished in the UI and are listed
first. Simply selecting them and starting the stream will work.
These's still some stuff left, like redundant API calls. But thankfully
those fail silently and we can simply ignore it for now.
Adds the ability to provide translated messages for YouTube API erorr
reasons.
Also adds translation for various internal errors that were previously
hardcoded to english.
Minor changes to existing translation strings to improve
translatability.
Dims the items of hidden sources in the sources dock to make it more
obvious that they are not visible. Both the icon and the sources name
are affected.
macOS looks if the NSUserDefault NSFullScreenMenuItemEverywhere is set
to true, and if it is, it adds its own full screen menu item.
Sets this NSUserDefault to false since it defaults to true.