[vlc-devel] [PATCH v2 08/17] opengl: reference common objects from sampler

Romain Vimont rom1v at videolabs.io
Thu May 14 15:38:06 CEST 2020


For convenience, expose the vlc_gl_t and the OpenGL virtual table in
sampler.
---
 modules/video_output/opengl/sampler.c | 2 ++
 modules/video_output/opengl/sampler.h | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/modules/video_output/opengl/sampler.c b/modules/video_output/opengl/sampler.c
index 761bfa13d75..28c57829fa8 100644
--- a/modules/video_output/opengl/sampler.c
+++ b/modules/video_output/opengl/sampler.c
@@ -52,6 +52,8 @@ vlc_gl_sampler_New(struct vlc_gl_interop *interop)
     sampler->pl_sh_res = NULL;
 
     sampler->interop = interop;
+    sampler->gl = interop->gl;
+    sampler->vt = interop->vt;
 
 #ifdef HAVE_LIBPLACEBO
     // Create the main libplacebo context
diff --git a/modules/video_output/opengl/sampler.h b/modules/video_output/opengl/sampler.h
index 64e5e30e1f9..1211f29953d 100644
--- a/modules/video_output/opengl/sampler.h
+++ b/modules/video_output/opengl/sampler.h
@@ -50,6 +50,9 @@
  * implicitly available.
  */
 struct vlc_gl_sampler {
+    struct vlc_gl_t *gl;
+    const opengl_vtable_t *vt;
+
     struct {
         GLfloat OrientationMatrix[4*4];
         GLfloat TexCoordsMap[PICTURE_PLANE_MAX][3*3];
-- 
2.26.2



More information about the vlc-devel mailing list