summaryrefslogtreecommitdiffstats
path: root/libmpv/opengl_cb.h
diff options
context:
space:
mode:
Diffstat (limited to 'libmpv/opengl_cb.h')
-rw-r--r--libmpv/opengl_cb.h38
1 files changed, 34 insertions, 4 deletions
diff --git a/libmpv/opengl_cb.h b/libmpv/opengl_cb.h
index 799e353a41..1434c6cee3 100644
--- a/libmpv/opengl_cb.h
+++ b/libmpv/opengl_cb.h
@@ -151,6 +151,24 @@ extern "C" {
* up until mpv_opengl_cb_uninit_gl() is called. If the name is not anything
* you know/expected, return NULL from the function.
*
+ * * Windowing system scaling
+ * ------------------------------------
+ *
+ * When using GL, sometimes GL rendering window is upscaled to display buffer.
+ * Typically with drm where GL framebuffer can be upscaled at later stage.
+ * In That case glMPGetNativeDisplay("opengl-cb-window-pos") should return an
+ * mpv_opengl_cb_window_pos struct pointer defined below.
+ * Note : The intended use is for hardware overlays that might require
+ * upscaling features (typically upscaling GL windows with drm to screen size).
+ */
+struct mpv_opengl_cb_window_pos {
+ int x; // left coordinates of window (usually 0)
+ int y; // top coordinates of window (usually 0)
+ int width; // width of GL window
+ int height; // height of GL window
+};
+
+/**
* Windowing system interop on Intel/Linux with VAAPI
* --------------------------------------------------
*
@@ -163,10 +181,22 @@ extern "C" {
*
* glMPGetNativeDisplay("wl") should return a Wayland "struct wl_display *".
*
- * glMPGetNativeDisplay("drm") should return a DRM FD casted to intptr_t (note
- * that a 0 FD is not supported - if this can happen in your case, you must
- * dup2() it to a non-0 FD).
- *
+ * glMPGetNativeDisplay("opengl-cb-drm-params") should return an
+ * mpv_opengl_cb_drm_params structure pointer :
+ */
+struct mpv_opengl_cb_drm_params {
+ // DRM fd (int). set this to -1 if invalid.
+ int fd;
+
+ // currently used crtc id
+ int crtc_id;
+
+ // pointer to the drmModeAtomicReq that is being used for the renderloop.
+ // This atomic request pointer should be usually created at every renderloop.
+ struct _drmModeAtomicReq *atomic_request;
+};
+
+/**
* nVidia/Linux via VDPAU requires GLX, which does not have this problem (the
* GLX API can return the current X11 Display).
*