From: Matthew Waters Date: Wed, 9 Jan 2013 13:23:32 +0000 (+1100) Subject: [639/906] add get_proc_address implementations for egl and glx X-Git-Tag: 1.19.3~511^2~1989^2~1880 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4a886e91e4e4e6110214c40a5cd3198aad0a3300;p=platform%2Fupstream%2Fgstreamer.git [639/906] add get_proc_address implementations for egl and glx --- diff --git a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c index ca30127..606adda 100644 --- a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c +++ b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c @@ -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 () { diff --git a/gst-libs/gst/gl/x11/gstglwindow_x11_egl.c b/gst-libs/gst/gl/x11/gstglwindow_x11_egl.c index fff4ccc..626d245 100644 --- a/gst-libs/gst/gl/x11/gstglwindow_x11_egl.c +++ b/gst-libs/gst/gl/x11/gstglwindow_x11_egl.c @@ -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 * diff --git a/gst-libs/gst/gl/x11/gstglwindow_x11_glx.c b/gst-libs/gst/gl/x11/gstglwindow_x11_glx.c index 654dd4c..0019629 100644 --- a/gst-libs/gst/gl/x11/gstglwindow_x11_glx.c +++ b/gst-libs/gst/gl/x11/gstglwindow_x11_glx.c @@ -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; +}