Commit Graph

378 Commits

Author SHA1 Message Date
Cameron Gutman 255cbd1e7e Fix building with SDL 2.0.20 or earlier 2022-10-15 15:36:09 -05:00
Cameron Gutman 21edcc8113 Add workaround for macOS fullscreen exit bug 2022-10-14 23:01:55 -05:00
Cameron Gutman 453fe6aea0 Ensure the target window size is always even 2022-10-14 21:09:32 -05:00
Cameron Gutman e0fb7dfd14 Rework window creation, sizing, and fullscreen transition logic
- Fixes window position/size being lost when toggling full-screen
- Fixes initial window size not respecting stream aspect ratio
2022-10-14 20:24:12 -05:00
Cameron Gutman e6c4332445 Revert "Use Rec 2020 colorspace for WCG support even if HDR is off on the host"
Rec 2020 conversion causes colors to be blown out in SDR

This reverts commit 472e8ee92e.
2022-10-13 01:19:49 -05:00
Cameron Gutman 472e8ee92e Use Rec 2020 colorspace for WCG support even if HDR is off on the host 2022-10-13 00:14:10 -05:00
Cameron Gutman c55af7fff3 Add a decoder/renderer callback to specify the desired color range 2022-10-12 23:59:01 -05:00
Cameron Gutman fbbbd5e0b8 Use new LiRequestIdrFrame() API 2022-10-05 00:53:31 -05:00
Cameron Gutman 071c76c06a Add error text for ML_ERROR_FRAME_CONVERSION 2022-10-04 22:05:18 -05:00
Cameron Gutman 26ee1aee25 Fix protected content error on GFE 3.22+ 2022-10-04 22:02:44 -05:00
Cameron Gutman 9ab4479fcf Fix excessive flickering when switching between full-screen and windowed on Windows 2022-08-28 20:10:26 -05:00
Cameron Gutman d39a29759c Don't draw with test-only renderers 2022-08-21 18:38:09 -05:00
Cameron Gutman b0804ce048 Fix native resolution detection on high DPI wayland systems 2022-08-16 00:25:57 -05:00
Cameron Gutman 56f184393f Allow the cursor lock toggle to work in full-screen mode
Fixes #793
2022-05-19 19:14:55 -05:00
Cameron Gutman c75b781d3f Use SDL_WINDOWEVENT_DISPLAY_CHANGED on SDL 2.0.18+ 2022-05-17 17:13:07 -05:00
Cameron Gutman 8aa42ff1d9 Reset the EGL renderer when specialization fails 2022-05-17 17:10:40 -05:00
Cameron Gutman b12724db02 Reduce log spam when choosing a resolution 2022-04-24 17:11:10 -05:00
Cameron Gutman 6fdaa6ee8a Avoid modesetting if the display didn't change 2022-04-24 16:48:21 -05:00
Cameron Gutman f10b547a49 Partially revert "Rework window management to fix issues restoring window state between windowed and full-screen"
This exposes all sorts of issues with full-screen transitions on Windows and macOS:
- Loss of proper window decorations when transitioning from full-screen to windowed on Windows
- Improper sizing when transitioning from true full-screen to windowed on macOS

This reverts commit 38396b2691.
2022-04-24 16:40:19 -05:00
Cameron Gutman 38396b2691 Rework window management to fix issues restoring window state between windowed and full-screen 2022-04-24 16:22:17 -05:00
Cameron Gutman 220f50ebe4 Revert "Allow renderers to apply size and display changes seamlessly"
This reverts commit c989133d27.
2022-04-24 16:12:12 -05:00
Cameron Gutman c989133d27 Allow renderers to apply size and display changes seamlessly 2022-04-24 15:42:08 -05:00
Cameron Gutman 6c339551eb Allow resolution changes on all platforms
Take aspect ratio into account when making the choice too.
2022-04-21 23:57:17 -05:00
Cameron Gutman 6972573a6e Add pointer lock key combo
Fixes #737
2022-03-29 18:26:09 -05:00
Cameron Gutman ce2a01fc59 Allow the screensaver toggle to work even if running on an embedded platform 2022-03-16 21:57:03 -05:00
Cameron Gutman 97d8274911 Add option to allow PC to sleep while streaming 2022-03-16 21:48:56 -05:00
Cameron Gutman e078a8b7b6 Don't recreate the decoder while the window is minimized
Fixes #726
2022-03-06 15:21:43 -06:00
Cameron Gutman a6395b9025 Fix short UI hang when manually stopping the stream after losing connection with the host 2022-03-06 13:11:36 -06:00
Cameron Gutman 4ae39f2bd5 Properly synchronize rumble with gamepad removal 2022-03-05 13:32:38 -06:00
Cameron Gutman ef037e18d0 Add colorspace and color range override options 2022-02-17 00:26:56 -06:00
Cameron Gutman b96cb1abaf Remove per-app HDR support check
It doesn't seem to make a difference anymore whether it's supported or not.
GFE seems happy to enter HDR mode anyway.
2022-02-07 20:02:19 -06:00
Cameron Gutman 1cbdd0e675 Display the HDR option if the platform has a decoder that supports it 2022-01-29 00:59:04 -06:00
Cameron Gutman 254526a213 Plumb HDR mode information to the decoders 2022-01-28 22:10:50 -06:00
Cameron Gutman e64b15d2a7 Rework how we deal with window re-creation for EGLRenderer
Previously we opted to just lie to SDL and tell it that the current
GL context is actually GLES 3.0 when it wasn't. This meant that
we avoided our window being recreated for GLES usage on Wayland
and KMSDRM, but that meant our 10-bit color change didn't apply
either. I suspect this hackery is what led EGLRenderer to get
stuck in a state where SDL_CreateRenderer() always failed.

