From a0ba10b62e75329d1c707d9f95052c8c66323ac7 Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Wed, 20 Dec 2023 23:05:31 -0500 Subject: command: export current-gpu-context property This exports `current-gpu-context` property, which is the string description of the current active GPU context. This allows scripts to uniquely identify the platform and backend used for --vo=gpu and --vo=gpu-next. --- video/out/gpu/context.c | 1 + video/out/vo.h | 3 +++ 2 files changed, 4 insertions(+) (limited to 'video/out') diff --git a/video/out/gpu/context.c b/video/out/gpu/context.c index 5ce18afbe2..41ec2a4107 100644 --- a/video/out/gpu/context.c +++ b/video/out/gpu/context.c @@ -208,6 +208,7 @@ struct ra_ctx *ra_ctx_create(struct vo *vo, struct ra_ctx_opts opts) MP_VERBOSE(ctx, "Initializing GPU context '%s'\n", ctx->fns->name); if (contexts[i]->init(ctx)) { vo->probing = old_probing; + vo->context_name = ctx->fns->name; return ctx; } diff --git a/video/out/vo.h b/video/out/vo.h index 40c5746992..e9e2f02901 100644 --- a/video/out/vo.h +++ b/video/out/vo.h @@ -494,6 +494,9 @@ struct vo { int dwidth; int dheight; float monitor_par; + + // current GPU context (--vo=gpu and --vo=gpu-next only) + const char *context_name; }; struct mpv_global; -- cgit v1.2.3