Commit graph

2104 commits

Author SHA1 Message Date
Cameron Gutman
db06239018 Rewrite the macOS renderer using CAMetalLayer
This allows v-sync to be disabled on macOS and lets us remove a whole bunch of old hacks.

Further optimizations of the new renderer are still needed.
2024-02-07 02:40:35 -06:00
boogie
bdc7d53515 Only give "pixel_format=nv12" option to v4l2m2m or v4l2requests decoders
pixel_format is a global option which changes avctx->pix_fmt to the
given format, and overrides the AV_PIX_FMT_DRM_PRIME requirement of a
decoder. So v4l2 out of tree patches has done some exception which is
not perfectly nice, therefore limit this option only if the given
decoder is v4l2 decoder. Otherwise rockchip mpp based ffmpeg decoders
can not work properly
2024-02-06 00:09:34 -06:00
Cameron Gutman
3d8de56f25 Add fast AES detection for RISC-V using hwprobe() syscall 2024-01-23 02:28:28 -06:00
Cameron Gutman
8bbc9b2c57 Fix build with old ARM headers and opt-out of fast AES on RISC-V for now 2024-01-15 17:36:57 -06:00
Cameron Gutman
be7694dd8b Improve fast AES heuristic for Linux ARM and unknown platforms 2024-01-15 14:16:56 -06:00
Cameron Gutman
ce8b24dfa7 Implement fast AES detection logic for Windows and macOS 2024-01-15 13:40:13 -06:00
Cameron Gutman
75ddac54c5 Update moonlight-common-c with new encryption features 2024-01-15 13:35:39 -06:00
Cameron Gutman
b01a83ff39 Send pen input as pen events on Windows 2024-01-12 23:40:24 -06:00
Cameron Gutman
c3e886fbcc Use drmIoctl() instead of bare ioctl() to handle EINTR/EAGAIN 2024-01-05 18:33:17 -06:00
Cameron Gutman
e20d56041e Fix rare race condition in overlay update code 2023-12-31 15:21:18 -06:00
Cameron Gutman
114074bfd8 Don't set HDR metadata on the DXGI swapchain
This is no longer recommended by Microsoft due inconsistencies with display support for HDR metadata.
2023-12-31 15:15:06 -06:00
Cameron Gutman
03663d5552 Fix integer promotion issue in gamepad state merging 2023-12-29 16:06:53 -06:00
Cameron Gutman
dce2a857f7 Merge all gamepad state when in single controller mode 2023-12-28 16:28:40 -06:00
Cameron Gutman
61f71a318e Expose PLVK_DEBUG_EXTRA for enabling extra debug layers 2023-12-27 15:40:01 -06:00
Cameron Gutman
646ce2bf66 Handle occlusion of the Vulkan window without recreating the renderer over and over 2023-12-27 15:36:59 -06:00
Cameron Gutman
2bbae90e2c Revert "Unconditionally override host-reported minimum luminance value"
This reverts commit 770872238d.
2023-12-26 15:46:25 -06:00
Cameron Gutman
bb8e229814 Swap buffers in waitToRender() instead of renderFrame() 2023-12-26 15:45:31 -06:00
Cameron Gutman
9ed8252cc6 Display error codes when the connection is terminated 2023-12-22 14:12:59 -06:00
Cameron Gutman
2cef09471b Remove manual hwframe ctx setup for D3D11VA
It was apparently never necessary, since FFmpeg's default behavior of
avcodec_get_hw_frames_parameters() + av_hwframe_ctx_init() makes a
context that exactly matches the one we constructed manually.
2023-12-22 02:45:11 -06:00
Cameron Gutman
2d15382e31 Fix libplacebo renderer build on Windows 2023-12-21 18:12:19 -06:00
Cameron Gutman
770872238d Unconditionally override host-reported minimum luminance value 2023-12-18 16:43:17 -06:00
Cameron Gutman
2a05b890d8 Enable transparent resizing and display changes for supported renderers 2023-12-17 21:15:40 -06:00
Cameron Gutman
481f23b6e9 Remove some dependencies on fixed window and frame sizes 2023-12-17 20:39:26 -06:00
Cameron Gutman
4e7107a09e Use the crop rect from the pl_frame instead of the raw AVFrame dimensions 2023-12-17 19:06:56 -06:00
Cameron Gutman
0223394725 Fix manual codec options when using Vulkan for HDR
For now, we can't switch between GL and Vulkan on a single window, so performing decoder
probes with 8-bit formats may activate EGLRenderer which breaks Vulkan on our window.

