From 833375f88d0392cac49b30ee3a4704fbab58e814 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 4 May 2016 16:55:26 +0200 Subject: command: change some hwdec properties Introduce hwdec-current and hwdec-interop properties. Deprecate hwdec-detected, which never made a lot of sense, and which is replaced by the new properties. hwdec-active also becomes useless, as hwdec-current is a superset, so it's deprecated too (for now). --- video/hwdec.h | 1 + video/out/opengl/hwdec.c | 2 ++ video/out/opengl/hwdec.h | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'video') diff --git a/video/hwdec.h b/video/hwdec.h index 377f6779d1..94667774e7 100644 --- a/video/hwdec.h +++ b/video/hwdec.h @@ -26,6 +26,7 @@ extern const struct m_opt_choice_alternatives mp_hwdec_names[]; struct mp_hwdec_ctx { enum hwdec_type type; + const char *driver_name; // NULL if unknown/not loaded void *priv; // for free use by hwdec implementation diff --git a/video/out/opengl/hwdec.c b/video/out/opengl/hwdec.c index 02aa0c2cd2..9c3bec1a0f 100644 --- a/video/out/opengl/hwdec.c +++ b/video/out/opengl/hwdec.c @@ -79,6 +79,8 @@ static struct gl_hwdec *load_hwdec_driver(struct mp_log *log, GL *gl, mp_verbose(log, "Loading failed.\n"); return NULL; } + if (hwdec->hwctx && !hwdec->hwctx->driver_name) + hwdec->hwctx->driver_name = hwdec->driver->name; return hwdec; } diff --git a/video/out/opengl/hwdec.h b/video/out/opengl/hwdec.h index 5126d7f0fa..a9d524a1d7 100644 --- a/video/out/opengl/hwdec.h +++ b/video/out/opengl/hwdec.h @@ -27,7 +27,7 @@ struct gl_hwdec { }; struct gl_hwdec_driver { - // Name of the interop backend. This is used for logging only. + // Name of the interop backend. This is used for informational purposes only. const char *name; // Used to explicitly request a specific API. enum hwdec_type api; -- cgit v1.2.3