[vlc-commits] opengl: use the interop format in renderer

Romain Vimont git at videolan.org
Wed May 20 14:55:41 CEST 2020


vlc | branch: master | Romain Vimont <rom1v at videolabs.io> | Thu Feb  6 11:30:11 2020 +0100| [c4fde207681eadb55ad1094338c21142cf6c24fa] | committer: Alexandre Janniaux

opengl: use the interop format in renderer

The interop initializes its own video_format_t from the input format.

In the renderer initialization, always use this updated format. This
avoids an additional format parameter, which may be confusing.

Signed-off-by: Alexandre Janniaux <ajanni at videolabs.io>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c4fde207681eadb55ad1094338c21142cf6c24fa
---

 modules/video_output/opengl/renderer.c    | 10 +++++-----
 modules/video_output/opengl/renderer.h    |  4 +---
 modules/video_output/opengl/vout_helper.c |  2 +-
 3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/modules/video_output/opengl/renderer.c b/modules/video_output/opengl/renderer.c
index 3a87627c0b..59f1a67cd7 100644
--- a/modules/video_output/opengl/renderer.c
+++ b/modules/video_output/opengl/renderer.c
@@ -432,10 +432,10 @@ static int SetupCoords(struct vlc_gl_renderer *renderer);
 
 struct vlc_gl_renderer *
 vlc_gl_renderer_New(vlc_gl_t *gl, const struct vlc_gl_api *api,
-                    struct vlc_gl_interop *interop,
-                    const video_format_t *fmt, bool b_dump_shaders)
+                    struct vlc_gl_interop *interop, bool b_dump_shaders)
 {
     const opengl_vtable_t *vt = &api->vt;
+    const video_format_t *fmt = &interop->fmt;
 
     struct vlc_gl_sampler *sampler = malloc(sizeof(*sampler));
     if (!sampler)
@@ -498,11 +498,11 @@ vlc_gl_renderer_New(vlc_gl_t *gl, const struct vlc_gl_api *api,
         return NULL;
     }
 
-    InitStereoMatrix(renderer->var.StereoMatrix, interop->fmt.multiview_mode);
+    InitStereoMatrix(renderer->var.StereoMatrix, fmt->multiview_mode);
 
-    getOrientationTransformMatrix(interop->fmt.orientation,
+    getOrientationTransformMatrix(fmt->orientation,
                                   sampler->var.OrientationMatrix);
-    getViewpointMatrixes(renderer, interop->fmt.projection_mode);
+    getViewpointMatrixes(renderer, fmt->projection_mode);
 
     renderer->fmt = *fmt;
 
diff --git a/modules/video_output/opengl/renderer.h b/modules/video_output/opengl/renderer.h
index 9c426ccbaf..5150834603 100644
--- a/modules/video_output/opengl/renderer.h
+++ b/modules/video_output/opengl/renderer.h
@@ -131,13 +131,11 @@ struct vlc_gl_renderer
  * \param gl the GL context
  * \param api the OpenGL API
  * \param interop the interop
- * \param fmt the video format
  * \param dump_shaders indicate if the shaders must be dumped in logs
  */
 struct vlc_gl_renderer *
 vlc_gl_renderer_New(vlc_gl_t *gl, const struct vlc_gl_api *api,
-                    struct vlc_gl_interop *interop, const video_format_t *fmt,
-                    bool dump_shaders);
+                    struct vlc_gl_interop *interop, bool dump_shaders);
 
 /**
  * Delete a renderer
diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c
index fa649c3b94..c34cf20dc0 100644
--- a/modules/video_output/opengl/vout_helper.c
+++ b/modules/video_output/opengl/vout_helper.c
@@ -144,7 +144,7 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
     }
 
     vgl->renderer =
-        vlc_gl_renderer_New(gl, &vgl->api, vgl->interop, fmt, b_dump_shaders);
+        vlc_gl_renderer_New(gl, &vgl->api, vgl->interop, b_dump_shaders);
     if (!vgl->renderer)
     {
         msg_Warn(gl, "Could not create renderer for %4.4s",



More information about the vlc-commits mailing list