On my system with ~250 processes running, this loop has to run over 500
times before allocating enough memory. Use better initial and increment
values to avoid thrashing the heap.
The replay buffer and screenshot functions add a prefix to the output
filename. The code in GetFormatString assumed the format string was the
entire filename, and inserted the prefix at the beginning. This caused
illegal paths such as "Screenshot /2021/05/22-35.mkv" to be created if
the user had specified a path in the format string, resulting in lost
files.
This commit inserts the prefix before the last / character to ensure it
only affects the filename portion of the format string.
Fixes#4707
This fixes a crash that could occur during freeing of sources, as the
audio subsystem was destroyed before sources were released. If a source
had monitoring enabled, it would try to lock a mutex that has been
destroyed, resulting in a crash.
Freeing audio after obs_free_data was also not a solution, as the main
view is freed in obs_free_data, and the audio subsystem is still running
and trying to lock the main view channel mutex which has been freed.
This seems to be the best middle ground, making sure the audio subsystem
is stopped so it no longer tries to access the main view channel, then
freed after obs_free_data.
Fixes https://github.com/obsproject/obs-studio/issues/4409
Though the maximum size of a scene name is 170 characters, after
worst-case UTF-8 expansion this could overflow the buffer, resulting
in the scene collection being "lost" as the .json extension was
truncated.
Fixes#2560
When playing video, OBS can overflow and crash, or render video edges
incorrectly if the video resolution does not divide into 2 for trivial
chroma subsampling. This is fixed by rounding chroma plane sizes up
instead of down, and maintaining that through the video pipeline.
Adds a "18 Scenes" multiview option. The 18 scene view leaves the
preview and program sized to the upper half of the window
Settings index in combobox may not match up with enum index. Settings
in the dropdown can now be ordered separately from the enum order.
XDG Portals provide a plethora of features meant to be used inside and
outside sandboxed environments. OBS Studio currently uses portals to
implement Wayland-compatible monitor and window captures.
However, OBS Studio performs another action that can be done through
portals: inhibit the screensaver. Under the Desktop portal (the same
used by the captures mentioned above), there is an "Inhibit" portal
that provides session inhibition.
Add a new portal-based inhibitor. This inhibitor is only used when the
Desktop portal is available and running; the previous D-Bus implementation
is used in the absence of the portal. Because it's basically another set
of D-Bus operations, wrap the new portal inhibitor under the HAVE_DBUS
call too.
Changes the formats dropdown for decklink output to only show formats
using the same framerate as OBS does. OBS cannot perform framerate
conversions, meaning that if OBS's framerate is set to 45fps, and
decklink output is set to 60fps, the output will either lag heavily
or simply not function.
Update window, display, and game capture to always bilinear filter in
linear space, even if the source texture is not SRGB typed. This helps
resolve confusion in situations where we were filtering in nonlinear
space vs. linear space, like when toggling an empty crop filter.
In order to do linear-correct filtering cheaply when scale filtering is
disabled, we need to know whether or not texture coordinates will always
sample from texel centers. This can be computed at the scene item level
relatively easily, and passed along to sources when rendering. Scene
items will use obs_source_set_texcoords_centered to set hint status, and
sources will use obs_source_get_texcoords_centered to retrieve it.
Adds a startup flag (--disable-missing-files-check) to disable the
missing files dialog from appearing on load. For some users, the
missing files dialog may interfere with automation of OBS, or the
user may also purposefully have missing files in their scene
collection which they do not want to be warned about.
There is currently no way to enumerate *all* sources in OBS. Only
inputs and scenes have a way to be enumerated. Some applications
like obs-websocket have features that need to take advantage
of enumerating all sources in order to function properly.
The proposed way to handle plugin distribution
through Flatpak depends on these directories to
be read. It goes as follows:
1. Flatpak's extension point merges the 'lib'
and 'share' directories at /app/plugin
2. Plugins prefix their install paths in the
Flatpak manifest to /app/plugins/<plugin name>
3. OBS Studio lists /app/plugin as one of the
search paths in OBS Studio code
This commit implements the third step of this
process, which is the only one that actually
involves OBS Studio itself.
With that, it is possible to distribute plugins
as Flatpak extensions, which in turn allows them
to be listed at app stores such as GNOME Software,
elementary's app store, and KDE's Discover.
Related: https://github.com/flathub/com.obsproject.Studio/issues/135
The gs_draw_sprite_subregion() function is used when a cropping
rectangle is received from PipeWire. It is usually used by
compositors to implement window screencast - where a large and
mostly empty frame is sent, the window contents are only a small
part of it, and the crop rectangle tells us that.
Recently the wlroots implementation of portals started to use it
to implement cropping, and it exposed a bug in the PipeWire code
in OBS Studio. The gs_draw_sprite_subregion() function takes a pair
of integers representing position (x, y) and a pair of integers
representing size (width, height). The PipeWire code, however,
passes a second pair of positions (x2, y2) instead of sizes, and
it causes overrendering the crop area.
This bug wasn't hit yet because both GNOME and KDE implementations
always send (0, 0) as position, which practically never trigger
this condition.
Pass only width and height to gs_draw_sprite_subregion(), instead
of adding x and y to them.
Fixes https://github.com/obsproject/obs-studio/issues/4982
When size of source_info_t is larger then current structure, memcpy
overruns. Size check is moved before the memcpy.
HANDLE_ERROR macro copies info to data but data is not used. When
calling free_type_data and type_data, the member of data should be used
to ensure the free_type_data is not out of bounds.
When changing a source's audio mixers/tracks or sync offset with
obs_source_set_audio_mixers or obs_source_set_sync_offset
from a non UI thread while the advanced audio properties panel is open
the UI fields will not update until closed and reopened.
It just shows an error on stderr for the failed invokeMethod calls
that would do the update. For mixers and sync offset respectively:
QMetaMethod::invoke: Unable to handle unregistered datatype 'uint32_t'
QMetaMethod::invoke: Unable to handle unregistered datatype 'int64_t'
Added needed Qt registrations in window-basic-main as that's where
all the needed ones for the frontend UI seem to be put.
Adds support for 1080p streams, adds support for 60 FPS streams,
implements bitrate matrix to restrict bitrates depending on the user's
resolution and framerate combination, and removes 480x360, as it was the
incorrect resolution (the correct resolution was supposed to be
640x360).
The bitrate matrix allows specifying maximum bitrate values based upon
resolution and framerate values. This allows more fine-tuned enforcement
of bitrate to prevent users from setting a bitrate that is less ideal
for their particular framerate and resolution combination.