9145 Commits

Author SHA1 Message Date
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
Georges Basile Stavracas Neto
9810fe9220 linux-capture: Fail to load when running on EGL
Right now, linux-capture hard-depends on GLX. Disable it when
running under EGL.
2021-02-01 19:05:11 -03:00
Georges Basile Stavracas Neto
27d0182fdb UI: Set the Unix platform on startup
Move the OBS_USE_EGL environment variable check to obs-app.cpp,
and set the OBS platform to be either OBS_NIX_PLATFORM_X11_GLX
or OBS_NIX_PLATFORM_X11_EGL.
2021-02-01 19:05:11 -03:00
Georges Basile Stavracas Neto
506b950d02 libobs: Introduce the concept of a Unix platform
This is a Unix-specific code. The only available platforms
at this point are the X11/GLX and X11/EGL platforms.

The concept of a platform display is also introduced. Again,
the only display that is set right now is the X11 display.
2021-02-01 19:05:10 -03:00
Georges Basile Stavracas Neto
510c747459 libobs/nix: Move X11-specific code to obs-nix-x11.c
Currently, obs-nix.c is highly tied to the X11 display
server. It includes X11 headers directly, and make use
of X11 functions. Most of the code inside obs-nix.c that
is X11-specific is related to hotkeys handling.

Introduce a new vtable for hotkeys callbacks, that will
used by X11 and Wayland to expose their specific routines.
In this commit, only the X11 hotkeys vtable is implemented.

Move all the X11-specific code to obs-nix-x11.c, and add
a new function to retrieve the X11 hotkeys vtable.
2021-02-01 19:03:43 -03:00
Georges Basile Stavracas Neto
586767ab12 ci: Install qtbase5-private-dev on Linux
List this dependency both under CI/install-dependencies-linux.sh, and
.github/workflows/main.yml.
2021-02-01 19:03:43 -03:00
Georges Basile Stavracas Neto
59744e95c3 deps/glad: Make X11 required as well
To keep consistency with the EGL line
2021-02-01 19:03:14 -03:00
Georges Basile Stavracas Neto
2fd8a6df55 libobs-opengl: Introduce the X11/EGL winsys
Introduce the EGL/X11 winsys, and use it when the OBS_USE_EGL environment
variable is defined. This variable is only temporary, for future commits
will add a proper concept of platform.

All the EGL/X11 code is authored by Ivan Avdeev <me@w23.ru>.
2021-02-01 19:03:14 -03:00
Georges Basile Stavracas Neto
647415ec4f libobs-opengl: Factor out GLX winsys
Move the GLX-related code to gl-x11-glx, and introduce gl-nix as
a winsys-agnostic abstraction layer. gl-nix serves as the runtime
selector of which winsys going to be used. Only the X11/GLX winsys
is available now, but later commits will introduce the X11/EGL
winsys as well.

The gl-nix code was originally written by Jason Francis <cycl0ps@tuta.io>
2021-02-01 19:03:14 -03:00
Georges Basile Stavracas Neto
83ae6f6f43 libobs-opengl: Rename gl-x11.c to gl-x11-glx.c
This is in preparation for the future abstraction layer (gl-x11-*)
and also to match the actual name of the windowing system. When
running under X11, we can glue OpenGL through GLX or EGL, so the
new file name matches that now.
2021-02-01 19:03:14 -03:00
Georges Basile Stavracas Neto
7801b3301a deps-glad: Add EGL
The code is generated by https://glad.dav1d.de/
2021-02-01 19:03:14 -03:00
Lordmau5
5b899788da UI: Add launch parameter to disable high-DPI scaling 2021-02-01 05:44:37 -08:00
Thulinma
244b6c92e6 obs-outputs: Fix RTMP restart not always working
Bug is caused by the internal connection variables not being reset on
reconnect, leading OBS to both be unable to parse valid packets from and
send valid packets to the remote end.  This commit splits RTMP_Init off
into a new RTMP_Reset function, which resets these internal variables
without re-initing the rest of the library.  The original RTMP_Init
calls the new function, perfectly preserving the old behaviour while
adding a new reset function to address the issue with.

