Finish optimized media presentation path
Hello,
There’s not much activity or specific plans in terms of finishing optimized video playback, so I would like to be of some help. While using mpv with dmabuf-Wayland works, it’s impractical as it scales the video along with OSD and subtitles making them blurry on displays above 1080p.
The only way to go from here is to dynamically allocate more DRM planes - support at least two additional planes, one for subtitles and one for UI that shows on hover, and detect this special case and perform multiple direct scanouts.
I am willing to do some coding and testing.
I would appreciate some overview on how that responsibility could be best split across KWin classes as I am not very familiar with the whole codebase.
One thing that comes to mind is that creating and destroying these planes might be better as an async timer, to avoid blocking the rendering pipeline with atomic KMS calls which could block. As well as to debounce deallocation and avoid flickering and performance issues when subtitles show and hide.
Also see:
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4348
https://gitlab.freedesktop.org/emersion/libliftoff/-/merge_requests/79
https://gitlab.freedesktop.org/drm/amd/-/issues/3195
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2660#fd96e12313a843d42ca63c8af21f048546faa21d