From 0fe3e9ca5e8e42761424b37d67b46e12514f240f Mon Sep 17 00:00:00 2001 From: rr- Date: Sat, 24 Sep 2016 14:59:31 +0200 Subject: vo_drm: provide display fps --- video/out/opengl/context_drm_egl.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'video/out/opengl/context_drm_egl.c') 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; } -- cgit v1.2.3