diff options
author | Niklas Haas <git@haasn.dev> | 2022-10-05 21:41:36 +0200 |
---|---|---|
committer | Niklas Haas <github-daiK1o@haasn.dev> | 2022-10-09 21:47:35 +0200 |
commit | c96cee29406bcd5ba0fcfa948386ab229042a028 (patch) | |
tree | fbfac15459b7c9a4eca8fe3e0168c1c9a28fcedd | |
parent | 3f32dfe9813ca601bd7ba1d2136e4bff0bf49cd2 (diff) | |
download | mpv-c96cee29406bcd5ba0fcfa948386ab229042a028.tar.bz2 mpv-c96cee29406bcd5ba0fcfa948386ab229042a028.tar.xz |
vo_gpu_next: vulkan: libplacebo: unify log prefix
The new status quo is simple: all messages coming from libplacebo are
marked "vo/gpu{-next}/libplacebo", regardless of the backend API (vulkan
vs opengl/d3d11).
Messages coming from mpv's internal vulkan code will continue to come
from "vo/gpu{-next}/vulkan", and messages coming from the vo module
itself will be marked "vo/gpu{-next}".
This is significantly better than the old status quo of vulkan messages
coming from "vo/gpu{-next}/vulkan/libplacebo" whereas opengl/d3d11
messages simply came from "vo/gpu{-next}", even when those messages
originated from libplacebo.
(It's worth noting that the the destructor for the log is redundant
because it's attached to the ctx which is freed on uninit anyway)
-rw-r--r-- | video/out/gpu_next/context.c | 2 | ||||
-rw-r--r-- | video/out/placebo/utils.c | 4 | ||||
-rw-r--r-- | video/out/placebo/utils.h | 2 | ||||
-rw-r--r-- | video/out/vulkan/common.h | 1 | ||||
-rw-r--r-- | video/out/vulkan/utils.c | 4 |
5 files changed, 5 insertions, 8 deletions
diff --git a/video/out/gpu_next/context.c b/video/out/gpu_next/context.c index b825eab243..3863d6bc40 100644 --- a/video/out/gpu_next/context.c +++ b/video/out/gpu_next/context.c @@ -127,7 +127,7 @@ struct gpu_ctx *gpu_ctx_create(struct vo *vo, struct gl_video_opts *gl_opts) } #endif - ctx->pllog = mppl_log_create(ctx->log); + ctx->pllog = mppl_log_create(ctx, ctx->log); if (!ctx->pllog) goto err_out; diff --git a/video/out/placebo/utils.c b/video/out/placebo/utils.c index dd873160c3..a3d852fb14 100644 --- a/video/out/placebo/utils.c +++ b/video/out/placebo/utils.c @@ -48,12 +48,12 @@ static void log_cb_probing(void *priv, enum pl_log_level level, const char *msg) mp_msg(log, pl_log_to_msg_lev[probing_map(level)], "%s\n", msg); } -pl_log mppl_log_create(struct mp_log *log) +pl_log mppl_log_create(void *tactx, struct mp_log *log) { return pl_log_create(PL_API_VER, &(struct pl_log_params) { .log_cb = log_cb, .log_level = msg_lev_to_pl_log[mp_msg_level(log)], - .log_priv = log, + .log_priv = mp_log_new(tactx, log, "libplacebo"), }); } diff --git a/video/out/placebo/utils.h b/video/out/placebo/utils.h index c897b5e013..ca0f065a8c 100644 --- a/video/out/placebo/utils.h +++ b/video/out/placebo/utils.h @@ -8,7 +8,7 @@ #include <libplacebo/log.h> #include <libplacebo/colorspace.h> -pl_log mppl_log_create(struct mp_log *log); +pl_log mppl_log_create(void *tactx, struct mp_log *log); void mppl_log_set_probing(pl_log log, bool probing); static inline struct pl_rect2d mp_rect2d_to_pl(struct mp_rect rc) diff --git a/video/out/vulkan/common.h b/video/out/vulkan/common.h index 75c80402cb..85e6c50f4b 100644 --- a/video/out/vulkan/common.h +++ b/video/out/vulkan/common.h @@ -27,7 +27,6 @@ // Shared struct used to hold vulkan context information struct mpvk_ctx { - struct mp_log *log; pl_log pllog; pl_vk_inst vkinst; pl_vulkan vulkan; diff --git a/video/out/vulkan/utils.c b/video/out/vulkan/utils.c index cd69334aa9..14b1ed7bc4 100644 --- a/video/out/vulkan/utils.c +++ b/video/out/vulkan/utils.c @@ -3,8 +3,7 @@ bool mpvk_init(struct mpvk_ctx *vk, struct ra_ctx *ctx, const char *surface_ext) { - vk->log = mp_log_new(ctx, ctx->log, "libplacebo"); - vk->pllog = mppl_log_create(vk->log); + vk->pllog = mppl_log_create(ctx, ctx->vo->log); if (!vk->pllog) goto error; @@ -40,5 +39,4 @@ void mpvk_uninit(struct mpvk_ctx *vk) pl_vk_inst_destroy(&vk->vkinst); pl_log_destroy(&vk->pllog); - TA_FREEP(&vk->log); } |