It also speeds up stream launch validation for HDR cases in general, since we don't
perform unnecessary decoder probes for 8-bit profiles when the user wanted 10-bit.
2023-12-17 18:53:13 -06:00
Cameron Gutman
058739321c Move vkAcquireNextImageKHR() into waitToRender() so it can overlap with new frame arrival 2023-12-17 16:47:38 -06:00
Cameron Gutman
708bec2937 Rewrite Vulkan device selection logic to handle multi-GPU systems better 2023-12-17 15:46:10 -06:00
Cameron Gutman
c939537c5c Synchronize swapchain and pl_frame colorspace values 2023-12-16 17:36:02 -06:00
Cameron Gutman
9497657c83 Fix handling of zero minimum HDR luminance 2023-12-16 17:28:35 -06:00
Cameron Gutman
d4050f3a4f Add HDR metadata to each AVFrame 2023-12-16 17:02:53 -06:00
Cameron Gutman
c74c4ef041 Fix native Vulkan video decoding (non-imported frames) 2023-12-16 16:21:54 -06:00
Cameron Gutman
d75663052d Fix a few minor Vulkan renderer bugs 2023-12-16 16:18:19 -06:00
Cameron Gutman
6a58dbb05e Disable 10-bit SDR swapchains on Vulkan due to inconsistent dithering behavior 2023-12-14 17:46:06 -06:00
Cameron Gutman
8aeb976128 Require a test frame for Vulkan video decoding 2023-12-14 17:44:58 -06:00
Cameron Gutman
7d51a4b67d Fix incorrect overlay colors in Vulkan renderer 2023-12-14 17:43:54 -06:00
Cameron Gutman
ee95efc0f1 Improve Vulkan renderer debuggability 2023-12-13 01:08:32 -06:00
Cameron Gutman
3ddc8ad68a Fix crash if pl_vulkan_create() fails 2023-12-13 01:04:54 -06:00
Cameron Gutman
333d97160e Add opt-in for Vulkan rendering for SDR content with PREFER_VULKAN=1 2023-12-13 01:03:27 -06:00
Cameron Gutman
aac5ad3fd0 Add a libplacebo-based Vulkan renderer for HDR and Vulkan video decoding support
Vulkan H.264/HEVC video decoding isn't supported with Fedora's Mesa binaries due to
patent issues, so only the VAAPI/DRM-PRIME import path was tested locally with ANV.

HDR video is getting tonemapped to my SDR monitor reasonably, so HDR output probably
works with GameScope but I haven't confirmed yet.

See #1117
2023-12-12 23:54:23 -06:00
Cameron Gutman
1ef083c952 Update moonlight-common-c to remove per-codec bitrate adjustments 2023-12-03 22:21:10 -06:00
Cameron Gutman
c63b918bb2 Don't hardcode the server signature length 2023-11-29 21:53:49 -06:00
Cameron Gutman
3cb169ea26 Fix CUDA build without KMSDRM enabled 2023-11-01 22:49:18 -05:00
Cameron Gutman
58f87e39a9 Prepare for v5.0.1 2023-11-01 21:49:03 -05:00
Cameron Gutman
7ea118fbae Fix dark mode on Windows with Qt 6.5+ 2023-11-01 20:30:34 -05:00
Cameron Gutman
2149024c35 Rerun lupdate and lrelease 2023-11-01 20:02:40 -05:00
Cameron Gutman
f5d71c8c9a Merge remote-tracking branch 'origin/weblate' 2023-11-01 20:01:25 -05:00
Cameron Gutman
ea8bccd508 Fix typo causing libva-drm only to be enabled if libva-wayland is present 2023-11-01 17:39:24 -05:00
maicolbattistini
bca919c48c
Translated using Weblate (Italian)
Currently translated at 100.0% (215 of 215 strings)

Translation: Moonlight Game Streaming/moonlight-qt
Translate-URL: https://hosted.weblate.org/projects/moonlight/moonlight-qt/it/
2023-10-21 04:13:46 +00:00
Jorys Paulin
511ffe03b5
Translated using Weblate (French)
Currently translated at 100.0% (215 of 215 strings)

