mpv/video/out
Dudemanguy efb0c5c446 wayland: only render if we have frame callback
Back in the olden days, mpv's wayland backend was driven by the frame
callback. This had several issues and was removed in favor of the
current approach which allowed some advanced features (like
display-resample and presentation time) to actually work properly.
However as a consequence, it meant that mpv always rendered, even if the
surface was hidden. Wayland people consider this "wasteful" (and well
they aren't wrong). This commit aims to avoid wasteful rendering by
doing some additional checks in the swapchain. There's three main parts
to this.

1. Wayland EGL now uses an external swapchain (like the drm context).
Before we start a new frame, we check to see if we are waiting on a
callback from the compositor. If there is no wait, then go ahead and
proceed to render the frame, swap buffers, and then initiate
vo_wayland_wait_frame to poll (with a timeout) for the next potential
callback. If we are still waiting on callback from the compositor when
starting a new frame, then we simple skip rendering it entirely until
the surface comes back into view.

2. Wayland on vulkan has essentially the same approach although the
details are a little different. The ra_vk_ctx does not have support for
an external swapchain and although such a mechanism could theoretically
be added, it doesn't make much sense with libplacebo. Instead,
start_frame was added as a param and used to check for callback.

3. For wlshm, it's simply a matter of adding frame callback to it,
leveraging vo_wayland_wait_frame, and using the frame callback value to
whether or not to draw the image.
2020-09-21 20:42:17 +00:00
..
cocoa
d3d11 vo_gpu: d3d11: only use presentation feedback with flip model 2020-05-07 00:17:50 +10:00
gpu vo_gpu: clip highlights before tone-mapping 2020-07-19 08:07:48 +02:00
hwdec vo_gpu: hwdec_vaapi: handle lack of object size with AMD drivers 2020-07-14 07:32:04 +02:00
mac mac: add an option to change the App activation policy 2020-09-20 15:28:50 +02:00
opengl wayland: only render if we have frame callback 2020-09-21 20:42:17 +00:00
placebo vo_gpu: placebo: add fallback code for stride mismatch 2020-06-16 02:54:59 +02:00
vulkan wayland: only render if we have frame callback 2020-09-21 20:42:17 +00:00
win32
android_common.c options: simplify --android-surface-size handling 2020-09-20 12:04:25 +02:00
android_common.h
aspect.c options: add --video-scale-x/y 2020-06-03 17:26:44 +02:00
aspect.h
bitmap_packer.c
bitmap_packer.h
cocoa_cb_common.swift cocoa-cb: force layer update on resize 2020-08-22 14:22:49 +02:00
cocoa_common.h
cocoa_common.m build: change filenames of generated files 2020-06-04 16:59:05 +02:00
dither.c
dither.h
dr_helper.c
dr_helper.h
drm_atomic.c
drm_atomic.h
drm_common.c drm_common: set frsig to a valid signal 2020-04-22 11:27:18 +02:00
drm_common.h
drm_prime.c drm_prime: fallback to drmModeAddFB2 2020-05-08 21:26:25 +02:00
drm_prime.h
filter_kernels.c
filter_kernels.h
libmpv.h client API: add software rendering API 2020-07-08 22:42:05 +02:00
libmpv_sw.c client API: add software rendering API 2020-07-08 22:42:05 +02:00
vo.c wayland: soften GNOME warning 2020-08-17 19:36:04 +03:00
vo.h vo_vdpau: remove deprecated/inactive --vo-vdpau-deint option 2020-09-09 15:38:39 +02:00
vo_caca.c
vo_direct3d.c vo_direct3d: dumb down OSD rendering 2020-05-13 23:16:32 +02:00
vo_drm.c vo_wlshm, vo_drm: set image size with mp_image_set_size 2020-05-17 12:53:26 +02:00
vo_gpu.c options: change option macros and all option declarations 2020-03-18 19:52:01 +01:00
vo_image.c options: change option macros and all option declarations 2020-03-18 19:52:01 +01:00
vo_lavc.c
vo_libmpv.c client API: add software rendering API 2020-07-08 22:42:05 +02:00
vo_mediacodec_embed.c
vo_null.c options: change option macros and all option declarations 2020-03-18 19:52:01 +01:00
vo_rpi.c rpi: use "brcm" variant of libGLESv2 2020-04-23 14:05:32 +02:00
vo_sdl.c options: change option macros and all option declarations 2020-03-18 19:52:01 +01:00
vo_tct.c video/out/vo_tct: query terminal size generically 2020-04-23 23:25:41 +03:00
vo_vaapi.c draw_bmp: use command line options for any used scalers 2020-05-13 20:07:59 +02:00
vo_vdpau.c vo_vdpau: remove an unused variable 2020-09-10 23:25:30 +02:00
vo_wlshm.c wayland: only render if we have frame callback 2020-09-21 20:42:17 +00:00
vo_x11.c vo_x11: partially restore operation on bad endian systems 2020-06-17 19:44:50 +02:00
vo_xv.c options: change option macros and all option declarations 2020-03-18 19:52:01 +01:00
w32_common.c w32_common: Scale window when moving to display with different DPI 2020-05-08 21:47:32 +10:00
w32_common.h
wayland_common.c wayland: only render if we have frame callback 2020-09-21 20:42:17 +00:00
wayland_common.h wayland: only render if we have frame callback 2020-09-21 20:42:17 +00:00
win_state.c
win_state.h
x11_common.c command: add read-only focused property 2020-09-08 20:09:17 +02:00
x11_common.h x11: remove terrible xdg-screensaver hack 2020-07-08 22:45:07 +02:00