[vlc-devel] [PATCH 07/10] opengl: expose video format in sampler

Romain Vimont rom1v at videolabs.io
Wed May 20 16:08:18 CEST 2020


For convenience, expose the video format directly 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 6f3ab54c49c2..ed8c97f462e2 100644
--- a/modules/video_output/opengl/sampler.c
+++ b/modules/video_output/opengl/sampler.c
@@ -56,6 +56,8 @@ vlc_gl_sampler_New(struct vlc_gl_interop *interop)
     sampler->gl = interop->gl;
     sampler->vt = interop->vt;
 
+    sampler->fmt = &interop->sw_fmt;
+
     sampler->shader.extensions = NULL;
     sampler->shader.body = NULL;
 
diff --git a/modules/video_output/opengl/sampler.h b/modules/video_output/opengl/sampler.h
index 5afa9d2afd1d..9e2fa19b1462 100644
--- a/modules/video_output/opengl/sampler.h
+++ b/modules/video_output/opengl/sampler.h
@@ -53,6 +53,9 @@ struct vlc_gl_sampler {
     struct vlc_gl_t *gl;
     const opengl_vtable_t *vt;
 
+    /* Input format */
+    const video_format_t *fmt;
+
     struct {
         GLfloat OrientationMatrix[4*4];
         GLfloat TexCoordsMap[PICTURE_PLANE_MAX][3*3];
-- 
2.27.0.rc0



More information about the vlc-devel mailing list