mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
[638/906] window: add get_proc_address + stub for retrieving gl functions
This commit is contained in:
parent
87e5cd6777
commit
4a024734da
2 changed files with 49 additions and 2 deletions
|
@ -22,6 +22,8 @@
|
|||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <gmodule.h>
|
||||
|
||||
#include "gstglwindow.h"
|
||||
|
||||
#ifdef HAVE_WINDOW_X11
|
||||
|
@ -59,6 +61,8 @@ gst_gl_window_init (GstGLWindow * window)
|
|||
static void
|
||||
gst_gl_window_class_init (GstGLWindowClass * klass)
|
||||
{
|
||||
klass->get_proc_address =
|
||||
GST_DEBUG_FUNCPTR (gst_gl_window_default_get_proc_address);
|
||||
}
|
||||
|
||||
GstGLWindow *
|
||||
|
@ -322,3 +326,40 @@ gst_gl_window_get_gl_api (GstGLWindow * window)
|
|||
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -55,6 +55,8 @@ typedef enum
|
|||
{
|
||||
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;
|
||||
|
@ -96,6 +98,7 @@ struct _GstGLWindowClass {
|
|||
|
||||
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);
|
||||
|
@ -131,8 +134,11 @@ void gst_gl_window_run (GstGLWindow *window);
|
|||
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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue