100 Commits
Author SHA1 Message Date
Cameron Gutman 231a67946d WIP SDL3 compatibility 2025-01-31 01:13:17 -06:00
Cameron Gutman 5290305944 Abstract SDL success/failure checks inside a compat macro 2025-01-30 23:36:46 -06:00
Cameron Gutman 3a22a01aef Move window event handling into separate functions 2025-01-30 22:58:02 -06:00
Cameron Gutman d1f3b98a1f Abstract window creation into compat function 2025-01-30 22:41:44 -06:00
Cameron Gutman a37020b974 Abstract fullscreen details into SDLC functions 2025-01-30 22:41:44 -06:00
Cameron Gutman 13b2b28c2f Abstract SDL_SysWM into compat functions 2025-01-30 22:41:40 -06:00
Cameron Gutman dd2a99a96b Prepare for SDL3 support 2025-01-25 16:20:20 -06:00
Cameron Gutman edd7a134d8 Fix MSVC binary path in CI for Qt 6.8 2025-01-13 20:11:06 -06:00
Cameron Gutman ffa87c5f01 Update Windows AppVeyor builds to Qt 6.8 2025-01-13 19:48:47 -06:00
Cameron Gutman 15e337fff8 Only call SDL_NumJoysticks() once per loop
It does non-trivial work when using sdl2-compat.
2024-11-12 23:52:31 -06:00
Cameron Gutman 707dd3cb83 Checkout libs submodule for Steam Link too 2024-11-08 21:32:32 -06:00
Cameron Gutman 98f6a09991 Use a Ne10-optimized libopus build for Steam Link
Steam Link is an incredibly CPU-constrained platform, so it needs
all the help it can get to avoid audio underruns.
2024-11-08 21:26:45 -06:00
Cameron Gutman 103f988dbf Move logging into a separate thread 2024-10-20 21:52:15 -05:00
Cameron Gutman 2257cb0cef Update Windows, macOS, and AppImage libraries
SDL -> 86fd4ed
FFmpeg -> 7.1 (87ccf995c)
dav1d -> 1.5.0
2024-10-20 13:46:05 -05:00
Cameron Gutman b6a3369243 Rework window focus tracking for gamepad navigation 2024-10-18 21:20:56 -05:00
Cameron Gutman 4af9623727 Replace C++ VLAs with std::vector 2024-10-15 22:41:21 -05:00
Cameron Gutman 515db03fe5 Add missing stdbool.h include 2024-10-15 22:38:06 -05:00
Cameron Gutman 9936085aee Fix incorrect selection if pix_fmt is overridden before ffGetFormat()
The DRM renderer does this for the out-of-tree v4l2m2m patches to ensure
we get NV12 buffers, but it ends up clobbering our own preference for
DRM_PRIME frames in the process.
2024-10-03 20:28:51 -05:00
Cameron Gutman 3279d9c3f6 Fix QML component versioning error on Qt 5 2024-10-03 00:15:53 -05:00
Cameron Gutman 3531fe0a4f Fix typo in version check for new Vulkan queue API 2024-10-02 00:37:22 -05:00
Cameron Gutman 6ce02616f0 Use new Vulkan queue API in FFmpeg 7.1 2024-09-29 23:04:23 -05:00
Cameron Gutman 13880353d8 Use new avcodec_get_supported_config() API in FFmpeg 7.1 2024-09-29 22:23:37 -05:00
Cameron Gutman ec69dad8d7 Fix import incorrectly removed by 2a63ad5 2024-09-28 00:09:21 -05:00
Cameron Gutman 72ae324d71 Fix unused parameter warnings 2024-09-28 00:08:35 -05:00
Cameron Gutman 901cbd255c Disable Vulkan debug layers by default
The vast majority of Vulkan code running in Moonlight
is part of FFmpeg or libplacebo, so the debug layers
really just slow things down without finding any bugs
in our code.