Fixes obsproject/obs-studio#2865
2021-01-31 18:44:11 -08:00
Jim
2eca4d80b6
Merge pull request #2233 from VodBox/missing-files-dialog
libobs + UI: Add Missing Files API & Dialog
2021-01-31 08:02:16 -08:00
Jim
1c99cad33d
Merge pull request #4140 from jpark37/wgc-monitor
Add display capture via Windows Graphics Capture
2021-01-31 07:10:57 -08:00
Jim
9eb32eed18
Merge pull request #4162 from jpark37/warnings-20210129
Another warning clean-up pass
2021-01-30 11:37:43 -08:00
jpark37
3d4e8c377c UI: Fix unused parameter 2021-01-30 00:25:25 -08:00
jpark37
48ba511bda UI: Avoid asprintf warning 2021-01-30 00:25:25 -08:00
jpark37
2c1610017d linux-v4l2: Fix ignored return value 2021-01-30 00:25:25 -08:00
jpark37
54047ef9ca libobs: Avoid strncpy warning 2021-01-30 00:24:16 -08:00
jpark37
5753c25cba libcaption: Fix static keyword placement 2021-01-29 23:59:23 -08:00
jpark37
033a29ef9a rtmp-services: Fix unused parameter 2021-01-29 21:50:51 -08:00
jpark37
0e803c4443 obs-filters: Fix unused parameters 2021-01-29 21:50:32 -08:00
jpark37
dd62bd05fb libobs-opengl: Fix unused parameters 2021-01-29 21:50:19 -08:00
jpark37
98d1f340da libobs: Fix unused parameter 2021-01-29 21:50:06 -08:00
jpark37
bd14c926eb libobs: Fix truncation warning on 32-bit Windows 2021-01-29 21:47:34 -08:00
Frank Löffler
8f3d4b6758 linux-v4l2: added range check for try_connect()
While the current code only ever calls try_connect() with the input
argument 'device' in the range of 0 and MAX_DEVICES, this adds a check
to ensure that future code does not break the following sprintf.

In addition, use snprintf instead of sprintf to ensure that if anything
breaks, the sprintf does not lead to memory corruption. Again, the new
check should already make sure of that, but the additional effort of
using snprintf instead of sprintf is so low that it is worth to have a
little more security in the future.
2021-01-29 09:24:42 -08:00
Kurt Kartaltepe
5efb10a5e2 libobs: Fix leaking obs-internal.h
Removes prior attempt to expose libcaption headers which really shouldnt
have public. This instead moves the obs-internal include out of the
public obs-scene.h and into it's implementation.
2021-01-28 23:59:02 -08:00
Georges Basile Stavracas Neto
f12dbc87b8 UI: Don't define QT_NO_GLIB
The same reasoning of the previous patch means we can also stop
force-disabling Qt/GLib integration.
2021-01-28 23:58:13 -08:00
Georges Basile Stavracas Neto
58497e59d9 UI: Reinstate native dialogs on Linux with browser enabled
After the recent CEF update, the GMainLoop-in-a-thread conflict seems to be
gone, which allows us to being back native dialogs.
2021-01-28 23:58:13 -08:00
Kurt Kartaltepe
c12ccd4e15 linux-capture: Ensure locks are initialized
In case no-one else initializes X11 locks do this as part of loading the
module.

Fixes #3479
2021-01-28 13:11:16 -08:00
Jeff Ward
4479ca0b7b rtmp-services: Add PolyStreamer service
Add PolyStreamer.com to services.json, and increment the version in
accompanying package.json
2021-01-28 13:06:28 -08:00
Kurt Kartaltepe
bde5d11100 libcaption: Fix header missing in install
libobs directly depends on libcaption headers. So ensure they are
installed with obs' headers.

fixes #3925
2021-01-28 12:55:11 -08:00
PatTheMav
d2ca8b5d90 CI: Re-enable Python scripting support on CI for macOS
Closes obsproject/obs-studio#3689
2021-01-27 11:33:53 -08:00
PatTheMav
ecdc81ba0f obs-scripting: Add Py 3.8+ C-API changes
Closes obsproject/obs-studio#3689
2021-01-27 11:33:34 -08:00
Exeldro
44ace7618f libobs: Duplicate source name for private sources
Allows for identification of sources in studio mode
2021-01-27 00:24:33 -08:00
jpark37
80b4a65cd2 win-capture: Add WGC desktop capture
Copy patterns from WGC window capture, and BitBlt monitor capture.
2021-01-26 17:11:12 -08:00
jpark37
2b652cc763 libobs: gs_duplicator_get_monitor_index
Helper function to find DXGI output index of HMONITOR.
2021-01-26 17:11:04 -08:00
Matt Gajownik
475172cffa CI: Enable service integration on Linux
This also simplifies environment variable definitions
2021-01-27 11:39:09 +11:00
jpark37
db35a022cd libobs-winrt,win-capture: Support desktop capture
Add display capture support via winrt_capture_init_monitor. Almost all
of the existing window capture code is reused.

Rename winrt_capture_init to winrt_capture_init_window for symmetry.
2021-01-26 15:57:20 -08:00
Matt Gajownik
84771b143c obs-browser: Fix panel build error on Windows and Linux 2021-01-27 10:31:20 +11:00
Matt Gajownik
a5c482dd19 CI: Use CEF 4280 on GH Actions builds 2021-01-27 10:11:41 +11:00
Matt Gajownik
482a8adaf3 obs-browser: Fix panel build error on macOS 2021-01-27 10:07:19 +11:00
Matt Gajownik
ba546ee79c obs-browser: Add Linux browser panel support 2021-01-27 09:40:33 +11:00
Georges Basile Stavracas Neto
913821ee8e UI: Make BrowserDock native
After cleaning up the native flags in various places, and disabling
making sibling of native widgets native, BrowserDock was left in an
inconsistent state, since it requires being native for CEF to work
properly.

Make BrowserDock native.
2021-01-26 09:43:16 -08:00