[vlc-devel] [PATCH 36/41] opengl: expose video format in sampler

Romain Vimont rom1v at videolabs.io
Fri Feb 7 17:42:22 CET 2020


For convenience, expose the video format directly in sampler.
---
 modules/video_output/opengl/sampler.c | 3 +++
 modules/video_output/opengl/sampler.h | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/modules/video_output/opengl/sampler.c b/modules/video_output/opengl/sampler.c
index a660eca5c4..7b35b28b22 100644
--- a/modules/video_output/opengl/sampler.c
+++ b/modules/video_output/opengl/sampler.c
@@ -45,6 +45,9 @@ vlc_gl_sampler_New(struct vlc_gl_interop *interop)
     sampler->gl = interop->gl;
     sampler->vt = interop->vt;
 
+    sampler->fmt = &interop->fmt;
+    sampler->sw_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 7e7193b9ba..d20965d225 100644
--- a/modules/video_output/opengl/sampler.h
+++ b/modules/video_output/opengl/sampler.h
@@ -54,6 +54,12 @@ struct vlc_gl_sampler {
     struct vlc_gl_t *gl;
     const opengl_vtable_t *vt;
 
+    /* Input format */
+    const video_format_t *fmt;
+
+    /* Software format (useful if fmt only exposes opaque chroma) */
+    const video_format_t *sw_fmt;
+
     struct {
         GLfloat OrientationMatrix[4*4];
         GLfloat TexCoordsMap[PICTURE_PLANE_MAX][3*3];
-- 
2.25.0



More information about the vlc-devel mailing list