Audio ids were being stored in a map with const char pointers, thus they
were destroyed when call_once finished. To fix this, store std::strings
instead.
Having both a "callback" and "cb" doesn't make sense. One is
specifically for visual updates only, the other is for actual updates,
so use an appropriate name for both
Fixes overriding of macOS dock icon behavior.
macOS sets the icon on launch based on:
- The Information PLIST
- A user provided icon by Finder
setWindowIcon overrides this behavior.
Therefore, this commit resolves this issue,
by doing nothing if target is macOS.
When we added undo/redo in 86eb7aeb a distinction between Updates and
Visual updates was made, presumably for filters which need special
handling of the update case. These functions were also added to regular
source properties, but didnt use any special code instead calling
obs_source_update an additional time after a short time.
Instead lets remove the 2nd delayed call and only call obs_source_update
once per settings change.
Remove a bit of duplicated code, and fix non-Windows compilation. This
is a bit of a workaround to not have to modify cmake, but might as well
reuse a function that already exists anyway rather than duplicate the
code.
When you add an audio capture source and use the "use existing" feature
in the source selection dialog, and then recreate the same audio source
again in audio settings, it will result in two sources using identical
names, which although relatively harmless can cause issues when doing
things such as trying to find sources by their name.
Fixesobsproject/obs-studio#5621Closesobsproject/obs-studio#5947
For some reason, the combination of QPlainTextEdit and a HTML block
seems to treat spaces as HTML shoult (only display one, no tabs, etc)
rather than how QTextEdit + HTML does, which is strange. As we don't
need HTML for existing log lines, insert them as plaintext, but for
new entries wrap non-error non-warning messages in a <font> tag and
format that with white-space: pre
Replace fixed Arial, 7 px meter scale font with the font used
for VolumeMeter/QWidget. Add qproperties for meter bar thickness and
a scaling factor for the meter scale numbers. If not specified in a
QSS, defaults are 3 pixel bar width and 80% of base font size.
Sort video device entries with `alphasort` on non-Linux platforms,
as opposed to `versionsort` on Linux.
(`versionsort` is a GNU extension, unavailable on e.g. FreeBSD.)
UI: Fix call to `to_string` on FreeBSD
This commit includes two big changes, alongside other smaller tweaks.
1) Update the internal QTextDocument of the text component directly
2) Use QPlainTextEdit, which supports HTML & is designed for long text
3) Use QString's arg function for formatting strings
Fix 1 significantly improves realtime performance when adding lines
individually, to the point that the UI no longer freezes if the viewer
is open and the log is being spammed. It also improves initial launch
speed when there's a large amount of text already in the file.
Reference: https://stackoverflow.com/a/54501760/2763321
Fix 2 completely eliminates delay when opening the viewer, regardless
of how many lines are already in the log file. For a standard log
after OBS launch, this cuts opening time from about 2 seconds to half a
second. For anything longer than 1,000 lines, the UI no longer freezes,
and the viewer (& its contents) open within half a second.
Reference: https://stackoverflow.com/a/17466240/2763321
Use weak references on OBS objects that properties view reference in
order to ensure that the objects are still valid.
This fixes a crash where properties views would use objects without
necessarily knowing whether they were still valid or not.
Fixesobsproject/obs-studio#5862Closesobsproject/obs-studio#5863
Removing the first call to `video_output_stop` prevents the `data_mutex`
field in `struct video_output` from being destroyed while still in use.
The `render_preview_source` function will call `video_output_lock_frame`
upon that mutex and encounter a NULL pointer exception.
For some reason, SetWindowDisplayAffinity can make windows visible even
when it sets the same value for affinity that GetWindowDisplayAffinity
reports. Possibly an API bug as this is probably not a widely used API
yet?
Fixes a weird window with no size appearing when browsing for files on
Windows.
OBS_PROPERTY_GROUP creates neither a widget nor a label, causing
AddProperty to create a default one. Without a widget, it does not
get attached to the layout, resulting in a memory leak.
This commit also simplifies a bit of the code to avoid repeatedly
testing the same condition.
They detection for this was not checking the n selected items but the
first n items in the list, which would lead to the options being enabled
or disabled based on the whether other items were locked.
This uses the SetWindowDisplayAffinity API to hide windows from capture
applications (including OBS). This is not perfect - internal windows
such as context menus, combo box dropdowns, etc will still be displayed.
Even with these limitations, it should help people with single monitors
capture content with less interference from the OBS window.
This implementation is for Windows only but the code is generic enough
that adding other platforms should be straightforward.
This needs to match the base name of the .desktop file name.
This is needed for propagating the correct App ID on Wayland,
which is needed e.g. for proper window icons on Plasma.
If streaming and recording was selected in the Auto-Configuration
Wizard, a memory leak would occur. When obs_service_resolution appeared
elsewhere in C++ files, it used a BPtr. Use BPtr here too.
Reordering the filters makes the filter mutex of the source locked
while loading a new the properties of a filter which may require other
locks. By loading the properties of the filter on a QueuedConnection
we make sure the filter mutex is cleared when that happens.
Rather than showing the main window, then hiding it again when the
tray icon initialization happens, just don't show the main window.
When deciding whether to show the window, we need to know whether
the tray icon is available or not - if it's not and we don't show
the window, there would be no way to restore OBS.
When running Windows 10 or 11 in light mode, the pause icon especially
was hard to see. This adds a border to both icons to improve visiblity.
Additionally, the active icon was a little too large.
This reverts commit 02f3495b72.
Multiple issues have come up with this commit. One issue is that
suddenly replays are overwriting themselves despite the option being
disabled. Second issue is that slashes to separate files into
subdirectories no longer work properly with replay buffers.
I'm just reverting it. I do not care enough about this feature to try to
fix it or wait on a fix. If someone wants to fix it they can create a
new PR for it.
Millisecond time in the log was added in 36ad777b8 but the millisecond
was not always added just after the second digits depending on locale
settings. To make consistency in the log file, `%T` is specified for
`strtime` instead of `%X` so that the time format is not localized.
The *AutoRelease helpers should not take references from OBSRef objects.
Instead, make an OBSRefAutoRelease base class, and OBSRef a subclass of
that to allow moves, and then perform moves from those objects.
This fixes an issue where *AutoRelease OBSRef objects would cause an
unintended double release of objects after having been assigned values
from non-*AutoRelease OBSRef objects.
This commit adds a setting to reset timestamps when splitting files.
Some NLEs cannot handle video files whose starting timestamp is not
zero. Default is enabed.
This commit implements a new feature to split recordings in split files
in Advanced output mode.
These basic settings are implemented.
- Enable/disable the feature. Default is disabled.
- Select a type of the limit, time or size.
- Specifies the limit in seconds or MiB.
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.