diff options
Diffstat (limited to 'video/out/gpu/context.h')
-rw-r--r-- | video/out/gpu/context.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/video/out/gpu/context.h b/video/out/gpu/context.h index 8c35eb0fc0..d2ab783bd7 100644 --- a/video/out/gpu/context.h +++ b/video/out/gpu/context.h @@ -3,16 +3,19 @@ #include "video/out/vo.h" #include "video/csputils.h" -#include "config.h" #include "ra.h" struct ra_ctx_opts { - int allow_sw; // allow software renderers - int want_alpha; // create an alpha framebuffer if possible - int debug; // enable debugging layers/callbacks etc. + bool allow_sw; // allow software renderers + bool want_alpha; // create an alpha framebuffer if possible + bool debug; // enable debugging layers/callbacks etc. bool probing; // the backend was auto-probed + struct m_obj_settings *context_list; // list of `ra_ctx_fns.name` to probe + char *context_type; // filter by `ra_ctx_fns.type` }; +extern const struct m_sub_options ra_ctx_conf; + struct ra_ctx { struct vo *vo; struct ra *ra; @@ -31,6 +34,7 @@ struct ra_ctx { struct ra_ctx_fns { const char *type; // API type (for --gpu-api) const char *name; // name (for --gpu-context) + const char *description; // description (for --gpu-context=help) // Resize the window, or create a new window if there isn't one yet. // Currently, there is an unfortunate interaction with ctx->vo, and @@ -43,7 +47,7 @@ struct ra_ctx_fns { // These behave exactly like vo_driver.wakeup/wait_events. They are // optional. void (*wakeup)(struct ra_ctx *ctx); - void (*wait_events)(struct ra_ctx *ctx, int64_t until_time_us); + void (*wait_events)(struct ra_ctx *ctx, int64_t until_time_ns); void (*update_render_opts)(struct ra_ctx *ctx); // Initialize/destroy the 'struct ra' and possibly the underlying VO backend. @@ -67,7 +71,7 @@ struct ra_fbo { // Host system's colorspace that it will be interpreting // the frame buffer as. - struct mp_colorspace color_space; + struct pl_color_space color_space; }; struct ra_swapchain_fns { @@ -95,12 +99,8 @@ struct ra_swapchain_fns { // Create and destroy a ra_ctx. This also takes care of creating and destroying // the underlying `struct ra`, and perhaps the underlying VO backend. -struct ra_ctx *ra_ctx_create(struct vo *vo, const char *context_type, - const char *context_name, struct ra_ctx_opts opts); +struct ra_ctx *ra_ctx_create(struct vo *vo, struct ra_ctx_opts opts); void ra_ctx_destroy(struct ra_ctx **ctx); -struct m_option; -int ra_ctx_validate_api(struct mp_log *log, const struct m_option *opt, - struct bstr name, struct bstr param); -int ra_ctx_validate_context(struct mp_log *log, const struct m_option *opt, - struct bstr name, struct bstr param); +// Special case of creating a ra_ctx while specifying a specific context by name. +struct ra_ctx *ra_ctx_create_by_name(struct vo *vo, const char *name); |