summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-11-08 00:03:51 +0100
committersfan5 <sfan5@live.de>2023-11-22 11:43:20 +0100
commit73eecdb415f2a7499b0ae41a7af5e924319068ae (patch)
tree226751afa42361758805db1c0556bc68926078fd
parent66e3b53eb930e1dba7d10c9dc52f45af06932e88 (diff)
downloadmpv-73eecdb415f2a7499b0ae41a7af5e924319068ae.tar.bz2
mpv-73eecdb415f2a7499b0ae41a7af5e924319068ae.tar.xz
vaapi: pass module into create()
Useful for logging
-rw-r--r--video/vaapi.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/video/vaapi.c b/video/vaapi.c
index 08248a7388..ac0f8c48a0 100644
--- a/video/vaapi.c
+++ b/video/vaapi.c
@@ -21,6 +21,7 @@
#include "vaapi.h"
#include "common/common.h"
+#include "common/global.h"
#include "common/msg.h"
#include "osdep/threads.h"
#include "mp_image.h"
@@ -166,8 +167,8 @@ bool va_guess_if_emulated(struct mp_vaapi_ctx *ctx)
}
struct va_native_display {
- void (*create)(VADisplay **out_display, void **out_native_ctx,
- const char *path);
+ void (*create)(struct mp_log *log, VADisplay **out_display,
+ void **out_native_ctx, const char *path);
void (*destroy)(void *native_ctx);
};
@@ -180,8 +181,8 @@ static void x11_destroy(void *native_ctx)
XCloseDisplay(native_ctx);
}
-static void x11_create(VADisplay **out_display, void **out_native_ctx,
- const char *path)
+static void x11_create(struct mp_log *log, VADisplay **out_display,
+ void **out_native_ctx, const char *path)
{
void *native_display = XOpenDisplay(NULL);
if (!native_display)
@@ -216,8 +217,8 @@ static void drm_destroy(void *native_ctx)
talloc_free(ctx);
}
-static void drm_create(VADisplay **out_display, void **out_native_ctx,
- const char *path)
+static void drm_create(struct mp_log *log, VADisplay **out_display,
+ void **out_native_ctx, const char *path)
{
int drm_fd = open(path, O_RDWR);
if (drm_fd < 0)
@@ -260,7 +261,7 @@ static struct AVBufferRef *va_create_standalone(struct mpv_global *global,
for (int n = 0; native_displays[n]; n++) {
VADisplay *display = NULL;
void *native_ctx = NULL;
- native_displays[n]->create(&display, &native_ctx, opts->path);
+ native_displays[n]->create(global->log, &display, &native_ctx, opts->path);
if (display) {
struct mp_vaapi_ctx *ctx =
va_initialize(display, log, params->probing);