Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[WIP] libobs-opengl: Support Wayland-EGL #2097
Enables support for EGL on wayland as a libobs-opengl backend. It supports swapping between the X11/Wayland backends on Unix-like platforms. This is for the rendering backend only, it doesn't cover the capture plugins.
Motivation and Context
Qt already supports an environment variable to change backends at program startup, by setting
How Has This Been Tested?
I test on Ubuntu Disco with an Intel i915. The wayland compositors I've tested with are Weston, Sway, Mutter (GNOME), and KWin (KDE). It works in Weston and Sway, but there are issues in the others:
Note that currently this PR is not ready to merge because of those issues. It's not clear to me yet if those are bugs in OBS, in Qt, or in those compositors. Since it works fine in Weston, it leads me to believe that those are compositor issues. If you're using Sway or another wlroots compositor then you can use this PR as-is before it's merged.
I've also tested this on my machine X11 in GNOME, KDE, and with i3 to make sure nothing broke there. I have not tested on any BSDs. Some of the general backend code was touched, so this should also be tested on the non-Unix platforms to make sure nothing broke. I have not tested on Windows or MacOS.
Types of changes
New feature: Support wayland as a rendering backend.
Enable swapping between X11/GLX and Wayland/EGL backends on Unix-like platforms. The backend can be chosen manually by setting the QT_QPA_PLATFORM environment variable to "xcb", or "wayland-egl".
Personally, a different name should be chosen for libobs/obs-nix, and libobs/obs-x11 should be
Also for the sake of reviewers it may be best to split this into two commits. 1 libobs modification to create a runtime platform layer only supporting existing platforms. And the 2nd commit adding in the wayland platform layer.
I pulled the branch, rebased upstream/master (needed for the caption fix) and seems to be working alright for me. Debian unstable.
That said, I'm still seeing quite a few of these in the console log.
If you need/want any help, I'd love to see this merged.
There's also EGL context creation in this PR: #1758
I like that you can select GLX/EGL at run-time with this PR, rather than it being a compile-time option. I'm a little intimidated by the