]> git.pld-linux.org Git - packages/vlc.git/blame - vlc-libplacebo-5.patch
- release 4 (libvpx 1.14)
[packages/vlc.git] / vlc-libplacebo-5.patch
CommitLineData
387d11ec
JB
1patch vaguely ported from: https://code.videolan.org/videolan/vlc/-/merge_requests/2233
2
3diff --git a/modules/video_output/opengl/converter.h b/modules/video_output/opengl/converter.h
4index 7000e1f..49fa667 100644
5--- a/modules/video_output/opengl/converter.h
6+++ b/modules/video_output/opengl/converter.h
7@@ -26,6 +26,9 @@
8 #include <vlc_picture_pool.h>
9 #include <vlc_opengl.h>
10
11+#include <libplacebo/log.h>
12+#include <libplacebo/shaders.h>
13+
14 /* if USE_OPENGL_ES2 is defined, OpenGL ES version 2 will be used, otherwise
15 * normal OpenGL will be used */
16 #ifdef __APPLE__
17@@ -253,10 +256,6 @@ static inline bool HasExtension(const char *apis, const char *api)
18 return false;
19 }
20
21-struct pl_context;
22-struct pl_shader;
23-struct pl_shader_res;
24-
25 /*
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
29 vlc_gl_t *gl;
30
31 /* libplacebo context, created by the caller (optional) */
32- struct pl_context *pl_ctx;
33+ pl_log pl_log;
34
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
38 bool yuv_color;
39 GLfloat yuv_coefficients[16];
40
41- struct pl_shader *pl_sh;
42+ pl_shader pl_sh;
43 const struct pl_shader_res *pl_sh_res;
44
45 /* Private context */
46diff --git a/modules/video_output/opengl/fragment_shaders.c b/modules/video_output/opengl/fragment_shaders.c
47index 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,
51
52 #ifdef HAVE_LIBPLACEBO
53 if (tc->pl_sh) {
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);
62
63- struct pl_shader_obj *dither_state = NULL;
64+ pl_shader_obj dither_state = NULL;
65 int method = var_InheritInteger(tc->gl, "dither-algo");
66 if (method >= 0) {
67
68diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c
69index 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)
73
74 #ifdef HAVE_LIBPLACEBO
75 FREENULL(tc->uloc.pl_vars);
76- if (tc->pl_ctx)
77- pl_context_destroy(&tc->pl_ctx);
78+ pl_log_destroy(&tc->pl_log);
79 #endif
80
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
84 if (!subpics)
85 {
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) {
88 .log_cb = log_cb,
89 .log_priv = tc,
90 .log_level = PL_LOG_INFO,
91 });
92- if (tc->pl_ctx) {
93+ if (tc->pl_log) {
94 # if PL_API_VER >= 20
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,
99 });
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);
103 # else
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);
106 # endif
107 }
108 }
This page took 0.382077 seconds and 4 git commands to generate.