aboutsummaryrefslogtreecommitdiffhomepage
path: root/video
diff options
context:
space:
mode:
authorGravatar Akemi <der.richter@gmx.de>2018-06-04 19:13:15 +0200
committerGravatar Jan Ekström <jeebjp@gmail.com>2018-11-13 20:43:29 +0200
commite72093581bdf07784d6889035c3751cbc7fb8ca0 (patch)
tree3d5f3b7df900c83554587b019c20325520e03fb7 /video
parent9e466ee6214ed302a6846dd40264cf06eb712b3a (diff)
vo_libmpv: support render performance data
Diffstat (limited to 'video')
-rw-r--r--video/out/gpu/libmpv_gpu.c9
-rw-r--r--video/out/libmpv.h2
-rw-r--r--video/out/vo_libmpv.c14
3 files changed, 25 insertions, 0 deletions
diff --git a/video/out/gpu/libmpv_gpu.c b/video/out/gpu/libmpv_gpu.c
index fce2acfa4d..f597d2bb29 100644
--- a/video/out/gpu/libmpv_gpu.c
+++ b/video/out/gpu/libmpv_gpu.c
@@ -207,6 +207,14 @@ static void screenshot(struct render_backend *ctx, struct vo_frame *frame,
gl_video_screenshot(p->renderer, frame, args);
}
+static void perfdata(struct render_backend *ctx,
+ struct voctrl_performance_data *out)
+{
+ struct priv *p = ctx->priv;
+
+ gl_video_perfdata(p->renderer, out);
+}
+
static void destroy(struct render_backend *ctx)
{
struct priv *p = ctx->priv;
@@ -235,5 +243,6 @@ const struct render_backend_fns render_backend_gpu = {
.render = render,
.get_image = get_image,
.screenshot = screenshot,
+ .perfdata = perfdata,
.destroy = destroy,
};
diff --git a/video/out/libmpv.h b/video/out/libmpv.h
index 2fe33386f4..329b2dffec 100644
--- a/video/out/libmpv.h
+++ b/video/out/libmpv.h
@@ -54,6 +54,8 @@ struct render_backend_fns {
void (*reset)(struct render_backend *ctx);
void (*screenshot)(struct render_backend *ctx, struct vo_frame *frame,
struct voctrl_screenshot *args);
+ void (*perfdata)(struct render_backend *ctx,
+ struct voctrl_performance_data *out);
// Like vo_driver.get_image().
struct mp_image *(*get_image)(struct render_backend *ctx, int imgfmt,
int w, int h, int stride_align);
diff --git a/video/out/vo_libmpv.c b/video/out/vo_libmpv.c
index 1df63a5197..b09c2c21a7 100644
--- a/video/out/vo_libmpv.c
+++ b/video/out/vo_libmpv.c
@@ -573,6 +573,13 @@ static void run_control_on_render_thread(void *p)
talloc_free(frame);
break;
}
+ case VOCTRL_PERFORMANCE_DATA: {
+ if (ctx->renderer->fns->perfdata) {
+ ctx->renderer->fns->perfdata(ctx->renderer, data);
+ ret = VO_TRUE;
+ }
+ break;
+ }
}
*(int *)args[3] = ret;
@@ -620,6 +627,13 @@ static int control(struct vo *vo, uint32_t request, void *data)
mp_dispatch_run(ctx->dispatch, run_control_on_render_thread, args);
return ret;
}
+ case VOCTRL_PERFORMANCE_DATA:
+ if (ctx->dispatch) {
+ int ret;
+ void *args[] = {ctx, (void *)(intptr_t)request, data, &ret};
+ mp_dispatch_run(ctx->dispatch, run_control_on_render_thread, args);
+ return ret;
+ }
}
int r = VO_NOTIMPL;