mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
[639/906] add get_proc_address implementations for egl and glx
This commit is contained in:
parent
4afc9f01e0
commit
05d26c78e0
3 changed files with 55 additions and 6 deletions
|
@ -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 ()
|
||||
{
|
||||
|
|
|
@ -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 *
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue