mpv/video
dudemanguy ea4685b233 wayland: use callback flag + poll for buffer swap
The old way of using wayland in mpv relied on an external renderloop for
semi-accurate timings. This had multiple issues though. Display sync
would break whenever the window was hidden (since the frame callback
stopped being executed) which was really annoying. Also the entire
external renderloop logic was kind of fragile and didn't play well with
mpv's internal structure (i.e. using presentation time in that old
paradigm breaks stats.lua).

Basically the problem is that swap buffers blocks on wayland which is
crap whenever you hide the mpv window since it looks up the entire
player. So you have to make swap buffers not block, but this has a
different problem. Timings will be terrible if you use the unblocked
swap buffers call.

Based on some discussion in #wayland, the trick here is relatively
simple and works well enough for our purposes. Instead we basically
build a way to block with a timeout in the wayland buffer swap
functions.

A bool is set in the frame callback function that indicates whether or
not mpv is waiting for a frame to be displayed. In the actual buffer
swap function, we enter into a while loop waiting for this flag to be
set. At the same time, the wl_display is polled to block the thread and
wakeup if it receives any events from the compositor. This loop only
breaks if enough time has passed or if the frame callback bool is
received.

In the near future, it is better to set whether or not frame a frame has
been displayed in the presentation feedback. However as a first pass,
doing it in the frame callback is more than good enough.

The "downside" is that we render frames that aren't actually shown on
screen when the player is hidden (it seems like wayland people don't
like that). But who cares. Accurate timings are way more important. It's
probably not too hard to add that behavior back in the player though.
2019-10-10 17:41:19 +00:00
..
decode video: generally try to align image data on 64 bytes 2019-09-19 20:37:05 +02:00
filter vf_fingerprint: fix an obvious memory leak 2019-10-03 01:07:25 +02:00
out wayland: use callback flag + poll for buffer swap 2019-10-10 17:41:19 +00:00
csputils.c video: add pure gamma TRC curves for 2.0, 2.4 and 2.6. 2019-09-27 13:21:41 +02:00
csputils.h video: add pure gamma TRC curves for 2.0, 2.4 and 2.6. 2019-09-27 13:21:41 +02:00
d3d.c video: rewrite filtering glue code 2018-01-30 03:10:27 -08:00
d3d.h video: move d3d.c out of decode sub directory 2017-12-01 17:58:56 +01:00
fmt-conversion.c vo/gpu: hwdec_vdpau: Support direct mode for 4:4:4 content 2019-07-08 01:11:27 +02:00
fmt-conversion.h video/fmt-conversion, img_format: change license to LGPL 2017-06-18 15:15:07 +02:00
hwdec.c video: rewrite filtering glue code 2018-01-30 03:10:27 -08:00
hwdec.h video: rewrite filtering glue code 2018-01-30 03:10:27 -08:00
image_loader.c image_writer: move convert_image() to player/screenshot.c 2019-09-14 23:02:39 +02:00
image_loader.h x11: load icon differently 2017-07-01 15:56:12 +02:00
image_writer.c image_writer: add webp-compression option 2019-09-14 23:02:39 +02:00
image_writer.h image_writer: add webp-compression option 2019-09-14 23:02:39 +02:00
img_format.c video: generally try to align image data on 64 bytes 2019-09-19 20:37:05 +02:00
img_format.h vo/gpu: hwdec_vdpau: Support direct mode for 4:4:4 content 2019-07-08 01:11:27 +02:00
mp_image.c video: generally try to align image data on 64 bytes 2019-09-19 20:37:05 +02:00
mp_image.h video: generally try to align image data on 64 bytes 2019-09-19 20:37:05 +02:00
mp_image_pool.c mp_image_pool: expose a function for reporting hw download format 2019-10-02 21:07:14 +02:00
mp_image_pool.h mp_image_pool: expose a function for reporting hw download format 2019-10-02 21:07:14 +02:00
sws_utils.c sws_utils: don't force callers to provide option struct 2018-01-18 00:59:07 -08:00
sws_utils.h video: generally try to align image data on 64 bytes 2019-09-19 20:37:05 +02:00
vaapi.c vaapi: add option to select a non-default device path 2018-03-30 14:16:07 -07:00
vaapi.h vo_gpu: hwdec_vaapi: Suppress format errors when probing 2019-07-08 01:57:02 +02:00
vdpau.c hwdec: remove unused fields 2017-12-21 19:31:36 +01:00
vdpau.h vd_lavc, vdpau, vaapi: restore emulated API avoidance 2017-12-02 04:53:51 +01:00
vdpau_functions.inc
vdpau_mixer.c video: redo video equalizer option handling 2017-08-22 17:01:35 +02:00
vdpau_mixer.h video: redo video equalizer option handling 2017-08-22 17:01:35 +02:00