Now SDL will recreate our window once to configure a compatible GL
API for our renderer. If that fails, we'll move on to a different
renderer (which may recreate the window again).
2022-01-27 21:49:03 -06:00
Cameron Gutman ee5918cf4e Revert "Add workaround for duplicate size changed events on Wayland"
Skipping size changed events can cause EGLRenderer to get stuck in
a state where it can't reset itself properly. This seems to happen
consistently when starting a maximized stream then transitioning
to full-screen.

This reverts commit e1b3f90f8b.
2022-01-22 12:29:44 -06:00
Cameron Gutman f0659b4f3c Fix random crash on stream start with renderers that require test frames 2022-01-18 18:19:28 -06:00
Cameron Gutman 859d8b96a7 Don't use duplicate resize workaround on SDL 2.0.21+ 2022-01-17 19:25:43 -06:00
Cameron Gutman 49892b3ce8 Only use SDL_WaitEventTimeout() on SDL 2.0.18+ 2022-01-17 16:59:45 -06:00
Cameron Gutman d6cfbdb273 Rewrite FFmpeg decoder to use pull model
This allows us to keep asynchronous decoders like MMAL and V4L2M2M fed
while we're waiting for output frames. Behavior for synchronous decoders
should be identical.

Continuing to feed new data while waiting for output frames is crucial for
acceptable performance on 1080p video on the Raspberry Pi using V4L2M2M,
since it allows the decode and copy operations to be pipelined.
2022-01-17 15:06:12 -06:00
Cameron Gutman 8a27fa7bb5 Convert NeedsIdr member into an atomic variable with a getter 2022-01-17 14:30:12 -06:00
Cameron Gutman e1b3f90f8b Add workaround for duplicate size changed events on Wayland 2022-01-14 23:36:21 -06:00
Cameron Gutman 5612e9864e Fix handling of some validation scenarios
- HEVC forced with no host or client hw support
- H.264 forced with no client hw support
- Client has hw HEVC only and host only supports H.264
- Client has no hw decode at all
2022-01-06 23:15:19 -06:00
Cameron Gutman 77d07c7c4d Fix incorrect error message when only HEVC decode is available but HEVC encode is not 2022-01-06 22:08:43 -06:00
Cameron Gutman b2265080fd Allow HEVC decoders to satisfy hardware decoding check if H.264 is unavailable 2022-01-06 22:07:31 -06:00
Cameron Gutman e56bb6785f Change display mode when using KMSDRM backend 2021-12-18 21:07:35 -06:00
Cameron Gutman d2c9f058f8 Add names to session threads 2021-10-24 16:22:49 -05:00
Cameron Gutman 4873862d16 Use SDL_WaitEventTimeout() on SDL 2.0.16 2021-08-15 15:16:51 -05:00
Cameron Gutman 666dc13c01 Use SDL's new support for keyboard grab on macOS 2021-08-15 14:54:26 -05:00
Cameron Gutman fa3f822cf1 Rework handling of addresses to allow alternate HTTP ports 2021-07-02 23:34:54 -05:00
Cameron Gutman 5afab126b3 Refactor NvPairingManager, NvComputer, and NvHTTP to reduce passing of addresses 2021-07-02 17:14:48 -05:00