Commit Graph

9661 Commits (63ad0642aecda908ce1887a8ca1e47d242b98e36)

Author SHA1 Message Date
Yuriy Chumak 63ad0642ae UI: Specify exact service to auth login callbacks
(Jim note: This gives the ability for auth login callbacks to know which
specific service type is being used. For example, with something like
YouTube, there's multiple variants: RTMP, RTMPS, and HLS. This way, the
service login callback can determine how it wants to treat the login
procedure depending on the specific type of service.)
2021-07-24 15:50:59 -07:00
Yuriy Chumak 37b9ece904 UI: Add request type param to GetRemoteText 2021-07-24 15:50:59 -07:00
Yuriy Chumak c4840ddba0 UI: Set Qt locale to current OBS locale
(Jim note: This will cause certain Qt functions to treat string
conversions differently depending on the language. Useful when using Qt
to perform these conversions.)
2021-07-24 15:50:59 -07:00
Yuriy Chumak eb6ba44c8a UI: Include QtNetwork as a direct dependency
(Jim note: Rather than copy the QtNetwork library manually like we were
doing before, this makes it so that QtNetwork is used as a dependency of
the UI. The cmake used to copy the library manually thus us no longer
necessary.)
2021-07-24 15:50:59 -07:00
Richard Stanway ff0350b515 win-capture: Fix formatting 2021-07-24 23:21:02 +02:00
Richard Stanway 5d54cc36a7 obs-filters: Minor NVAFX cleanup
Remove some unused variables, fix incorrect mutex initializer, fix
exporting NVAFX functions via dllexport.
2021-07-24 23:15:45 +02:00
Richard Stanway f0e3cd1f91 UI: Simplify expressions in GetMonitorName 2021-07-24 23:15:45 +02:00
Richard Stanway 320177926d win-capture: Use better defaults in thread_is_suspended
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.
2021-07-24 23:15:45 +02:00
Richard Stanway b2e30c955d win-capture: Move NT functions to shared file
Having them declared statically in a header included by multiple
compilation units results in duplicate functions being created.
2021-07-24 23:15:45 +02:00
Richard Stanway 2727dd96bd UI: Handle prefixes when using paths in recording format
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
2021-07-24 22:34:44 +02:00
Richard Stanway 3dbfa4919a libobs: Add stop_audio function, change shutdown order
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
2021-07-24 22:34:44 +02:00
Richard Stanway 8b50ad5e2a UI: Initialize Studio mode after loading scenes
Switching to Studio mode tries to duplicate the current scene, which is
null until scenes are loaded, generating various errors.
2021-07-24 22:34:44 +02:00
Richard Stanway e7df070438 decklink: Add destructor for OBSVideoFrame, initialize flags
Fixes a memory leak and potential access to undefined variable.
Detected by Coverity Scan.
2021-07-24 22:34:44 +02:00
Richard Stanway 4c8b209bf0 UI: Use larger buffer for scene collection filename
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
2021-07-24 22:34:43 +02:00
jpark37 31c488f0d0 decklink: Fix truncation warnings
Also simplify DeckLinkDeviceMode::IsEqualFrameRate using cross-multiply.
2021-07-23 21:37:43 -07:00
jpark37 8440a53da3 libobs: Round up chroma sizes for odd resolutions
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.
2021-07-23 12:02:06 -07:00
liu.haibin d6c77964c0 libobs: Fix stack buffer overflow in build_current_order_info 2021-07-20 08:46:53 -07:00
VodBox 394eab050c UI: Fix ambiguous conversion error 2021-07-20 17:34:42 +12:00
VodBox 1102e0b1ee UI: Fix formatting on window-basic-settings.cpp
A requested change on PR #4455 resulted in a formatting error that was
missed before being merged. My bad.
2021-07-20 17:24:16 +12:00
Delta a64328da56
UI: Add "18 Scenes" multiview option
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.
2021-07-20 17:16:44 +12:00
Georges Basile Stavracas Neto 21a9c5b7d9 flatpak: Remove D-Bus permissions to talk to session managers
They were used to implement session inhibition, but with the new
portal-based implementation in place, they aren't necessary anymore.
2021-07-18 14:04:44 -07:00
Georges Basile Stavracas Neto 99559aab5a libobs: Add portal inhibitor
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.
2021-07-18 14:04:44 -07:00
tt2468 0698eeda94 decklink: Don't show incompatible formats
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.
2021-07-15 07:29:13 -07:00
Jim 4fad39cdc4
Merge pull request #4950 from jpark37/manual-srgb-filtering
Manual SRGB filtering
2021-07-11 09:34:45 -07:00
jpark37 bf27941f5f libobs-winrt, win-capture: Linear SRGB support
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.
2021-07-11 08:26:30 -07:00
jpark37 ebfbe1a78e libobs-opengl: Fix GS_R10G10B10A2 format 2021-07-11 08:26:29 -07:00
jpark37 993c46c8a2 libobs-d3d11: Relax texture format copy check
SRGB and non-SRGB formats are compatible for copy.
2021-07-11 08:26:29 -07:00
jpark37 6d59cf19e9 libobs-d3d11: Use typeless texture for duplicator
This allows us to use an SRGB SRV for automatic decompression.
2021-07-11 08:26:29 -07:00
jpark37 7c72fd1d4c libobs: Plumb texcoord hint to reduce GPU cost
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.
2021-07-11 08:26:29 -07:00
jpark37 da3375d5a4 libobs: Add gs_generalize_format helper 2021-07-11 08:26:29 -07:00
jpark37 c9766d8e28 libobs: Add DrawSrgbDecompress default technique
Useful when the texture does not support SRGB conversion on load.
2021-07-11 08:26:05 -07:00
jpark37 05b507d900 libobs: DrawSrgbDecompressPremultiplied technique
Necessary for an upcoming fix to browser source.
2021-07-11 08:11:12 -07:00
gxalpha 09865c2ad4 UI: Fix displayed autoremux file name 2021-07-09 19:52:21 +12:00
SCG82 88cc691afa UI: Add obs-frontend-api functions to create/delete profiles 2021-07-09 19:32:18 +12:00
tt2468 502bc3bf0a UI: Add startup flag to disable missing files window
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.
2021-07-09 18:32:56 +12:00
tt2468 9ca70f4470 UI: Add obs_frontend_get_current_profile_path()
Returns the path of the current profile's location on the filesystem.
2021-07-09 17:39:40 +12:00
tt2468 53a8a326da libobs: Add `obs_enum_all_sources()`
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.
2021-07-09 17:33:17 +12:00
Matt Gajownik 74c3781554 libobs, UI: Add support for button properties as links
This adds support for a button property that opens a URL, after showing
a confirmation dialog to the user. Both the Type and URL must be set.
2021-07-09 17:32:09 +12:00
Georges Basile Stavracas Neto 712478f48c libobs/nix: List Flatpak search paths
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
2021-07-08 10:53:15 -07:00
Bruce Zhang 7baf08e917 rtmp-services: add bilibili live 2021-07-08 09:44:28 -07:00
Georges Basile Stavracas Neto ec3e8146b2 pipewire: Properly pass sizes to gs_draw_sprite_subregion
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
2021-07-08 08:32:55 -07:00
jpark37 4d9d7b7070 obs-filters: Fix comparison type mismatch 2021-07-06 14:08:28 -07:00
jpark37 880eac5b24 obs-ffmpeg: Fix comparison type mismatch 2021-07-06 14:08:28 -07:00
jpark37 b94fbac7ef libobs: Fix warnings
Cast away truncation, and widen type before multiplication.
2021-07-06 14:08:28 -07:00
Norihiro Kamae ed76a3032b text-freetype2: Add alpha channel property
Use obs_properties_add_color_alpha to set alpha for text colors.
2021-07-04 12:16:09 -07:00
jpark37 49cfd2426f mac-syphon: Use DrawOpaque as necessary
Treat "Allow Transparency" to mean alpha should be 1.0. Skipping alpha
writes can cause alpha to stay 0.0, which is not desired.
2021-07-04 10:35:54 -07:00
jpark37 b70161bc67 libobs: Add DrawOpaque for rect effect
Needed by Syphon Client.
2021-07-04 10:35:54 -07:00
Norihiro Kamae 5e44e6412a libobs: Fix memory overrun if libobs version mismatches
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.
2021-07-04 08:49:42 -07:00
Matt Gajownik 5485a91d4c UI: Log Show/Hide transitions on scene collection load 2021-07-04 08:25:33 -07:00
Richard Stanway a82bb12848 cmake: Enable full optimizations for RelWithDebInfo MSVC builds
Adds compiler flag:
/Ob2 (automatic inline expansion)

And linker flags:
/OPT:ICF (identical COMDAT folding)

Ref: https://gitlab.kitware.com/cmake/cmake/-/issues/20812
2021-07-04 05:26:38 -07:00