Additionally, there are some overzealous checks firing
constantly on libplacebo and FFmpeg with certain Vulkan
drivers that we can't do anything about.
2024-09-28 00:05:17 -05:00
Cameron Gutman 2a63ad53d7 Don't poll gamepad input when the GUI is not focused/visible 2024-09-26 19:24:29 -05:00
Cameron Gutman 9b3d4c1ad7 Free the old CRTC connectors array 2024-09-23 22:25:51 -05:00
Cameron Gutman 054e334066 Allow Qt to borrow DRM master from SDL to update the UI 2024-09-23 22:15:31 -05:00
Cameron Gutman 6d023c2dfa Defer launch warnings until after launch validation
We need to destroy the SDL window before we can be sure that Qt
can draw to the screen if we used KMSDRM.
2024-09-23 21:48:43 -05:00
Cameron Gutman 0e2d5bf441 Fix EGLFS state restoration after Vulkan rendering 2024-09-23 21:32:09 -05:00
Cameron Gutman 023b6b2772 Fix DRM FD leak with Vulkan windows 2024-09-21 21:41:43 -05:00
Cameron Gutman 6f39d120cb Unify handling of DRM devices between DRM and VAAPI
SDL may not be able to give us a DRM FD for Vulkan windows.
2024-09-21 20:46:11 -05:00
Cameron Gutman 9cf305865b Add support for managing multiple SDL DRM FDs
This is required for Vulkan+KMSDRM rendering.
2024-09-21 20:41:43 -05:00
Cameron Gutman 6b11f43302 Don't set the output rect until after modesetting
It's possible that modesetting will also change the resolution
not just the refresh rate. This can happen in cases where the
CRTC is currently set to 4K 30 Hz and we choose 1080p 60 Hz as
a better mode match for displaying a 1080p 60 FPS stream.
2024-09-19 22:43:34 -05:00
Cameron Gutman 5a1ef55767 Update README.md
Add note about YUV 4:4:4 and update build requirements
2024-09-18 22:16:33 -05:00
Cameron Gutman f786e94c7b Fix excessive latency with Vulkan video decoding on Nvidia
For yet unknown reasons, high frame queue delay leads to massive decode latency.
2024-09-16 21:59:17 -05:00
Cameron Gutman 1caee721e8 Prepare for v6.1.0 2024-09-16 18:36:50 -05:00
Cameron Gutman accd30176f Rerun lupdate and lrelease 2024-09-15 23:45:27 -05:00
Cameron Gutman 7721fa6d7c Merge remote-tracking branch 'origin/weblate' 2024-09-15 23:44:31 -05:00
Cameron Gutman 8e295aab00 Update dependencies for AppImage
SDL -> 1b26b5440
2024-09-15 23:35:26 -05:00
Cameron Gutman 4838a75c58 Suppress spammy libplacebo messages
Streaming 10-bit content on Nvidia GPUs spams the log with the following for every rendered frame:
Masking `blit_src` from wrapped texture because the corresponding format 'rx10' does not support PL_FMT_CAP_BLITTABLE
Masking `blit_src` from wrapped texture because the corresponding format 'rxgx10' does not support PL_FMT_CAP_BLITTABLE
2024-09-15 22:01:39 -05:00
Cameron Gutman c5ec8c0fdb Add libplacebo prefix to log messages 2024-09-15 21:58:19 -05:00
Cameron Gutman b266f61ba6 Disable direct rendering of YUV444 using vaPutSurface()
It doesn't work as of libva 2.21 + iHD 24.2.5 despite the fact that
the VAEntrypointVideoProc advertises VA_RT_FORMAT_YUV444.
2024-09-15 21:03:00 -05:00
Cameron Gutman d1dffdc34c Prefer optimal 8-bit hardware codec if 10-bit codec is not available 2024-09-15 16:47:30 -05:00
Cameron Gutman 268f8db26b Never negotiate 10-bit profiles without a 10-bit renderer 2024-09-15 15:53:45 -05:00
Cameron Gutman de28eda266 Don't enable HDR checkbox if no HDR renderers work 2024-09-15 15:09:11 -05:00
Cameron Gutman 3e9e497203 Fix viewing apps and CLI streaming with Qt 5.11 and earlier
Arrow function expressions are not supported in QML until Qt 5.12.

Fixes #1350
Closes #1391
2024-09-15 14:39:34 -05:00
Cameron Gutman 96fb6ee5e9 Share SDL's EGL display with EGLRenderer
Fixes #1396
2024-09-12 22:37:25 -05:00
Cameron Gutman 02853e74ba Reduce the bitrate to YUV420 defaults if YUV444 was selected but not negotiated
If the user has selected a custom bitrate, we will leave it alone.
2024-09-12 21:52:27 -05:00
Cameron Gutman 46910cf774 Remove black background workaround now that SDL is fixed 2024-09-12 21:38:30 -05:00
Cameron Gutman b1c77ff80e Disable SDL double buffering
It was broken in SDL until recently and now that it works again, it causes stuttering.
2024-09-12 21:34:22 -05:00
Cameron Gutman 92ee4a3046 Don't use the bind path for UMA GPUs
It turns out to be very marginally slower on RDNA2 iGPUs.
2024-09-12 21:32:36 -05:00
Cameron Gutman 6ec0c79899 Revert "Remove FL 11.0 restriction for D3D11VA"
Even with a fix for the Intel IVB rendering issue, there are still problems on
other older cards that make it not really worth it to enable D3D11VA.

