0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 21:13:04 +02:00
Commit Graph

9245 Commits

Author SHA1 Message Date
Matt Gajownik
472ce22a73 CI: Build on Ubuntu 18.04, use newer clang-format
There are too many issues with 20.04 to successfully build with
VirtualCam - the azure kernel is missing videodev headers. For now,
use 18.04 LTS directly for main CI builds.

Both 18.04 and 20.04 include clang-format-10 without issue.
2021-02-22 02:10:34 -08:00
jp9000
81a89e689f UI: Fix output resolution not properly changing
Fixes a bug where the output resolution wouldn't change when using a
service that uses the "supported resolutions" limitation. When switching
to a non-editable combo box, the signal used to detect whether the combo
box has had its value changed wouldn't work anymore because it was the
signal explicitly used for editable combos. So, to fix, just reapply the
normal combo box signal to detect when the value has been changed.

Fixes obsproject/obs-studio#4124
2021-02-17 03:31:06 -08:00
Gol-D-Ace
7a4844e2fc UI: Fix locale name 2021-02-15 18:16:07 +01:00
Clayton Groeneveld
3e4c2c0535 obs-ffmpeg: Fix replay save callback not working properly
Previously the save callback would be called when the replay buffer
hotkey was pressed and not when the saving of the replay was finished.
When the 'get_last_replay' procedure was called after the saved callback
function, it would return the incorrect path, as the path would still
be the previous path.
2021-02-15 02:40:00 -08:00
jpark37
744cb97524 libobs-winrt: Make Close() failures non-fatal 2021-02-14 23:11:07 -08:00
jpark37
17cb0acdd7 graphics-hook: Fix build without COMPILE_D3D12_HOOK
Just need to forward declare D3D12 type.
2021-02-14 22:20:14 -08:00
jpark37
23e9d4153e win-capture: D3D12 swap chain queue usage
Attempt to schedule shared texture copies against the command queue that
the game's swap chain uses to try to reduce artifacts. The heuristics
for obtaining the queue are not perfect, so provide a toggle to use the
previous behavior.
2021-02-14 02:06:02 -08:00
Jim
622d2f7658
Merge pull request #3338 from GeorgesStavracas/feaneron/egl-dmabuf
DMA-BUF importing for EGL renderers
2021-02-13 21:10:09 -08:00
Georges Basile Stavracas Neto
ce50020414 flatpak: Enable Wayland
Expose the Wayland socket to the sandbox, and enable Wayland at build
time using the new ENABLE_WAYLAND define for CMake.
2021-02-14 12:36:23 +11:00
Georges Basile Stavracas Neto
7867d16e6b libobs-opengl: Implement DMA-BUF importing on EGL renderers
Implement device_texture_create_from_dmabuf for EGL/X11 and EGL/Wayland.
The code is shared between them, in a new gl-egl-common.c file.

This is currently limited to a few common RGB(A) formats for now, which
seems to cover most use cases.
2021-02-13 19:48:56 -03:00
Georges Basile Stavracas Neto
b26073c5b2 deps-glad: Add DMA-BUF EGL extensions
Import the DMA-BUF importing extensions from GLAD.
2021-02-13 19:42:01 -03:00
Georges Basile Stavracas Neto
f7a55f45fd libobs/graphics: Add Linux-only gs_texture_create_from_dmabuf()
DMA-BUF is a widespread Linux buffer sharing mechanism. It is what's
commonly used zero-copy screen sharing by Wayland compositors.

Add a new 'device_texture_create_from_dmabuf' vfunc to gs_exports,
and stub implementations to libobs-opengl. Add a new public method
gs_texture_create_from_dmabuf() that calls this vfunc.
2021-02-13 19:13:54 -03:00
Oliver Lietz
01c00cf271 rtmp-services: Add nanoStream Cloud / bintu
Closes obsproject/obs-studio#4086
2021-02-13 14:06:21 -08:00
Nirusu
2787e63d8e UI: Fix screen resolution for canvas size
In #3988, @RytoEx mentioned that the recent Qt upgrade to 5.15.2
introduced a regression in which Qt begins returning DPI/scaling
aware resolutions for each screen. While this was fixed for
new profiles, this was not reflected in the choice for the
Canvas (Base) Resolution in the Settings screen yet.

This commits fixes this issue, and calculates the correct
physical screen size again, respecting per-screen DPI scaling.
2021-02-12 15:28:26 -08:00
Georges Basile Stavracas Neto
e64c61710f flatpak: Disable browser for now
The Chromium sandbox is conflicting with the Flatpak sandbox in a non-trivial,
non-workaroundable way. Until Chromium / CEF provides a way to unconditionally
disable the entire sandbox, let's not degrade the Flatpak experience.
2021-02-12 04:59:30 -08:00
Jim
190ab876cc
Merge pull request #2484 from GeorgesStavracas/feaneron/egl-wayland
EGL/Wayland (Wayland, pt 3)
2021-02-12 01:30:05 -08:00
jp9000
e8a1c082da Revert "UI: Add ability for stingers to use filters"
This reverts commit 36ab7b97cf.

