Commit Graph

373 Commits

Author SHA1 Message Date
Cameron Gutman
5020fc6f48 Do not reset the renderer on SDL_RENDER_TARGETS_RESET
We only need to do this on a SDL_RENDER_DEVICE_RESET where we lose the whole device.

This also reverts a56efe5 since this change is not needed when handling the reset events properly.
2026-01-31 13:00:23 -06:00
Cameron Gutman
a56efe5c36 Fix infinite renderer resets on SDL3 using direct3d renderer 2026-01-30 20:39:53 -06:00
Cameron Gutman
6d5b9e4706 Remove Windows dark mode hack since SDL3 supports it natively 2026-01-30 19:57:11 -06:00
Cameron Gutman
792f762c15 Standardize on QString::toUtf8() 2026-01-26 21:49:08 -06:00
Cameron Gutman
d484ec3ac8 Fix Clazy range-loop-detach warnings 2026-01-26 21:49:08 -06:00
Cameron Gutman
c5960c3e15 Always use display scaling with the KMSDRM video driver 2025-12-30 15:39:32 -06:00
Cameron Gutman
b48cbd76f5 Fix implicit fallthrough warning 2025-12-30 15:32:15 -06:00
Cameron Gutman
ceef792f04 Use display scaling to improve performance on slow GPUs
This dramatically improves performance for lower resolution
streams on slow GPUs when using the GL and Vulkan renderers.
2025-12-30 15:00:47 -06:00
Cameron Gutman
41ad3c0938 Add environment variable override helper function
This allows FORCE_QT_GLES and SEPARATE_TEST_DECODER to override both true and false.
2025-12-27 15:33:39 -06:00
Cameron Gutman
21fb2832e1 Fix CLI exit after unexpected stream termination
Fixes #939
2025-12-27 13:33:46 -06:00
Cameron Gutman
b80d2a00c0 Fix SIGTERM unexpectedly quitting the host app 2025-12-23 01:09:21 -06:00
Cameron Gutman
7f54662160 Autoselect AV1 over H.264 on RK3588 2025-12-21 14:59:08 -06:00
Cameron Gutman
f66285ddba Fix spurious HEVC software decode warning if AV1 is forced without HEVC hardware decoding 2025-12-21 14:36:22 -06:00
Cameron Gutman
4a591069ac Add custom signal handlers to arbitrate between Qt and SDL
Fixes #1496
2025-12-14 18:57:26 -06:00
Cameron Gutman
c71b513bc4 Pump the Qt event loop before creating the SDL window 2025-12-14 18:09:20 -06:00
Cameron Gutman
700655c051 Remove the fixed delay for starting the connection
The StreamSegue already handles delaying to allow the warnings to be visible.
2025-12-14 17:57:20 -06:00
Cameron Gutman
62816a6b2a Prioritize AV1 over H.264 if HEVC is unavailable on Windows
Some Windows PCs are shipping with HEVC disabled in firmware, even though they support AV1.
2025-11-24 00:06:40 -06:00
Cameron Gutman
d40999ce06 Don't reset Qt's OpenGL state
We're using a different EGL context for SDL, so it's unnecessary.
2025-11-22 19:47:52 -06:00
Cameron Gutman
54283ce0a1 Rework session initialization to return to the Qt event loop while connecting
We also display multiple launch warnings at the same time
2025-11-22 17:09:16 -06:00
Cameron Gutman
9106f2c420 Disable the depth and stencil buffers
We don't have any need for either in our renderers.
2025-11-06 17:44:01 -06:00
Cameron Gutman
bd6235efba Use async logging while streaming only
The benefits of reliable output outweigh performance concerns during non-streaming activities.
2025-10-25 00:18:34 -05:00
Cameron Gutman
bdb6d02dac Add (currently harmless) missing break 2025-10-22 23:21:07 -05:00
Cameron Gutman
9bcc6291be Auto-lock the cursor in single display borderless windowed scenarios 2025-10-22 23:13:03 -05:00
Qian23333
fb9a164111 feat: disable text input when window gains focus 2025-10-20 23:33:10 -05:00
Cameron Gutman
c0d38ee78f Switch the decoder lock to a mutex
It can be held for non-trivial amounts of time.
2025-10-12 15:47:09 -05:00
Laszlo Racz
0c8354336b Fix: Improve stream window resizing logic 2025-07-27 14:23:12 -05:00
Odizinne
65c04fd560 Added option to disable pre launch warning and delay 2025-07-04 15:04:10 -05:00
James Poje
9c9bfd8428 Add quit-app-and-exit shortcut Ctrl+Alt+Shift+E
Add a shortcut to quit the current app and exit Moonlight entirely.
2025-04-02 21:55:38 -05:00
ABeltramo
d9c7a245ef DualSense adaptive trigger support (#1561) 2025-04-01 21:45:25 -05:00
Cameron Gutman
dd2a99a96b Prepare for SDL3 support 2025-01-25 16:20:20 -06: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
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
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
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
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
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
ns6089
da0244c538 Support YUV 4:4:4 formats 2024-07-24 20:54:13 -05:00
Cameron Gutman
2e29ef8d74 Simplify codec selection and prioritization logic 2024-07-06 00:50:32 -05:00
Cameron Gutman
e76780e105 Add a new prepareToRender() callback for renders to perform their initial window clears
This consolidates all the clearing that was strewn across the codebase.
2024-06-25 23:12:18 -05:00
Cameron Gutman
1d1fa0577b Don't flush window events after the KMSDRM modeset operation
We will flush the initial window shown event that we require to start decoding.
2024-06-25 22:28:23 -05:00
Cameron Gutman
a9d7c8e495 Move forced KMSDRM modesetting operation into Session init code
Performing this each time DrmRenderer is initialized leads to long
delays when choosing a decoder on embedded platforms, particularly
those like TH1520/JH7110 which lack accelerated GL drivers.
2024-06-25 21:57:02 -05:00
Cameron Gutman
d7bc735edc Allow use of old fullscreen mode on macOS by setting I_WANT_BUGGY_FULLSCREEN=1 2024-06-09 15:46:24 -05:00
Cameron Gutman
b59de38e0b Revert "Only use SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES=0 for native notched resolution"
Users want to control when the notch is and is not included for display scaling.

Fixes #1301

This reverts commit e25d9b0da2.
2024-06-09 15:42:39 -05:00