From c1de4bb7454db8fbb61e337b58923652602524dd Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Thu, 9 Feb 2023 14:04:19 -0600 Subject: vo_dmabuf_wayland: rewrite around wl_list vo_dmabuf_wayland worked by allocating entries to a pool and then having a lot of complex logic dealing with releasing buffers, pending entries, etc. along with some other not so nice things. Instead, we can rewrite this logic so that the wl_buffers created by the imported dmabuf is instead stored in a linked list, wl_list. We can simply append our buffers to the list when needed and destroy everything at the end. On every frame, we can check the ids of our surfaces and reuse existing buffers, so in practice there will only ever be a handful at a time. Some other small changes were made in an attempt to organize the vaapi/drmprime code a little better as well. An important change is to always enforce at least a minimum number of buffers. Certain formats would not make enough unique buffers, and this results in flickering/artifacts occuring. The old way to attempt to deal with this was to clear out all the existing buffers and remake them, but this gets complicated and also didn't always work. An easy solution to this is just create more buffers which appears to solve this problem. The actual number needed is not really based on anything solid, but 8 is a reasonable number to create for the lifetime of a file and it seems to do the trick. Additionally, seeking/loading new files can result in flicker artificts due to buffers being reused when they shouldn't. When that happens, we flip a bool so all the buffers get destroyed in draw_frame to avoid any visual glitches. --- wscript_build.py | 1 - 1 file changed, 1 deletion(-) (limited to 'wscript_build.py') diff --git a/wscript_build.py b/wscript_build.py index 51f6351960..823f875c91 100644 --- a/wscript_build.py +++ b/wscript_build.py @@ -520,7 +520,6 @@ def build(ctx): ( "video/out/present_sync.c", "wayland || x11" ), ( "video/out/wldmabuf/context_wldmabuf.c", "dmabuf-wayland" ), ( "video/out/wldmabuf/ra_wldmabuf.c", "dmabuf-wayland" ), - ( "video/out/wlbuf_pool.c", "dmabuf-wayland" ), ( "video/out/vo.c" ), ( "video/out/vo_caca.c", "caca" ), ( "video/out/vo_direct3d.c", "direct3d" ), -- cgit v1.2.3