[vlc-devel] [PATCH v3 12/22] opengl: use default draw framebuffer

Romain Vimont rom1v at videolabs.io
Mon Jul 6 12:47:05 CEST 2020


The default draw framebuffer might be != 0 on some platforms. Read the
bound draw framebuffer on initialization, and use it for drawing to the
display.

Co-authored-by: Alexandre Janniaux <ajanni at videolabs.io>
---
 modules/video_output/opengl/filters.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/opengl/filters.c b/modules/video_output/opengl/filters.c
index d6762b0b56..2f4f7af64a 100644
--- a/modules/video_output/opengl/filters.c
+++ b/modules/video_output/opengl/filters.c
@@ -201,6 +201,10 @@ vlc_gl_filters_Draw(struct vlc_gl_filters *filters)
 {
     const opengl_vtable_t *vt = &filters->api->vt;
 
+    GLint value;
+    vt->GetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &value);
+    GLuint draw_framebuffer = value; /* as GLuint */
+
     struct vlc_gl_filter_priv *priv;
     vlc_list_foreach(priv, &filters->list, node)
     {
@@ -221,7 +225,8 @@ vlc_gl_filters_Draw(struct vlc_gl_filters *filters)
             }
         }
 
-        GLuint draw_fb = priv->has_framebuffer_out ? priv->framebuffer_out : 0;
+        GLuint draw_fb = priv->has_framebuffer_out ? priv->framebuffer_out
+                                                   : draw_framebuffer;
 
         vt->BindFramebuffer(GL_DRAW_FRAMEBUFFER, draw_fb);
 
-- 
2.27.0



More information about the vlc-devel mailing list