gst-plugins-bad: gtk/gl: Use our GL function table instead of directly calling GL functions

Nicolas Dufresne nicolas.dufresne at collabora.com
Wed Aug 19 16:56:33 PDT 2015


Matthew had told me this was fine, since it maps to epoxy_glClear and
so on through GTK/Epoxy (which we link against).

Nicolas

Le mercredi 19 août 2015 à 03:58 -0700, Sebastian Dröge a écrit :
> Module: gst-plugins-bad
> Branch: master
> Commit: ea27fe3032639502e8467e2a7b9740695706cdee
> URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins
> -bad/commit/?id=ea27fe3032639502e8467e2a7b9740695706cdee
> 
> Author: Sebastian Dröge <sebastian at centricular.com>
> Date:   Wed Aug 19 13:52:21 2015 +0300
> 
> gtk/gl: Use our GL function table instead of directly calling GL 
> functions
> 
> Otherwise we would have to link the plugin to the GL libraries 
> directly.
> 
> ---
> 
>  ext/gtk/gtkgstglwidget.c |   12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/ext/gtk/gtkgstglwidget.c b/ext/gtk/gtkgstglwidget.c
> index cdce3aa..1b2cadb 100644
> --- a/ext/gtk/gtkgstglwidget.c
> +++ b/ext/gtk/gtkgstglwidget.c
> @@ -202,10 +202,12 @@ _redraw_texture (GtkGstGLWidget * gst_widget, 
> guint tex)
>  }
>  
>  static inline void
> -_draw_black (void)
> +_draw_black (GstGLContext * context)
>  {
> -  glClearColor (0.0, 0.0, 0.0, 0.0);
> -  glClear (GL_COLOR_BUFFER_BIT);
> +  const GstGLFuncs *gl = context->gl_vtable;
> +
> +  gl->ClearColor (0.0, 0.0, 0.0, 0.0);
> +  gl->Clear (GL_COLOR_BUFFER_BIT);
>  }
>  
>  static gboolean
> @@ -225,7 +227,7 @@ gtk_gst_gl_widget_render (GtkGLArea * widget, 
> GdkGLContext * context)
>      gtk_gst_gl_widget_init_redisplay (GTK_GST_GL_WIDGET (widget));
>  
>    if (!priv->initted || !base_widget->negotiated) {
> -    _draw_black ();
> +    _draw_black (priv->other_context);
>      goto done;
>    }
>  
> @@ -237,7 +239,7 @@ gtk_gst_gl_widget_render (GtkGLArea * widget, 
> GdkGLContext * context)
>  
>      if (!gst_video_frame_map (&gl_frame, &base_widget->v_info, 
> buffer,
>              GST_MAP_READ | GST_MAP_GL)) {
> -      _draw_black ();
> +      _draw_black (priv->other_context);
>        goto done;
>      }
>  
> 
> _______________________________________________
> gstreamer-commits mailing list
> gstreamer-commits at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-commits
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150819/f7350548/attachment.sig>


More information about the gstreamer-devel mailing list