summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-11-04 14:42:50 +0100
committerwm4 <wm4@nowhere>2015-11-04 21:49:54 +0100
commitf00edfd9c57367478927cb58adbbc21e3d62e237 (patch)
tree8e519670d86391c4322760747f81718d36b140a7 /video
parente6a395c2979689761a5d86bdf1863530f5553f9d (diff)
downloadmpv-f00edfd9c57367478927cb58adbbc21e3d62e237.tar.bz2
mpv-f00edfd9c57367478927cb58adbbc21e3d62e237.tar.xz
vo_opengl_cb: log some events
The noframe event is logged whenever there is no new frame. This can happen due to normal redraws, but also due to video frame queue underflow. The mpv_opengl_cb_report_flip() API function is currently pretty useless, because blocking on the video frame queue is more reliable and simpler. But at least we can log the actual vsync.
Diffstat (limited to 'video')
-rw-r--r--video/out/vo_opengl_cb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/video/out/vo_opengl_cb.c b/video/out/vo_opengl_cb.c
index 179fbce684..29b22939cf 100644
--- a/video/out/vo_opengl_cb.c
+++ b/video/out/vo_opengl_cb.c
@@ -354,6 +354,7 @@ int mpv_opengl_cb_draw(mpv_opengl_cb_context *ctx, int fbo, int vp_w, int vp_h)
frame = vo_frame_ref(ctx->cur_frame);
if (frame)
frame->redraw = true;
+ MP_STATS(ctx, "glcb-noframe");
}
struct vo_frame dummy = {0};
if (!frame)
@@ -361,6 +362,7 @@ int mpv_opengl_cb_draw(mpv_opengl_cb_context *ctx, int fbo, int vp_w, int vp_h)
pthread_mutex_unlock(&ctx->lock);
+ MP_STATS(ctx, "glcb-render");
gl_video_render_frame(ctx->renderer, frame, fbo);
gl_video_unset_gl_state(ctx->renderer);
@@ -379,6 +381,8 @@ int mpv_opengl_cb_draw(mpv_opengl_cb_context *ctx, int fbo, int vp_w, int vp_h)
int mpv_opengl_cb_report_flip(mpv_opengl_cb_context *ctx, int64_t time)
{
+ MP_STATS(ctx, "glcb-reportflip");
+
pthread_mutex_lock(&ctx->lock);
ctx->recent_flip = time > 0 ? time : mp_time_us();
pthread_mutex_unlock(&ctx->lock);