summaryrefslogtreecommitdiffstats
path: root/video/out/gpu/context.h
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2022-10-26 23:23:49 -0500
committerDudemanguy <random342@airmail.cc>2022-10-28 02:36:46 +0000
commitadb556bf15e9b09afce6c9cb0a0911c53cf27feb (patch)
tree06761b1b1ae91f1d7433855f645480e28d96300b /video/out/gpu/context.h
parent31af37f87762e5e548fa234b30f6248d8d6c19e4 (diff)
downloadmpv-adb556bf15e9b09afce6c9cb0a0911c53cf27feb.tar.bz2
mpv-adb556bf15e9b09afce6c9cb0a0911c53cf27feb.tar.xz
vo_dmabuf_wayland: use special ra_ctx_create_by_name
vo_dmabuf_wayland has its own ra and context so it can handle all the different hwdec correctly. Unfortunately, this API was pretty clearly designed with vo_gpu/vo_gpu_next in mind and has a lot of concepts that don't make sense for vo_dmabuf_wayland. We still want to bolt on a ra_ctx, but instead let's rework the ra_ctx logic a little bit. First, this introduces a hidden bool within the ra_ctx_fns that is used to hide the wldmabuf context from users as an option (unlike the other usual contexts). We also want to make sure that hidden contexts wouldn't be autoprobed in the usual ra_ctx_create, so we be sure to skip those in that function. Additionally, let's create a new ra_ctx_create_by_name function which does exactly what says. It specifically selects a context based on a passed string. This function has no probing or option logic is simplified just for what vo_dmabuf_wayland needs. The api/context validations functions are modified just a little bit to make sure hidden contexts are skipped and the documentation is updated to remove this entries. Fixes #10793.
Diffstat (limited to 'video/out/gpu/context.h')
-rw-r--r--video/out/gpu/context.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/video/out/gpu/context.h b/video/out/gpu/context.h
index 7ad37f0d61..72ad65f470 100644
--- a/video/out/gpu/context.h
+++ b/video/out/gpu/context.h
@@ -36,6 +36,8 @@ struct ra_ctx_fns {
const char *type; // API type (for --gpu-api)
const char *name; // name (for --gpu-context)
+ bool hidden; // hide the ra_ctx from users
+
// Resize the window, or create a new window if there isn't one yet.
// Currently, there is an unfortunate interaction with ctx->vo, and
// display size etc. are determined by it.
@@ -101,3 +103,6 @@ struct ra_swapchain_fns {
// the underlying `struct ra`, and perhaps the underlying VO backend.
struct ra_ctx *ra_ctx_create(struct vo *vo, struct ra_ctx_opts opts);
void ra_ctx_destroy(struct ra_ctx **ctx);
+
+// Special case of creating a ra_ctx while specifiying a specific context by name.
+struct ra_ctx *ra_ctx_create_by_name(struct vo *vo, const char *name);