The big benefit of D3D11VA is independent flip in windowed mode using
overlays and that isn't supported on those old cards anyway.

This reverts commit 7074463d0f.
2024-09-12 21:29:40 -05:00
Cameron Gutman 67e89d9e16 Add workaround for incorrect color range in AMF AV1 encoding output 2024-09-04 23:13:48 -05:00
Cameron Gutman 34549864ad Update libraries
SDL2 -> 10b4a79
OpenSSL -> 3.3.2

Should address #1081 with upstream SDL fix
2024-09-03 23:18:12 -05:00
Cameron Gutman 25132a1f7b Enable decoder texture binding for all FL11.1 iGPUs
Since those GPUs don't benefit from the fence hack, restrict that to Intel only.
2024-08-31 00:36:25 -05:00
Cameron Gutman 7074463d0f Remove FL 11.0 restriction for D3D11VA 2024-08-30 23:03:36 -05:00
Cameron Gutman 99311403fa Move dummy fence into renderVideo()
The workaround only seems to work with a new fence each time.
2024-08-30 22:42:53 -05:00
Cameron Gutman 8b50eea485 Wait on a dummy fence before using textures shared with the decoder 2024-08-30 22:22:30 -05:00
Cameron Gutman 302dca6c0c Update OpenSSL libraries for macOS with fixed library path 2024-08-30 16:32:31 -05:00
Cameron Gutman f756be87ff Fix YUV444 hardware decoding on Windows systems without an Intel GPU present 2024-08-30 16:31:58 -05:00
Cameron Gutman 9d99ecbca6 Add note about installing the Graphics Tools optional feature 2024-08-30 16:23:31 -05:00
Cameron Gutman 69a3406d4a Fix broken PDBs for libplacebo.dll 2024-08-30 00:08:02 -05:00
Cameron Gutman 7e17d82ee5 Add a NSLocalNetworkUsageDescription for Sequoia 2024-08-29 23:31:55 -05:00
Cameron Gutman 153db55519 Replace OpenSSL static libs with dylibs to enable Qt OpenSSL TLS plugin
SecureTransport is deprecated, stuck on TLS 1.2, and seems prone to
random breakage in OS updates (see #1355).
2024-08-29 23:28:08 -05:00
Cameron Gutman 4290a54ffa Log the chosen Metal device 2024-08-29 23:20:52 -05:00
Cameron Gutman a6e549471c Ignore failures when registering firewall exceptions
There appear to be bugs in the WiX firewall extension that causes errors on
install/upgrade in some scenarios (seemingly where existing fw exceptions for
Moonlight exist as in #1309).

Since a firewall exception really only provides minimal benefits for us in the
default configuration of Windows Firewall (outgoing: allow, incoming: deny) due
to WFP's stateful treatment of solicited unicast/multicast UDP traffic, let's
allow it to silently fail and not abort the whole installation.
2024-08-29 02:14:04 -05:00
Cameron Gutman 04edfdc4ca Update to WiX 5.0.1 2024-08-29 01:50:53 -05:00
Cameron Gutman db30faf602 Enable Turkish language now that it's nearly completely translated 2024-08-29 01:40:13 -05:00
Cameron Gutman cdb610f121 Rerun lupdate and lrelease 2024-08-29 01:39:09 -05:00
Cameron Gutman e404722e7c Add Estonian translation 2024-08-29 01:37:09 -05:00
Cameron Gutman 1840c47751 Merge remote-tracking branch 'origin/weblate' 2024-08-29 01:24:36 -05:00
Cameron Gutman ef12850867 Remove unnecessary Windows dependencies 2024-08-29 01:22:41 -05:00
Cameron Gutman caf322d934 Provide valid default preferred formats for YUV444 2024-08-29 01:03:39 -05:00
Cameron Gutman 9043e8f663 Remove hard limits for bitrate and FPS command-line options 2024-08-25 16:18:55 -05:00
Cameron Gutman 76fd502262 Reintroduce support for FFmpeg 4
Some SBCs still depend on patched FFmpeg 4.x builds for hardware acceleration.
2024-08-24 16:50:27 -05:00
Cameron Gutman 9186feca80 Slightly simplify Metal shader 2024-08-22 01:18:39 -05:00
Cameron Gutman df814fef4a Implement support for HDR with software decoding on macOS 2024-08-22 00:05:26 -05:00
Cameron Gutman d2b3bc962f Probe for a HDR-compatible software renderer 2024-08-20 23:03:41 -05:00
Cameron Gutman 876375f7e9 Add additional codec negotiation improvements
- Fix picking incompatible YUV444 codec if software decoding was forced
- Prefer AV1 over HEVC when using HDR with software decoding
- Display software decoding warning when using an HDR codec without hardware decoding
2024-08-20 23:03:09 -05:00
Cameron Gutman e662e93a53 Prioritize AV1 over HEVC for HDR with software decoding
dav1d is much faster than FFmpeg's HEVC decoder
2024-08-20 01:30:33 -05:00
Cameron Gutman 7c6954b5f6 Add HDR support with software decoding using libplacebo
Not supported on macOS yet.
2024-08-20 01:28:00 -05:00
Cameron Gutman 416003248b Enable Vulkan renderer on Windows ARM64 builds 2024-08-20 00:43:03 -05:00
Cameron Gutman 6d6cd6fc35 Improve codec autoselection logic
- Deprioritize codecs that don't have hardware decoding rather than rejecting them outright
- Allow AV1 to be negotiated with autoselection if no other codec is available
- Take into account YUV444 preference when picking an optimal codec
- Arrange codec preference in ascending order of computational complexity when hardware decoding is unavailable
2024-08-19 23:41:42 -05:00
Cameron Gutman 17448c02b0 Move host settings to the other column to balance column length 2024-08-19 21:44:52 -05:00
Cameron Gutman f3a75e8e76 Add experimental option to unlock bitrate to 500 Mbps
Fixes #1375
Fixes #1343
Closes #1377
2024-08-19 21:43:00 -05:00
Cameron Gutman 7da085480c Switch to a vanilla 7.0 branch with the Nvidia video decoding fix cherry-picked
moonlight_7_0_2 has out-of-tree V4L2 patches that fail to build with the old libdrm headers in Focal.
2024-08-19 21:03:23 -05:00
Cameron Gutman bed3a6ecd8 Print the friendly name of the unsupported AVPixelFormat in SDLRenderer 2024-08-19 20:58:45 -05:00
Cameron Gutman e01c42153c Allow software decoding if YUV444 is selected rather than falling back to YUV420 2024-08-19 20:58:16 -05:00
Cameron Gutman 9df65cb814 Allow selection of AV1 or HEVC for software decoding when HDR or YUV444 are enabled
These advanced features often/always are only supported with AV1 or HEVC.
2024-08-19 20:57:11 -05:00
Cameron Gutman fddb4881fb Use our FFmpeg fork for the AppImage to fix Nvidia Vulkan decoding crash
Hopefully the required patch will be picked to release/7.0 soon
2024-08-19 19:42:21 -05:00
Cameron Gutman 5765c254cd Add software fallback for YUV444 using libswscale 2024-08-19 19:20:17 -05:00
Cameron Gutman ea724a05a6 Fix compilation with older FFmpeg versions 2024-08-19 01:03:03 -05:00
Cameron Gutman 369f614b59 Rewrite format handling in DRM renderer 2024-08-19 00:57:07 -05:00
Cameron Gutman 8606b2c95e Add support for VUYX and XV30LE for YUV 4:4:4 2024-08-18 23:45:26 -05:00
Cameron Gutman fafddddfe0 Fix size and pitch calculation for dumb buffer uploads 2024-08-18 23:08:20 -05:00
Cameron Gutman 1bb16be183 Allow DrmRenderer to act as a non-DRM hwaccel backend
This case basically works like a degenerate case of a DRM hwaccel
without DRM master where we just provide EGL export functionality
except that we don't even need a DRM FD in this case.

There are patches floating around the FFmpeg list for this:
https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=12604
2024-08-17 17:04:30 -05:00
Cameron Gutman 8e2aa87c4f Avoid using D3D11VA on very old Intel GPUs
Fixes #1348
Fixes #1381
2024-08-16 00:32:46 -05:00
Cameron Gutman 28b4272123 Update Windows FFmpeg to 7.0.2 with patches
- Vulkan video decoding crash fix for Nvidia GPUs
- D3D11VA support for HEVC 4:4:4 on Intel GPUs
2024-08-15 22:55:37 -05:00
Cameron Gutman 19660174b7 Check that the new keypair is usable before persisting it 2024-08-15 22:50:49 -05:00