[639/906] add get_proc_address implementations for egl and glx
authorMatthew Waters <ystreet00@gmail.com>
Wed, 9 Jan 2013 13:23:32 +0000 (00:23 +1100)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:31:26 +0000 (19:31 +0000)
gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c
gst-libs/gst/gl/x11/gstglwindow_x11_egl.c
gst-libs/gst/gl/x11/gstglwindow_x11_glx.c

index ca30127..606adda 100644 (file)
@@ -54,12 +54,12 @@ static void gst_gl_window_wayland_egl_destroy_context (GstGLWindowWaylandEGL *
 static gboolean gst_gl_window_wayland_egl_create_context (GstGLWindowWaylandEGL
     * window_egl, GstGLAPI gl_api, guintptr external_gl_context,
     GError ** error);
-GstGLAPI gst_gl_window_wayland_egl_get_gl_api (GstGLWindow * window);
+static GstGLAPI gst_gl_window_wayland_egl_get_gl_api (GstGLWindow * window);
+static gpointer gst_gl_window_wayland_egl_get_proc_address (GstGLWindow *
+    window, const gchar * name);
 
 static void gst_gl_window_wayland_egl_finalize (GObject * object);
 
-
-
 static void
 pointer_handle_enter (void *data, struct wl_pointer *pointer, uint32_t serial,
     struct wl_surface *surface, wl_fixed_t sx_w, wl_fixed_t sy_w)
@@ -275,6 +275,8 @@ gst_gl_window_wayland_egl_class_init (GstGLWindowWaylandEGLClass * klass)
       GST_DEBUG_FUNCPTR (gst_gl_window_wayland_egl_send_message);
   window_class->get_gl_api =
       GST_DEBUG_FUNCPTR (gst_gl_window_wayland_egl_get_gl_api);
+  window_class->get_proc_address =
+      GST_DEBUG_FUNCPTR (gst_gl_window_wayland_egl_get_proc_address);
 
   object_class->finalize = gst_gl_window_wayland_egl_finalize;
 }
@@ -492,7 +494,7 @@ gst_gl_window_wayland_egl_get_gl_context (GstGLWindow * window)
   return (guintptr) GST_GL_WINDOW_WAYLAND_EGL (window)->egl_context;
 }
 
-GstGLAPI
+static GstGLAPI
 gst_gl_window_wayland_egl_get_gl_api (GstGLWindow * window)
 {
   return GST_GL_API_GLES2;
@@ -649,6 +651,19 @@ gst_gl_window_wayland_egl_draw (GstGLWindow * window, guint width, guint height)
   gst_gl_window_send_message (window, (GstGLWindowCB) draw_cb, &draw_data);
 }
 
+static gpointer
+gst_gl_window_wayland_egl_get_proc_address (GstGLWindow * window,
+    const gchar * name)
+{
+  gpointer result;
+
+  if (!(result = eglGetProcAddress (name))) {
+    result = gst_gl_window_default_get_proc_address (window, name);
+  }
+
+  return result;
+}
+
 const gchar *
 WlEGLErrorString ()
 {
index fff4ccc..626d245 100644 (file)
@@ -46,6 +46,8 @@ static void gst_gl_window_x11_egl_destroy_context (GstGLWindowX11 * window_x11);
 static gboolean gst_gl_window_x11_egl_choose_format (GstGLWindowX11 *
     window_x11, GError ** error);
 GstGLAPI gst_gl_window_x11_egl_get_gl_api (GstGLWindow * window);
+static gpointer gst_gl_window_x11_egl_get_proc_address (GstGLWindow * window,
+    const gchar * name);
 
 static void
 gst_gl_window_x11_egl_class_init (GstGLWindowX11EGLClass * klass)
@@ -68,6 +70,8 @@ gst_gl_window_x11_egl_class_init (GstGLWindowX11EGLClass * klass)
 
   window_class->get_gl_api =
       GST_DEBUG_FUNCPTR (gst_gl_window_x11_egl_get_gl_api);
+  window_class->get_proc_address =
+      GST_DEBUG_FUNCPTR (gst_gl_window_x11_egl_get_proc_address);
 }
 
 static void
@@ -301,8 +305,21 @@ gst_gl_window_x11_egl_get_gl_api (GstGLWindow * window)
 {
   GstGLWindowX11EGL *window_egl = GST_GL_WINDOW_X11_EGL (window);
 
-  return window_egl->gl_api ? window_egl->
-      gl_api : GST_GL_API_GLES2 | GST_GL_API_OPENGL;
+  return window_egl->
+      gl_api ? window_egl->gl_api : GST_GL_API_GLES2 | GST_GL_API_OPENGL;
+}
+
+static gpointer
+gst_gl_window_x11_egl_get_proc_address (GstGLWindow * window,
+    const gchar * name)
+{
+  gpointer result;
+
+  if (!(result = eglGetProcAddress (name))) {
+    result = gst_gl_window_default_get_proc_address (window, name);
+  }
+
+  return result;
 }
 
 const gchar *
index 654dd4c..0019629 100644 (file)
@@ -46,6 +46,8 @@ static void gst_gl_window_x11_glx_destroy_context (GstGLWindowX11 * window_x11);
 static gboolean gst_gl_window_x11_glx_choose_format (GstGLWindowX11 *
     window_x11, GError ** error);
 GstGLAPI gst_gl_window_x11_glx_get_gl_api (GstGLWindow * window);
+static gpointer gst_gl_window_x11_glx_get_proc_address (GstGLWindow * window,
+    const gchar * name);
 
 static void
 gst_gl_window_x11_glx_class_init (GstGLWindowX11GLXClass * klass)
@@ -68,6 +70,8 @@ gst_gl_window_x11_glx_class_init (GstGLWindowX11GLXClass * klass)
 
   window_class->get_gl_api =
       GST_DEBUG_FUNCPTR (gst_gl_window_x11_glx_get_gl_api);
+  window_class->get_proc_address =
+      GST_DEBUG_FUNCPTR (gst_gl_window_x11_glx_get_proc_address);
 }
 
 static void
@@ -194,3 +198,16 @@ gst_gl_window_x11_glx_get_gl_api (GstGLWindow * window)
 {
   return GST_GL_API_OPENGL;
 }
+
+static gpointer
+gst_gl_window_x11_glx_get_proc_address (GstGLWindow * window,
+    const gchar * name)
+{
+  gpointer result;
+
+  if (!(result = glXGetProcAddressARB ((const GLubyte *) name))) {
+    result = gst_gl_window_default_get_proc_address (window, name);
+  }
+
+  return result;
+}