# include "config.h"
#endif
+#include <gmodule.h>
+
#include "gstglwindow.h"
#ifdef HAVE_WINDOW_X11
static void
gst_gl_window_class_init (GstGLWindowClass * klass)
{
+ klass->get_proc_address =
+ GST_DEBUG_FUNCPTR (gst_gl_window_default_get_proc_address);
}
GstGLWindow *
return ret;
}
+
+gpointer
+gst_gl_window_get_proc_address (GstGLWindow * window, const gchar * name)
+{
+ gpointer ret;
+ GstGLWindowClass *window_class;
+
+ g_return_val_if_fail (GST_GL_IS_WINDOW (window), NULL);
+ window_class = GST_GL_WINDOW_GET_CLASS (window);
+ g_return_val_if_fail (window_class->get_proc_address != NULL, NULL);
+
+ GST_GL_WINDOW_LOCK (window);
+
+ ret = window_class->get_proc_address (window, name);
+
+ GST_GL_WINDOW_UNLOCK (window);
+
+ return ret;
+}
+
+gpointer
+gst_gl_window_default_get_proc_address (GstGLWindow * window,
+ const gchar * name)
+{
+ static GModule *module = NULL;
+ gpointer ret = NULL;
+
+ if (!module)
+ module = g_module_open (NULL, G_MODULE_BIND_LAZY);
+
+ if (module) {
+ if (!g_module_symbol (module, name, &ret))
+ return NULL;
+ }
+
+ return ret;
+}
{
GST_GL_WINDOW_ERROR_FAILED,
GST_GL_WINDOW_ERROR_WRONG_CONFIG,
+ GST_GL_WINDOW_ERROR_WRONG_API,
+ GST_GL_WINDOW_ERROR_OLD_LIBS,
GST_GL_WINDOW_ERROR_CREATE_CONTEXT,
GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE,
} GstGLWindowError;
guintptr (*get_gl_context) (GstGLWindow *window);
GstGLAPI (*get_gl_api) (GstGLWindow *window);
+ gpointer (*get_proc_address) (GstGLWindow *window, const gchar *name);
gboolean (*activate) (GstGLWindow *window, gboolean activate);
void (*set_window_handle) (GstGLWindow *window, guintptr id);
gboolean (*share_context) (GstGLWindow *window, guintptr external_gl_context);
void gst_gl_window_quit (GstGLWindow *window, GstGLWindowCB callback, gpointer data);
void gst_gl_window_send_message (GstGLWindow *window, GstGLWindowCB callback, gpointer data);
-GstGLPlatform gst_gl_window_get_platform (GstGLWindow *window);
-GstGLAPI gst_gl_window_get_gl_api (GstGLWindow *window);
+gpointer gst_gl_window_get_proc_address (GstGLWindow *window, const gchar *name);
+GstGLPlatform gst_gl_window_get_platform (GstGLWindow *window);
+GstGLAPI gst_gl_window_get_gl_api (GstGLWindow *window);
+
+gpointer gst_gl_window_default_get_proc_address (GstGLWindow *window, const gchar *name);
GST_DEBUG_CATEGORY_EXTERN (gst_gl_window_debug);