diff options
author | Dudemanguy <random342@airmail.cc> | 2023-02-09 14:04:19 -0600 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-05-24 21:53:17 +0000 |
commit | c1de4bb7454db8fbb61e337b58923652602524dd (patch) | |
tree | 1aa26c9bee6d0d13d6de10d2ee4554b2c61290a6 /wscript_build.py | |
parent | b9a5583f17f9c0a4ae97f2613875804deb4e1c74 (diff) | |
download | mpv-c1de4bb7454db8fbb61e337b58923652602524dd.tar.bz2 mpv-c1de4bb7454db8fbb61e337b58923652602524dd.tar.xz |
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.
Diffstat (limited to 'wscript_build.py')
-rw-r--r-- | wscript_build.py | 1 |
1 files changed, 0 insertions, 1 deletions
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" ), |