The fact that a transition is a composition of two scenes was not
factored into the merging of this PR. Thus, it would apply to the
underlying scenes when transitioning, making the effectiveness of this
feature cause inconsistent rendering of the underlying scenes when
transitions are activated versus when they're not.
2021-02-11 22:34:55 -08:00
Georges Basile Stavracas Neto
e67fdbca79 UI: Check for Expose and PlatformSurface events to create display
This is a workaround for QWaylandWindow never becoming exposed, or
receiving the QEvent::Expose [1].

[1] https://bugreports.qt.io/browse/QTBUG-86176
2021-02-09 09:39:17 -03:00
Georges Basile Stavracas Neto
226cc22669 UI: Make OBSQTDisplay::CreateDisplay() public and allow forcing creation
This will be used by a new event filter, added only when running as a Wayland
client, to force creating the obs_display instance even when not exposed.
2021-02-09 09:39:17 -03:00
Georges Basile Stavracas Neto
b629265e7f UI: Disable and ignore Always On Top on Wayland platforms
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.
2021-02-09 09:39:17 -03:00
Georges Basile Stavracas Neto
f817300cfa UI: Rename callback to match signal name
The sizeChanged callback is connected to the screenChanged signal,
and evidently the naming doesn't match. Rename the callback to
match the signal name.
2021-02-09 09:39:17 -03:00
Georges Basile Stavracas Neto
b71498e8ab UI: Don't create obs_display when QTToGSWindow fails
Right after showing the OBSQTDisplay widget, it may happen that a
wl_surface is not yet created and attached to the window. When this
happens, creating the OBS display results in a crash.

Make QTToGSWindow return a boolean, indicating success or failure, and
don't create the OBS display on failure.
2021-02-09 09:39:17 -03:00
Georges Basile Stavracas Neto
60dab2cf1c UI: Destroy display when becoming invisible
When a window is made invisible, then visible again, the
obs_display is reused. Turns out, QT destroys the wl_surface
associated with the previewer on Wayland. However, the EGL
surface created on top of this wl_surface is not, and any
attempt to attach a new buffer to it will crash OBS.

Destroy the obs_display when becoming invisible, and when
running as a Wayland client. Also nullify the display
variable on destruction, to avoid subclasses double-freeing
the obs display.
2021-02-09 09:39:17 -03:00
Georges Basile Stavracas Neto
a56582d92d UI: Retrieve Wayland surface from QWindow
On Wayland, we want to query the window's underlying
platform for the Wayland surface, instead of foolishly
retrieving the X11 display.

Pass QWindow instead of WId directly, and set the surface
as the platform data on Wayland systems.
2021-02-09 09:39:17 -03:00
Georges Basile Stavracas Neto
eab27571d2 libobs-opengl: Introduce an EGL/Wayland renderer
Introduce a new Wayland/EGL renderer.
2021-02-09 09:39:17 -03:00
Georges Basile Stavracas Neto
137966e01f libobs-opengl: Try to use the platform display if available
We need to ensure we're running all X11 code on the same display.
2021-02-09 09:39:04 -03:00
Georges Basile Stavracas Neto
2b3cb54771 libobs: Add a Wayland platform
Introduce the OBS_NIX_PLATFORM_WAYLAND enum value, and try to detect
it when OBS Studio runs by looking into the platform name.
2021-02-09 09:39:04 -03:00
Clayton Groeneveld
36ab7b97cf UI: Add ability for stingers to use filters
This adds a menu item in the transitions config menu to access
filters for stinger transitions.
2021-02-09 02:46:27 -08:00
poccariswet
77e4a09f62 rtmp-services: Add OPENREC.tv service 2021-02-08 22:36:36 -08:00
Jim
06c5d059c1
Merge pull request #4210 from fredemmott/decklink-settings-double-free
decklink-ui: fix double free of settings
2021-02-08 22:35:50 -08:00
Fred Emmott
e5f05473e7
decklink-ui: fix double free of settings
This leads to a crash when the output is stopped, either by clicking the
stop button or when exiting OBS studio.

This crash is:
- intermittent in release builds
- reliable for me in debug builds

