summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authornanahi <130121847+na-na-hi@users.noreply.github.com>2023-12-20 23:05:31 -0500
committerDudemanguy <random342@airmail.cc>2024-01-20 17:12:07 +0000
commita0ba10b62e75329d1c707d9f95052c8c66323ac7 (patch)
treebffb7c9583fbb4fa5a20a828df29f79c9e8fa271 /player
parent700f72f8e424486633b1c8da9313182e63072592 (diff)
downloadmpv-a0ba10b62e75329d1c707d9f95052c8c66323ac7.tar.bz2
mpv-a0ba10b62e75329d1c707d9f95052c8c66323ac7.tar.xz
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.
Diffstat (limited to 'player')
-rw-r--r--player/command.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/player/command.c b/player/command.c
index 9fb420fe00..27a06d46e3 100644
--- a/player/command.c
+++ b/player/command.c
@@ -2766,6 +2766,13 @@ static int mp_property_vo(void *ctx, struct m_property *p, int action, void *arg
mpctx->video_out ? mpctx->video_out->driver->name : NULL);
}
+static int mp_property_gpu_context(void *ctx, struct m_property *p, int action, void *arg)
+{
+ MPContext *mpctx = ctx;
+ return m_property_strdup_ro(action, arg,
+ mpctx->video_out ? mpctx->video_out->context_name : NULL);
+}
+
static int mp_property_osd_dim(void *ctx, struct m_property *prop,
int action, void *arg)
{
@@ -3923,6 +3930,7 @@ static const struct m_property mp_properties_base[] = {
{"vo-passes", mp_property_vo_passes},
{"perf-info", mp_property_perf_info},
{"current-vo", mp_property_vo},
+ {"current-gpu-context", mp_property_gpu_context},
{"container-fps", mp_property_fps},
{"estimated-vf-fps", mp_property_vf_fps},
{"video-aspect-override", mp_property_video_aspect_override},