From 274e71ee8b774d6c9c69929a548a83c343202be1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 12 Sep 2016 15:08:38 +0200 Subject: vo_opengl: add hw overlay support and use it for RPI This overlay support specifically skips the OpenGL rendering chain, and uses GL rendering only for OSD/subtitles. This is for devices which don't have performant GL support. hwdec_rpi.c contains code ported from vo_rpi.c. vo_rpi.c is going to be deprecated. I left in the code for uploading sw surfaces (as it might be slightly more efficient for rendering sw decoded video), although it's dead code for now. --- libmpv/opengl_cb.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'libmpv') diff --git a/libmpv/opengl_cb.h b/libmpv/opengl_cb.h index 8751ca01e0..6500b4ef65 100644 --- a/libmpv/opengl_cb.h +++ b/libmpv/opengl_cb.h @@ -190,6 +190,29 @@ extern "C" { * In previous libmpv releases, this used "GL_MP_D3D_interfaces" and * "glMPGetD3DInterface". This is deprecated; use glMPGetNativeDisplay instead * (the semantics are 100% compatible). + * + * Windowing system interop on RPI + * ------------------------------- + * + * The RPI uses no proper interop, but hardware overlays instead. To place the + * overlay correctly, you can communicate the window parameters as follows to + * libmpv. gl->MPGetNativeDisplay("MPV_RPI_WINDOW") return an array of type int + * with the following 4 elements: + * 0: display number (default 0) + * 1: layer number of the GL layer - video will be placed in the layer + * directly below (default: 0) + * 2: absolute x position of the GL context (default: 0) + * 3: absolute y position of the GL context (default: 0) + * The (x,y) position must be the absolute screen pixel position of the + * top/left pixel of the dispmanx layer used for the GL context. If you render + * to a FBO, the position must be that of the final position of the FBO + * contents on screen. You can't transform or scale the video other than what + * mpv will render to the video overlay. The defaults are suitable for + * rendering the video at fullscreen. + * The parameters are checked on every draw by calling MPGetNativeDisplay and + * checking the values in the returned array for changes. The returned array + * must remain valid until the libmpv render function returns; then it can be + * deallocated by the API user. */ /** -- cgit v1.2.3