summaryrefslogtreecommitdiffstats
path: root/wscript_build.py
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2022-06-10 11:49:28 -0500
committerDudemanguy <random342@airmail.cc>2022-06-19 18:13:55 +0000
commit7ce26dd3248a45a4d5e0a8c15a981834e7efc733 (patch)
treeb79e41d7b30ceaa8df3d1c64427acb73775916ba /wscript_build.py
parent44ecf83a1bd94f69cbe7e55b900f2502d15d7d5c (diff)
downloadmpv-7ce26dd3248a45a4d5e0a8c15a981834e7efc733.tar.bz2
mpv-7ce26dd3248a45a4d5e0a8c15a981834e7efc733.tar.xz
vo: move wayland presentation to separate files
Wayland had some specific code that it used for implementing the presentation time protocol. It turns out that xorg's present extension is extremely similar, so it would be silly to duplicate this whole mess again. Factor this out to separate, independent code and introduce the mp_present struct which is used for handling the ust/msc values and some other associated values. Also, add in some helper functions so all the dirty details live specifically in present_sync. The only wayland-specific part is actually obtaining ust/msc values. Since only wayland or xorg are expected to use this, add a conditional to the build that only adds this file when either one of those are present. You may observe that sbc is completely omitted. This field existed in wayland, but was completely unused (presentation time doesn't return this). Xorg's present extension also doesn't use this so just get rid of it all together. The actual calculation is slightly altered so it is correct for our purposes. We want to get the presentation event of the last frame that was just occured (this function executes right after the buffer swap). The adjustment is to just remove the vsync_duration subtraction. Also, The overly-complicated queue approach is removed. This has no actual use in practice (on wayland or xorg). Presentation statistics are only ever used after the immediate preceding swap to update vsync timings or thrown away.
Diffstat (limited to 'wscript_build.py')
-rw-r--r--wscript_build.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/wscript_build.py b/wscript_build.py
index dad54816eb..d0cb4ef332 100644
--- a/wscript_build.py
+++ b/wscript_build.py
@@ -503,6 +503,7 @@ def build(ctx):
( "video/out/opengl/oml_sync.c", "egl-x11 || gl-x11" ),
( "video/out/opengl/ra_gl.c", "gl" ),
( "video/out/opengl/utils.c", "gl" ),
+ ( "video/out/present_sync.c", "wayland || x11" ),
( "video/out/vo.c" ),
( "video/out/vo_caca.c", "caca" ),
( "video/out/vo_direct3d.c", "direct3d" ),