Commit Graph

53 Commits

Author SHA1 Message Date
Cameron Gutman 46c76534bc Use AVBufferRefs to keep EGLImages and DRM FDs around for the lifetime of the frame 2026-01-04 18:06:24 -06:00
Cameron Gutman 3e5aa9b127 Simplify EGLImageFactory and remove caching logic for now
The platforms that would most benefit (embedded V4L2 decoders)
either don't use frame pooling or don't synchronize with
modified DMA-BUFs unless eglCreateImage() is called each time.
2025-12-28 17:54:31 -06:00
Cameron Gutman 085480e9f4 Add EGLImage caching to improve performance 2025-12-28 17:08:45 -06:00
Cameron Gutman d501a627f0 Test all renderers before use
Every renderer except SDL had opted-in for testing due to various
quirks discovered over the years, so just do away with this option
and test all renderers.
2025-12-22 23:58:26 -06:00
Cameron Gutman f5ef201905 Create a separate X11 Display object for libva
Sharing these directly is fraught with concurrency issues that
require extreme care on both sides to avoid spurious X11 errors,
hangs, and other nasty stuff. We can't necessarily depend on SDL,
libva, or the underlying VA drivers to do the right thing here.

Using a new Display (as FFmpeg does for VAAPI and VDPAU) avoids
all these problems.
2025-11-23 13:26:46 -06:00
Cameron Gutman c707dab70a Plumb YUV444 logic into additional renderers 2024-07-25 06:36:40 -05: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 a2f23b7053 Fix automatic VA DRM driver selection with libva 2.20 2023-10-05 18:12:12 -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 d147d36867 Fix leaking /dev/dri fds on each vaInitialize() failure 2023-08-01 22:53:22 -05:00
Cameron Gutman 8465a27a97 Deprioritize VAAPI for Gallium and Nvidia drivers and work around RFI latency bug 2022-10-16 21:51:10 -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 413ef42a34 Enable HEVC RFI for CUDA, VAAPI, and VDPAU decoders 2022-10-05 18:47:43 -05:00
Cameron Gutman f5f23a7c22 Implement overlay support for the VAAPI direct renderer 2022-05-20 21:40:37 -05:00
Cameron Gutman 6a0cf4bfd3 Fix some #if -> #ifdefs 2022-04-05 00:26:13 -05:00
Cameron Gutman fee6f75223 Fix VAAPIRenderer build error with neither HAVE_EGL nor HAVE_DRM defined 2022-04-05 00:24:00 -05:00
Cameron Gutman 8c93b2d54c Fix VAAPIRenderer build error with HAVE_DRM but not HAVE_EGL 2022-04-04 19:40:31 -05:00
Cameron Gutman cf089fdfe9 Add support for HDR with VAAPI using DRM frontend renderer 2022-01-29 18:16:39 -06:00
Cameron Gutman 9755e31fa2 Refactor VAAPI surface export check into separate function 2022-01-29 17:45:36 -06:00
Cameron Gutman b85d5b8822 Enable P010 surface export from VAAPI to EGL 2022-01-23 18:33:30 -06:00
Cameron Gutman 085a904970 Fix false warning when building without libva-x11 or libva-wayland 2021-11-25 17:52:54 +03:00
Cameron Gutman c3895f06c0 Fix handling of preferred/compatible pixel formats with EGLRenderer and VAAPI/DRM backends 2021-02-04 19:39:18 -06:00
Cameron Gutman ed57c54d06 Move EGL definitions into renderer.h to try to fix build on Armbian 2021-01-31 17:01:11 -06:00
Cameron Gutman 80137848dc Add DMA-BUF export compatibility with EGL 1.4 2021-01-31 16:24:31 -06:00
Cameron Gutman dbfdc2fd14 Share DRM FD and GBM device with SDL
Depends on https://hg.libsdl.org/SDL/rev/d75deb75464a
2021-01-30 21:11:52 -06:00
Cameron Gutman b800ce9ebe Allow use of VA drivers without VAEntrypointVideoProc 2020-05-13 19:31:25 -07:00
Antoine Damhet 0a396f3112 Introduce a new FFMPEG frontend renderer: EGLRenderer
Right now this renderer works on X11 & Wayland with VAAPI as a backend.

Some rendering latency benchmarks on my `i7-10510U` (with
`intel-media-driver` 20.1.1 which cause a *huge* regression with the
SDL_Renderer):
|             | X11    | Wayland |
| Before      | 6.78ms | 22.50ms |
| EGLRenderer | 0.76ms | 00.77ms |

Signed-off-by: Antoine Damhet <antoine.damhet@lse.epita.fr>
2020-05-12 11:11:35 +02:00
Cameron Gutman 7cf2a55b43 Allow radeonsi to direct render on XWayland 2020-04-26 20:13:00 -07:00
Cameron Gutman aaa112c3f3 Don't use VAAPI drivers that lack VPP support
intel-media-va-driver (free) is one example of such a driver which
is apparently missing the shaders to perform colorspace conversion.
2020-04-26 15:38:05 -07:00
Cameron Gutman 529fdf0341 Add decoder options dictionary to prepareDecoderContext() 2020-02-08 17:47:26 -08:00
Cameron Gutman 801adb6af7 Add colorspace support to VAAPI renderer 2019-12-14 16:58:04 -08:00
Cameron Gutman 6468efd7e4 Add VAAPI DRM support 2019-07-07 15:32:38 -07:00
Cameron Gutman b8b633a6cc Use SDL to render on Wayland for VAAPI 2019-04-12 22:54:21 -07:00
Cameron Gutman ada2270bd1 Reduce code duplication in renderers 2019-04-12 22:12:53 -07:00
Cameron Gutman 25e5175c54 Refactor parameter passing to decoders and split backend/decode-only and frontend renderers 2019-04-11 22:27:20 -07:00
Cameron Gutman 859a5a5e0c Allow a renderer to opt-out of the render thread and use that for SDL on OGL 2019-04-09 21:46:14 -07:00
Cameron Gutman 81c6202582 Rename renderFrameAtVsync() to renderFrame() in preparation for further refactoring 2019-02-15 21:07:02 -08:00
Cameron Gutman cfabaf334e Add frame pacing toggle 2018-12-25 12:57:00 -08:00
Cameron Gutman 2c068a99a3 Allow FFmpeg renderers to enforce V-sync being enabled or disabled 2018-09-03 20:57:09 -04:00
Cameron Gutman 9be9934b8c Add reference frame invalidation for the software decoder 2018-08-25 12:38:04 -07:00
Cameron Gutman f7d3c10c9d Plumb the ability to disable V-sync through the video renderers 2018-08-20 18:19:42 -07:00
Cameron Gutman 845e84adb7 Avoid the test frame for DXVA2 and VT APIs to address flickering in full-screen on Win7 2018-08-19 00:59:04 -07:00
Cameron Gutman 7d61acb2a8 Use Pacer to drive all rendering 2018-08-15 23:57:03 -07:00
Cameron Gutman f171588616 Pass the maximum frame rate into FFmpeg renderers 2018-08-15 20:41:19 -07:00
Cameron Gutman d3c2f50b20 Remove custom VAAPI logging functions 2018-08-11 20:32:28 -07:00
Cameron Gutman f1ee1eeb63 Avoid using window systems that SDL wasn't compiled to support 2018-08-11 20:19:20 -07:00
Cameron Gutman bb18519e44 WIP Wayland rendering code for VAAPI 2018-08-11 19:43:36 -07:00