It is held by an `OBSData`, which, if not null, will automatically
call `obs_data_release()` on scope exit.
2021-02-08 14:46:38 -06:00
Jim
999d32e581
Merge pull request #1618 from Palakis/stinger-track-matte
obs-transitions: Track Matte support for Stinger Transitions
2021-02-08 01:48:30 -08:00
Andrés Barreiro
c83273cc72 win-dshow: Add autorotation toggle 2021-02-07 21:12:48 -08:00
Hernán
a8aadff2f5 rtmp-services: update Piczel.tv recommended 2021-02-07 11:36:10 -08:00
Stéphane Lepin
2bd0404c17 obs-transitions: skip stinger size factors if track matte is disabled 2021-02-06 17:14:10 -08:00
Stéphane Lepin
442ebce361 obs-transitions: default size factors when track matte is disabled 2021-02-06 17:14:10 -08:00
Stéphane Lepin
506434c5e6 obs-transitions: add track matte feature to the stinger transition
This adds the ability to use a secondary black-and-white video as a mask
between source A and B of the transition. The greyscale value of each
pixel is used as the "slider" value in a linear interpolation between the
corresponding pixels in source A and source B.
The track matte can either be in the same file as the stinger itself
(next to the stinger or under the stinger, doubling the width or height
of the stinger depending of the selected layout) or a in a separate
dedicated file.
The same file/separate file behavior is controlled by the
"Matte Layout" option in the stinger settings.
2021-02-06 17:14:07 -08:00
jp9000
6cf22c54dc win-waspi: Make sure to unregister notification obj
Fixes a bug where the notify object existed after source deletion
2021-02-06 10:41:19 -08:00
jp9000
74e6448195 win-wasapi: Add default audio device change detection
Probably long time coming, but when the user changes their default audio
device in Windows sound settings, OBS will now detect it and change the
audio device automatically to the new device if it was set to use the
"Default" device.
2021-02-06 00:29:54 -08:00
jpark37
951acf2dfe libobs/util: More atomic fixes
Use _ARM_BARRIER_ISH for ARM path.

Remove useless conversion in os_atomic_load_bool.
2021-02-04 17:14:46 -08:00
jpark37
3df4a1109c libobs/util: ARM atomic fixes
Use native instructions on ARM64 (dmb is slow).

Use magic number for 32-bit ARM since _ARM64_BARRIER_ISH is for ARM64.
2021-02-03 22:18:26 -08:00
Henrik "Henke37" Andersson
f0ad7a92cd libobs: Include thread names in thread traces
Makes the crashlog a little nicer to read.
2021-02-03 13:08:57 -08:00
tt2468
1ea8183737 Docs: Add obs_frontend_reset_video() 2021-02-03 08:53:42 -08:00
tt2468
fa3ae6db93 Frontend-API: Add obs_frontend_reset_video() 2021-02-03 08:53:42 -08:00
jpark37
d48e77385c libobs: Update compare-exchange pattern
Use function that updates previous value automatically.

Also load initial value seq_cst to be safe.
2021-02-03 08:51:31 -08:00
jpark37
5cf40bf818 docs/sphinx: Update atomic API 2021-02-03 08:51:31 -08:00
jpark37
1f90f0e36b libobs/util: Various atomic improvements
Add exchange functions to alias the poorly named set functions.

Add store without reading previous. Faster on non-x86 processors.

Add compare-exchange that updates previous to avoid redundant fetch.

On Windows, load bool without conversion from char.

On Windows, load using mov with compiler barrier. Still seq_cst.

On POSIX, use GCC __atomic builtins.
2021-02-03 08:51:31 -08:00
Hector Martin
31a9dc384d libobs: guard against lagging audio sources
df4eb82 fixed a bug that caused source audio timestamps to perpetually
lag. However, there is a deeper issue where after we reach max
buffering, lagging sources make OBS's entire audio pipeline fall over.
These may be corrected by later code, but still cause global audio
glitches at best. Persistent problems, as prior to df4eb82, cause audio
to fail entirely.

The root cause is that OBS's audio mixing tree cannot deal with
timestamps prior to the current audio tick. Intermediate mixing stages
assume that the lowest incoming timestamp is the base of the current
tick, and mix accordingly. This propagates lagged timestamps up the
tree, where at the top level mix_audio will drop the source entirely -
which at this point is a transition covering all inputs, thus glitching
audio globally. Where extra buffering can cover the slip, the entire mix
gets retried and the error corrected, but when the global buffer
duration is maxed out, it makes it to the output.

The solution is to catch laggy sources immediately after rendering, and
drop audio to bring them back in sync, or mark them pending if not
enough audio is available. This ensures later mixing stages are not fed
with out of sync timestamps.

This improves the ignore_audio code to only drop as much audio as
needed to bring the source back in sync, and moves its call to
immediately after source audio rendering.
2021-02-02 13:28:54 -08:00
Hector Martin
3191f5ddb0 libobs: transition: ignore sources with ts=0
This is a safety against sources which somehow end up with
audio_pending=false but ts=0. Other codepaths guard against this too.
2021-02-02 13:28:54 -08:00
Doug Kelly
ead1c63a18 mac-avcapture: Add additional capture presets
This adds additional capture presets, including 3840x2160 and
1920x1080, in addition to the preset "High." These are guarded with
a runtime check using the @available() keyword for macOS 10.15+.
2021-02-02 06:51:21 -08:00