Translation: Moonlight Game Streaming/moonlight-qt
Translate-URL: https://hosted.weblate.org/projects/moonlight/moonlight-qt/fr/
2023-10-21 04:13:45 +00:00
Cameron Gutman
413993ab6f Bump release date in appstream 2023-10-18 00:45:10 -05:00
Cameron Gutman
948b9c818a Add workarounds for some SDL joystick index issues 2023-10-18 00:42:59 -05:00
Cameron Gutman
089c3d3ad3 Prepare for v5.0.0 2023-10-16 19:04:40 -05:00
Cameron Gutman
63e3fa6609 Disable ATS 2023-10-16 18:13:13 -05:00
Cameron Gutman
989a90a0f7 Rerun lupdate and lrelease 2023-10-15 20:30:46 -05:00
Cameron Gutman
a707720577 Merge remote-tracking branch 'origin/weblate' 2023-10-15 20:28:04 -05:00
Cameron Gutman
eef270de26 Fix HDR with external displays on macOS Sonoma
Fixes #1079
2023-10-15 15:30:41 -05:00
Cameron Gutman
0ac765bc32 Revert SDL audio buffer size on macOS to v4.3.1 value
Fixes #1071
2023-10-15 13:17:00 -05:00
Cameron Gutman
e76551cb64 Use the PC name alone as the streaming window title on macOS 2023-10-15 13:15:38 -05:00
Cameron Gutman
9cba449092 Add config option to allow EGL usage when built with MMAL 2023-10-15 13:03:47 -05:00
Cameron Gutman
905b2ecf9e Change AV1 bitrate multiplier to match HEVC 2023-10-15 12:51:23 -05:00
Cameron Gutman
53c2c612c9 Add Share+PS combo for clickpad button emulation on PS4/5 controllers 2023-10-14 01:46:50 -05:00
Jorys Paulin
f569bf633c
Translated using Weblate (French)
Currently translated at 100.0% (215 of 215 strings)

Translation: Moonlight Game Streaming/moonlight-qt
Translate-URL: https://hosted.weblate.org/projects/moonlight/moonlight-qt/fr/
2023-10-13 12:01:28 +02:00
Cameron Gutman
6eb5e07007 Fix warnings in 32-bit builds 2023-10-12 19:05:52 -05:00
Cameron Gutman
9120fd01a8 Adjust MMAL and RPi workarounds for Pi 5 and Bookworm support 2023-10-12 18:46:11 -05:00
Cameron Gutman
c14cc70a6a Also check for V3D compatible IDs 2023-10-08 16:52:54 -05:00
Cameron Gutman
7e4fddbe62 Only block EGL rendering on Pi 4 and earlier
Hopefully Pi 5 is powerful enough to at least render 1080p 60 FPS.
2023-10-08 16:16:33 -05:00
Cameron Gutman
2127e1d90b Allow h264_v4l2m2m to be used in RPi builds if manually specified 2023-10-05 18:37:14 -05:00
Cameron Gutman
9d73aa6b4a Fix DrmRenderer not falling back to swframes if DRM PRIME is available 2023-10-05 18:13:52 -05:00
Cameron Gutman
a2f23b7053 Fix automatic VA DRM driver selection with libva 2.20 2023-10-05 18:12:12 -05:00
Cameron Gutman
5974980aff Use BT.709 in DrmRenderer only on Starfive devices 2023-10-05 18:10:36 -05:00
Cameron Gutman
6fa53691aa Fix implicit default constructor warning 2023-10-02 17:42:35 -05:00
Cameron Gutman
49e0679864 Synchronize with possible concurrent writers to the NvComputer object 2023-10-01 17:46:27 -05:00
Cameron Gutman
0976bc39b3 Only reserialize hosts if a serializable attribute changed 2023-10-01 17:28:06 -05:00
Cameron Gutman
facd6e4e56 Revert "Batch delayed flushes to improve performance on macOS"
This reverts commit aa74e6930b.
2023-10-01 16:33:14 -05:00
Cameron Gutman
d2dc0aa1b1 Don't serialize apps for the host backup
This takes a ton of time on macOS and most of the data is just a local cache anyway
2023-10-01 16:13:22 -05:00
Cameron Gutman
aa74e6930b Batch delayed flushes to improve performance on macOS 2023-10-01 15:26:28 -05:00
Jorys Paulin
b7811bf196
Translated using Weblate (French)
Currently translated at 100.0% (215 of 215 strings)

