diff options
author | rr- <rr-@sakuya.pl> | 2016-09-24 14:59:31 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-09-26 19:26:31 +0200 |
commit | 0fe3e9ca5e8e42761424b37d67b46e12514f240f (patch) | |
tree | d2aaebf35eb539124984cd4c6e96fff14fb59656 /video/out/opengl/context_drm_egl.c | |
parent | 9f30cd8292b4b7bfe5d7db29fe31a07cc76dec2c (diff) | |
download | mpv-0fe3e9ca5e8e42761424b37d67b46e12514f240f.tar.bz2 mpv-0fe3e9ca5e8e42761424b37d67b46e12514f240f.tar.xz |
vo_drm: provide display fps
Diffstat (limited to 'video/out/opengl/context_drm_egl.c')
-rw-r--r-- | video/out/opengl/context_drm_egl.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/video/out/opengl/context_drm_egl.c b/video/out/opengl/context_drm_egl.c index f3c0c660be..07624ccaf3 100644 --- a/video/out/opengl/context_drm_egl.c +++ b/video/out/opengl/context_drm_egl.c @@ -359,6 +359,20 @@ static int drm_egl_reconfig(struct MPGLContext *ctx) static int drm_egl_control(struct MPGLContext *ctx, int *events, int request, void *arg) { + struct priv *p = ctx->priv; + switch (request) { + case VOCTRL_GET_DISPLAY_FPS: { + double fps = + p->kms->mode.clock + * 1000.0 + / p->kms->mode.htotal + / p->kms->mode.vtotal; + if (fps <= 0) + break; + *(double*)arg = fps; + return VO_TRUE; + } + } return VO_NOTIMPL; } |