summaryrefslogtreecommitdiffstats
path: root/libmpv
diff options
context:
space:
mode:
authorLionel CHAZALLON <LongChair@hotmail.com>2017-10-23 08:51:49 -0700
committerwm4 <wm4@nowhere>2017-10-23 21:07:24 +0200
commitcfcee4cfe70536faeb9f2aaa87257d067e902b70 (patch)
treeb6dfc61144a7394974657b5dfdfc34d9fcf1576a /libmpv
parent762b8cc30007480f06d338ac77d6e91cc04cd320 (diff)
downloadmpv-cfcee4cfe70536faeb9f2aaa87257d067e902b70.tar.bz2
mpv-cfcee4cfe70536faeb9f2aaa87257d067e902b70.tar.xz
Add DRM_PRIME Format Handling and Display for RockChip MPP decoders
This commit allows to use the AV_PIX_FMT_DRM_PRIME newly introduced format in ffmpeg that allows decoders to provide an AVDRMFrameDescriptor struct. That struct holds dmabuf fds and information allowing zerocopy rendering using KMS / DRM Atomic. This has been tested on RockChip ROCK64 device.
Diffstat (limited to 'libmpv')
-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).
*