Translation: Moonlight Game Streaming/moonlight-qt
Translate-URL: https://hosted.weblate.org/projects/moonlight/moonlight-qt/fr/
2023-10-01 10:59:44 +00:00
Cameron Gutman
18130fd8de Use BT.601 for planes that lack COLOR_ENCODING properties 2023-09-29 18:30:39 -05:00
Cameron Gutman
b6d4f97e96 Check that the chosen plane supports the decoded frame pixel format 2023-09-29 17:22:49 -05:00
Cameron Gutman
0dd0112518 Don't export EGLImages for software frames 2023-09-29 17:20:50 -05:00
Cameron Gutman
5711e6064e Allow reuse of an active plane for devices with only one usable plane per CRTC 2023-09-29 17:19:44 -05:00
Cameron Gutman
517b684f85 Handle EGL driver returning no supported formats or modifiers for DMA-BUF import 2023-09-27 01:31:01 -05:00
Cameron Gutman
39465f6d8a Override some Material 3 colors to improve contrast 2023-09-27 00:51:51 -05:00
Cameron Gutman
738813cbac Add fallback definition for EGLuint64KHR 2023-09-26 23:22:25 -05:00
Cameron Gutman
c2778e040a Build fix for old EGL headers 2023-09-26 23:16:22 -05:00
Cameron Gutman
1efdeeb9dc Export composed VA surface layers for EGL import if supported
Importing composed formats is more efficient and performant because it allows
tiled and/or compressed surfaces to be directly sampled by shaders without
requiring a conversion to a linear planar format first.
2023-09-26 22:58:13 -05:00
Cameron Gutman
b01dfea343 Refactor EGLImage creation into a separate shared class 2023-09-26 21:03:19 -05:00
Cameron Gutman
e143293e91 Update our plist to activate Game Mode on Sonoma 2023-09-26 18:28:14 -05:00
Cameron Gutman
f420dc740a Set EGL_IMAGE_PRESERVED_KHR=EGL_TRUE on our EGLImages
They're mapped read-only and may be saved internally as reference frames,
so they must not be modified by the EGL implementation.
2023-09-26 02:38:46 -05:00
Jen Kung-chih
2e532224b7
Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (215 of 215 strings)

Translation: Moonlight Game Streaming/moonlight-qt
Translate-URL: https://hosted.weblate.org/projects/moonlight/moonlight-qt/zh_Hant/
2023-09-24 19:59:50 +00:00
Jorys Paulin
cb8366a7e5
Translated using Weblate (French)
Currently translated at 100.0% (215 of 215 strings)

Translation: Moonlight Game Streaming/moonlight-qt
Translate-URL: https://hosted.weblate.org/projects/moonlight/moonlight-qt/fr/
2023-09-24 19:59:49 +00:00
Cameron Gutman
dc556d3c9b Try to fix Windows build 2023-09-23 13:33:21 -04:00
Cameron Gutman
4fed3802aa Fix signed vs unsigned comparison warning 2023-09-23 11:15:41 -04:00
Cameron Gutman
f7bb4611e9 Replace uses of strcpy() and sprintf() 2023-09-23 11:15:21 -04:00
Artur Szulc
57791eec62
Translated using Weblate (Polish)
Currently translated at 100.0% (215 of 215 strings)

Translation: Moonlight Game Streaming/moonlight-qt
Translate-URL: https://hosted.weblate.org/projects/moonlight/moonlight-qt/pl/
2023-09-22 20:59:07 +00:00
Cameron Gutman
654be492a0 Avoid using LFS64 interfaces with Musl 2023-09-18 20:07:56 -05:00
Cameron Gutman
1df0da4d4a Also use test frame decoding parameters when creating a test renderer 2023-09-14 18:21:53 -05:00
Cameron Gutman
1dd6cdb567 Use the correct width and height of the test frame when performing the test decode
Using the stream resolution instead of the test frame resolution was causing all non-720p streams to fail on the VisionFive 2 board with the wave5 driver.

It also likely fixes a similar interoperability issue with the qcom-venus driver that was reported in #1042
2023-09-14 18:16:45 -05:00
Cameron Gutman
c6a8f44640 Don't set currentIndex to -1 while reinitializing
It causes warnings in other code that have property bindings to currentIndex
2023-09-12 19:28:33 -05:00
Cameron Gutman
b7301d4415 Rerun lupdate and lrelease 2023-09-12 19:19:31 -05:00