summaryrefslogtreecommitdiffstats
path: root/video/out/wayland_common.c
diff options
context:
space:
mode:
authorAlexander Preisinger <alexander.preisinger@gmail.com>2014-03-06 14:24:34 +0100
committerAlexander Preisinger <alexander.preisinger@gmail.com>2014-09-21 09:14:33 +0200
commitf1906e684ae16fd120e2054840f252419910a1c5 (patch)
tree0decccd260bdd72e60ffbadcb21d0e79a20371cc /video/out/wayland_common.c
parent9f7e1cf70a18f3370b439486dabe3cf81c0296f6 (diff)
downloadmpv-wayland-next.tar.bz2
mpv-wayland-next.tar.xz
wayland/shm: use wl_viewportwayland-next
Lets the compositor scale the video. This relies on the compositors scaling mechanism and efficiency. But should by far more efficient than ffmpeg scaling which burns CPU. In my tests mpv went from 66 % cpu load to 9 %. But the scaling wasn't as nice as ffmpegs. Falls back to software scaling if the compositor dosen't advertise the wl_scaler interface.
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r--video/out/wayland_common.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index d132601596..67ce7728b2 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -661,6 +661,11 @@ static void registry_handle_global (void *data,
xdg_shell_use_unstable_version(wl->display.shell,
XDG_SHELL_VERSION_CURRENT);
}
+
+ else if (strcmp(interface, "wl_scaler") == 0) {
+
+ wl->display.scaler = wl_registry_bind(reg, id, &wl_scaler_interface, 1);
+ }
}
static void registry_handle_global_remove (void *data,
@@ -807,6 +812,9 @@ static void destroy_display (struct vo_wayland_state *wl)
}
}
+ if (wl->display.scaler)
+ wl_scaler_destroy(wl->display.scaler);
+
if (wl->display.shm)
wl_shm_destroy(wl->display.shm);