Pass the GstGLAPI directly.
}
gpointer
-gst_gl_context_egl_get_proc_address (GstGLContext * context, const gchar * name)
+gst_gl_context_egl_get_proc_address (GstGLAPI gl_api, const gchar * name)
{
gpointer result = NULL;
static GOnce g_once = G_ONCE_INIT;
- GstGLAPI gl_api = gst_gl_context_get_gl_api (context);
result = gst_gl_context_default_get_proc_address (gl_api, name);
GType gst_gl_context_egl_get_type (void);
GstGLContextEGL * gst_gl_context_egl_new (void);
guintptr gst_gl_context_egl_get_current_context (void);
-gpointer gst_gl_context_egl_get_proc_address (GstGLContext * context, const gchar * name);
+gpointer gst_gl_context_egl_get_proc_address (GstGLAPI gl_api, const gchar * name);
/* TODO:
* add support for EGL_NO_CONTEXT
static void _init_debug (void);
static gpointer gst_gl_context_create_thread (GstGLContext * context);
-static gpointer _default_get_proc_address (GstGLContext * context,
- const gchar * name);
static void gst_gl_context_finalize (GObject * object);
struct _GstGLContextPrivate
{
g_type_class_add_private (klass, sizeof (GstGLContextPrivate));
- klass->get_proc_address = GST_DEBUG_FUNCPTR (_default_get_proc_address);
+ klass->get_proc_address =
+ GST_DEBUG_FUNCPTR (gst_gl_context_default_get_proc_address);
G_OBJECT_CLASS (klass)->finalize = gst_gl_context_finalize;
return handle;
}
+gpointer
+gst_gl_context_get_proc_address_with_platform (GstGLPlatform context_type,
+ GstGLAPI gl_api, const gchar * name)
+{
+ gpointer ret = NULL;
+
+#if GST_GL_HAVE_PLATFORM_GLX
+ if (!ret && (context_type & GST_GL_PLATFORM_GLX) != 0)
+ ret = gst_gl_context_glx_get_proc_address (gl_api, name);
+#endif
+#if GST_GL_HAVE_PLATFORM_EGL
+ if (!ret && (context_type & GST_GL_PLATFORM_EGL) != 0)
+ ret = gst_gl_context_egl_get_proc_address (gl_api, name);
+#endif
+#if GST_GL_HAVE_PLATFORM_WGL
+ if (!ret && (context_type & GST_GL_PLATFORM_WGL) != 0)
+ ret = gst_gl_context_wgl_get_proc_address (gl_api, name);
+#endif
+ /* CGL and EAGL rely on the default impl */
+
+ if (!ret)
+ ret = gst_gl_context_default_get_proc_address (gl_api, name);
+
+ return ret;
+}
+
/**
* gst_gl_context_get_current_gl_api:
* @major: (out): (allow-none): the major version
return context_class->get_gl_api (context);
}
-static gpointer
-_default_get_proc_address (GstGLContext * context, const gchar * name)
-{
- GstGLAPI gl_api = gst_gl_context_get_gl_api (context);
-
- return gst_gl_context_default_get_proc_address (gl_api, name);
-}
-
/**
* gst_gl_context_get_proc_address:
* @context: a #GstGLContext
{
gpointer ret;
GstGLContextClass *context_class;
+ GstGLAPI gl_api;
g_return_val_if_fail (GST_GL_IS_CONTEXT (context), NULL);
context_class = GST_GL_CONTEXT_GET_CLASS (context);
g_return_val_if_fail (context_class->get_proc_address != NULL, NULL);
- ret = context_class->get_proc_address (context, name);
+ gl_api = gst_gl_context_get_gl_api (context);
+ ret = context_class->get_proc_address (gl_api, name);
return ret;
}
guintptr (*get_gl_context) (GstGLContext *context);
GstGLAPI (*get_gl_api) (GstGLContext *context);
GstGLPlatform (*get_gl_platform) (GstGLContext *context);
- gpointer (*get_proc_address) (GstGLContext *context, const gchar *name);
+ gpointer (*get_proc_address) (GstGLAPI gl_api, const gchar *name);
gboolean (*activate) (GstGLContext *context, gboolean activate);
gboolean (*choose_format) (GstGLContext *context, GError **error);
gboolean (*create_context) (GstGLContext *context, GstGLAPI gl_api,
void gst_gl_context_destroy (GstGLContext *context);
gpointer gst_gl_context_default_get_proc_address (GstGLAPI gl_api, const gchar *name);
+gpointer gst_gl_context_get_proc_address_with_platform (GstGLPlatform, GstGLAPI gl_api, const gchar *name);
gboolean gst_gl_context_set_window (GstGLContext *context, GstGLWindow *window);
GstGLWindow * gst_gl_context_get_window (GstGLContext *context);
}
gpointer
-gst_gl_context_wgl_get_proc_address (GstGLContext * context, const gchar * name)
+gst_gl_context_wgl_get_proc_address (GstGLAPI gl_api, const gchar * name)
{
gpointer result;
- GstGLAPI gl_api = gst_gl_context_get_gl_api (context);
if (!(result = gst_gl_context_default_get_proc_address (gl_api, name))) {
result = wglGetProcAddress ((LPCSTR) name);
GstGLContextWGL * gst_gl_context_wgl_new (void);
guintptr gst_gl_context_wgl_get_current_context (void);
-gpointer gst_gl_context_wgl_get_proc_address (GstGLContext * context, const gchar * name);
+gpointer gst_gl_context_wgl_get_proc_address (GstGLAPI gl_api, const gchar * name);
G_END_DECLS
}
gpointer
-gst_gl_context_glx_get_proc_address (GstGLContext * context, const gchar * name)
+gst_gl_context_glx_get_proc_address (GstGLAPI gl_api, const gchar * name)
{
gpointer result;
- GstGLAPI gl_api = gst_gl_context_get_gl_api (context);
if (!(result = gst_gl_context_default_get_proc_address (gl_api, name))) {
result = glXGetProcAddressARB ((const GLubyte *) name);
GstGLContextGLX * gst_gl_context_glx_new (void);
guintptr gst_gl_context_glx_get_current_context (void);
-gpointer gst_gl_context_glx_get_proc_address (GstGLContext * context, const gchar * name);
+gpointer gst_gl_context_glx_get_proc_address (GstGLAPI gl_api, const gchar * name);
G_END_DECLS