1 patch vaguely ported from: https://code.videolan.org/videolan/vlc/-/merge_requests/2233
3 diff --git a/modules/video_output/opengl/converter.h b/modules/video_output/opengl/converter.h
4 index 7000e1f..49fa667 100644
5 --- a/modules/video_output/opengl/converter.h
6 +++ b/modules/video_output/opengl/converter.h
8 #include <vlc_picture_pool.h>
9 #include <vlc_opengl.h>
11 +#include <libplacebo/log.h>
12 +#include <libplacebo/shaders.h>
14 /* if USE_OPENGL_ES2 is defined, OpenGL ES version 2 will be used, otherwise
15 * normal OpenGL will be used */
17 @@ -253,10 +256,6 @@ static inline bool HasExtension(const char *apis, const char *api)
23 -struct pl_shader_res;
26 * Structure that is filled by "glhw converter" module probe function
27 * The implementation should initialize every members of the struct that are
28 @@ -273,7 +272,7 @@ struct opengl_tex_converter_t
31 /* libplacebo context, created by the caller (optional) */
32 - struct pl_context *pl_ctx;
35 /* Function pointers to OpenGL functions, set by the caller */
36 const opengl_vtable_t *vt;
37 @@ -337,7 +336,7 @@ struct opengl_tex_converter_t
39 GLfloat yuv_coefficients[16];
41 - struct pl_shader *pl_sh;
43 const struct pl_shader_res *pl_sh_res;
46 diff --git a/modules/video_output/opengl/fragment_shaders.c b/modules/video_output/opengl/fragment_shaders.c
47 index ecf7226..29f4148 100644
48 --- a/modules/video_output/opengl/fragment_shaders.c
49 +++ b/modules/video_output/opengl/fragment_shaders.c
50 @@ -611,7 +611,7 @@ opengl_fragment_shader_init_impl(opengl_tex_converter_t *tc, GLenum tex_target,
52 #ifdef HAVE_LIBPLACEBO
54 - struct pl_shader *sh = tc->pl_sh;
55 + pl_shader sh = tc->pl_sh;
56 struct pl_color_map_params color_params = pl_color_map_default_params;
57 color_params.intent = var_InheritInteger(tc->gl, "rendering-intent");
58 color_params.tone_mapping_algo = var_InheritInteger(tc->gl, "tone-mapping");
59 @@ -634,7 +634,7 @@ opengl_fragment_shader_init_impl(opengl_tex_converter_t *tc, GLenum tex_target,
60 pl_color_space_from_video_format(&tc->fmt),
61 dst_space, NULL, false);
63 - struct pl_shader_obj *dither_state = NULL;
64 + pl_shader_obj dither_state = NULL;
65 int method = var_InheritInteger(tc->gl, "dither-algo");
68 diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c
69 index 13d65e0..1ee99af 100644
70 --- a/modules/video_output/opengl/vout_helper.c
71 +++ b/modules/video_output/opengl/vout_helper.c
72 @@ -570,8 +570,7 @@ opengl_deinit_program(vout_display_opengl_t *vgl, struct prgm *prgm)
74 #ifdef HAVE_LIBPLACEBO
75 FREENULL(tc->uloc.pl_vars);
77 - pl_context_destroy(&tc->pl_ctx);
78 + pl_log_destroy(&tc->pl_log);
81 vlc_object_release(tc);
82 @@ -622,21 +621,21 @@ opengl_init_program(vout_display_opengl_t *vgl, struct prgm *prgm,
83 // create the main libplacebo context
86 - tc->pl_ctx = pl_context_create(PL_API_VER, &(struct pl_context_params) {
87 + tc->pl_log = pl_log_create(PL_API_VER, &(struct pl_log_params) {
90 .log_level = PL_LOG_INFO,
95 - tc->pl_sh = pl_shader_alloc(tc->pl_ctx, &(struct pl_shader_params) {
96 + tc->pl_sh = pl_shader_alloc(tc->pl_log, &(struct pl_shader_params) {
97 .glsl.version = tc->glsl_version,
98 .glsl.gles = tc->is_gles,
100 # elif PL_API_VER >= 6
101 - tc->pl_sh = pl_shader_alloc(tc->pl_ctx, NULL, 0);
102 + tc->pl_sh = pl_shader_alloc(tc->pl_log, NULL, 0);
104 - tc->pl_sh = pl_shader_alloc(tc->pl_ctx, NULL, 0, 0);
105 + tc->pl_sh = pl_shader_alloc(tc->pl_log, NULL, 0, 0);