mpv/video/out/opengl
Dudemanguy c26d83348b wayland: shuffle around the render loop again
Take two. f4e89dd went wrong by moving vo_wayland_wait_frame before
start_frame was called. Whether or not this matters depends on the
compositor, but some weird things can happen. Basically, it's a
scheduling issue. vo_wayland_wait_frame queues all events and sends them
to the server to process (with no blocking if presentation time is
available). If mpv changes state while rendering (and this function is
called before every frame is drawn), then that event also gets
dispatched and sent to the compositor. This, in some cases, can cause
some funny behavior because the next frame gets attached to the surface
while the old buffer is getting released. It's safer to call this
function after the swap already happens and well before mpv calls its
next draw. There's no weird scheduling of events, and the compositor log
is more normal.

The second part of this is to fix some stuttering issues. This is mostly
just conjecture, but probably what was happening was this thing called
"composition". The easiest way to see this is to play a video on the
default audio sync mode (probably easiest to see on a typical 23.976
video). Have that in a window and float it over firefox (floating
windows are bloat on a tiling wm anyway). Then in firefox, do some short
bursts of smooth scrolling (likely uses egl). Some stutter in video
rendering could be observed, particularly in panning shots.

Compositors are supposed to prevent tearing so what likely was happening
was that the compositor was simply holding the buffer a wee bit longer
to make sure it happened in sync with the smooth scrolling. Because the
mpv code waits precisely on presentation time, the loop would timeout on
occasion instead of receiving the frame callback. This would then lead
to a skipped frame when rendering and thus causing stuttering.

The fix is simple: just only count consecutive timeouts as not receiving
frame callback. If a compositor holds the mpv buffer slightly longer to
avoid tearing, then we will definitely receive frame callback on the
next round of the render loop. This logic also appears to be sound for
plasma (funfact: Plasma always returns frame callback even when the
window is hidden. Not sure what's up with that, but luckily it doesn't
matter to us.), so get rid of the goofy 1/vblank_time thing and just
keep it a simple > 1 check.
2021-05-24 19:20:31 +00:00
..
angle_dynamic.c
angle_dynamic.h
common.c OpenGL: Also detect softpipe as a software driver 2020-02-25 21:32:04 +02:00
common.h client API: add a new way to pass X11 Display etc. to render API 2018-03-26 19:47:08 +02:00
context.c vo_gpu: opengl: make sure to always clean up debug callbacks 2020-04-15 07:21:36 +02:00
context.h vo: use a struct for vsync feedback stuff 2018-12-06 10:30:25 +01:00
context_android.c context_android: move common code to a separate file 2019-09-27 00:05:06 +03:00
context_angle.c options: change option macros and all option declarations 2020-03-18 19:52:01 +01:00
context_cocoa.c options: change option macros and all option declarations 2020-03-18 19:52:01 +01:00
context_drm_egl.c command: add display-width/display-height property 2021-05-06 17:36:55 +00:00
context_dxinterop.c vo: make swapchain-depth option generic for all VOs 2019-09-28 14:10:01 +03:00
context_glx.c vo_gpu: context_glx: Add X11 native resource 2019-11-16 15:35:32 -08:00
context_rpi.c rpi: destroy fullscreen change handling 2019-12-11 18:50:37 +01:00
context_wayland.c wayland: shuffle around the render loop again 2021-05-24 19:20:31 +00:00
context_win.c vo_gpu: win: remove exclusive-fullscreen detection hack 2017-12-20 14:53:41 +11:00
context_x11egl.c vo_gpu: EGL: hack for alpha on different platforms 2020-10-15 13:44:07 +00:00
egl_helpers.c vo_gpu: EGL: hack for alpha on different platforms 2020-10-15 13:44:07 +00:00
egl_helpers.h vo_gpu: opengl: make it work with EGL 1.4 2019-12-16 00:25:51 +01:00
formats.c
formats.h
gl_headers.h vo_gpu: opengl: add hack for ancient Mesa/GLX 2019-11-30 13:38:28 +01:00
hwdec_d3d11egl.c vo_gpu: hwdec_d3d11egl: add missing P010 format to supported list 2019-10-17 22:45:05 +02:00
hwdec_drmprime_drm.c drm_prime: double free bug 2020-03-05 18:12:57 +01:00
hwdec_dxva2egl.c
hwdec_dxva2gldx.c client API: add a new way to pass X11 Display etc. to render API 2018-03-26 19:47:08 +02:00
hwdec_ios.m hwdec_ios: fix crash after mapper_init failure 2018-04-17 01:06:29 +03:00
hwdec_osx.c
hwdec_rpi.c client API: add a new way to pass X11 Display etc. to render API 2018-03-26 19:47:08 +02:00
hwdec_vdpau.c vo_gpu: hwdec_vdpau: remove direct_mode 2019-12-28 14:31:06 -08:00
libmpv_gl.c client API: add a new way to pass X11 Display etc. to render API 2018-03-26 19:47:08 +02:00
oml_sync.c oml_sync: fix typo in comment 2019-09-20 00:32:29 +02:00
oml_sync.h vo_gpu: glx: move OML sync code to an independent file 2019-09-08 23:23:43 +10:00
ra_gl.c video: fix rgb30 component order 2020-05-09 18:02:57 +02:00
ra_gl.h
utils.c vo_gpu: make screenshots use the GL renderer 2018-02-11 17:45:51 -08:00
utils.h vo_gpu: make screenshots use the GL renderer 2018-02-11 17:45:51 -08:00