summaryrefslogtreecommitdiffstats
path: root/libmpv
diff options
context:
space:
mode:
authorLongChair <longchair@hotmail.com>2018-04-29 15:09:16 +0200
committerJan Ekström <jeebjp@gmail.com>2018-05-01 20:48:02 +0300
commit9f2970f28a28076897fda1100de2b6eb9a92be79 (patch)
tree7cd8db166d6b6c621684cdd9750866c9842c454a /libmpv
parent11f915f5ef7d622a225bee6ab98ee6a9da34991f (diff)
downloadmpv-9f2970f28a28076897fda1100de2b6eb9a92be79.tar.bz2
mpv-9f2970f28a28076897fda1100de2b6eb9a92be79.tar.xz
drm/atomic: refactor hwdec_drmprime_drm with native resources
That new API was introduced and allows to have several native resources. Thisuses that mechanisma for drm resources rather than the deprecated opengl-cb structs. This patch therefore add two structs that can be used with the drm atomic interop. - mpv_opengl_drm_params : which will hold all the drm handles - mpv_opengl_drm_osd_size : which will hold osd layer size This commit adds a drm-osd-size=WxH parameter to commandline which allows to define the OSD plane dimension. OSD can be upscaled to screen resolution when having OSD at video resolution is too heavy. This is especially useful for UHD modes on embedded devices where the GPU cannot handle UHD modes at a decent framerate.
Diffstat (limited to 'libmpv')
-rw-r--r--libmpv/render.h12
-rw-r--r--libmpv/render_gl.h31
2 files changed, 43 insertions, 0 deletions
diff --git a/libmpv/render.h b/libmpv/render.h
index 5a39d4e1c6..253b2b43f9 100644
--- a/libmpv/render.h
+++ b/libmpv/render.h
@@ -276,6 +276,18 @@ typedef enum mpv_render_param_type {
* in the same way.
*/
MPV_RENDER_PARAM_SKIP_RENDERING = 13,
+ /**
+ * DRM display, contains drm display handles.
+ * Valid for mpv_render_context_create().
+ * Type : struct mpv_opengl_drm_params*
+ */
+ MPV_RENDER_PARAM_DRM_DISPLAY = 14,
+ /**
+ * DRM osd size, contains osd dimensions.
+ * Valid for mpv_render_context_create().
+ * Type : struct mpv_opengl_drm_osd_size*
+ */
+ MPV_RENDER_PARAM_DRM_OSD_SIZE = 15,
} mpv_render_param_type;
/**
diff --git a/libmpv/render_gl.h b/libmpv/render_gl.h
index a4872a066b..574be86ffd 100644
--- a/libmpv/render_gl.h
+++ b/libmpv/render_gl.h
@@ -147,6 +147,37 @@ typedef struct mpv_opengl_fbo {
int internal_format;
} mpv_opengl_fbo;
+typedef struct mpv_opengl_drm_params {
+ /**
+ * DRM fd (int). set this to -1 if invalid.
+ */
+ int fd;
+
+ /**
+ * Currently used crtc id
+ */
+ int crtc_id;
+
+ /**
+ * Currently used connector id
+ */
+ int connector_id;
+
+ /**
+ * Pointer to a drmModeAtomicReq pointer that is being used for the renderloop.
+ * This pointer should hold a pointer to the atomic request pointer
+ * The atomic request pointer is usually changed at every renderloop.
+ */
+ struct _drmModeAtomicReq **atomic_request_ptr;
+} mpv_opengl_drm_params;
+
+typedef struct mpv_opengl_drm_osd_size {
+ /**
+ * size of the OSD in pixels.
+ */
+ int width, height;
+} mpv_opengl_drm_osd_size;
+
#ifdef __cplusplus
}
#endif