mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-24 08:08:22 +00:00
gl/gbm: Initialize window handle (= gbm surface) like other window systems
https://bugzilla.gnome.org/show_bug.cgi?id=793997
This commit is contained in:
parent
9261296858
commit
76c667bfe0
3 changed files with 22 additions and 11 deletions
|
@ -51,6 +51,9 @@
|
||||||
#if GST_GL_HAVE_WINDOW_DISPMANX
|
#if GST_GL_HAVE_WINDOW_DISPMANX
|
||||||
#include "../dispmanx/gstglwindow_dispmanx_egl.h"
|
#include "../dispmanx/gstglwindow_dispmanx_egl.h"
|
||||||
#endif
|
#endif
|
||||||
|
#if GST_GL_HAVE_WINDOW_GBM
|
||||||
|
#include "../gbm/gstglwindow_gbm_egl.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define GST_CAT_DEFAULT gst_gl_context_debug
|
#define GST_CAT_DEFAULT gst_gl_context_debug
|
||||||
|
|
||||||
|
@ -520,6 +523,12 @@ gst_gl_context_egl_create_context (GstGLContext * context,
|
||||||
gst_gl_window_dispmanx_egl_create_window ((GstGLWindowDispmanxEGL *)
|
gst_gl_window_dispmanx_egl_create_window ((GstGLWindowDispmanxEGL *)
|
||||||
context->window);
|
context->window);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#if GST_GL_HAVE_WINDOW_GBM
|
||||||
|
if (GST_IS_GL_WINDOW_GBM_EGL (context->window)) {
|
||||||
|
gst_gl_window_gbm_egl_create_window ((GstGLWindowGBMEGL *)
|
||||||
|
context->window);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,16 +83,6 @@ gst_gl_window_gbm_egl_init (GstGLWindowGBMEGL * window_gbm)
|
||||||
static guintptr
|
static guintptr
|
||||||
gst_gl_window_gbm_egl_get_window_handle (GstGLWindow * window)
|
gst_gl_window_gbm_egl_get_window_handle (GstGLWindow * window)
|
||||||
{
|
{
|
||||||
GstGLWindowGBMEGL *window_egl = GST_GL_WINDOW_GBM_EGL (window);
|
|
||||||
|
|
||||||
/* This function is called in here, and not in the open()
|
|
||||||
* vmethod. The reason for this is explained inside the
|
|
||||||
* gst_gl_window_gbm_init_surface() function. */
|
|
||||||
if (window_egl->gbm_surf == NULL) {
|
|
||||||
if (!gst_gl_window_gbm_init_surface (window_egl))
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (guintptr) GST_GL_WINDOW_GBM_EGL (window)->gbm_surf;
|
return (guintptr) GST_GL_WINDOW_GBM_EGL (window)->gbm_surf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,7 +283,11 @@ gst_gl_window_gbm_init_surface (GstGLWindowGBMEGL * window_egl)
|
||||||
* contains some function pointers that are set to NULL and
|
* contains some function pointers that are set to NULL and
|
||||||
* shouldn't be. This is because Mesa's eglInitialize() loads
|
* shouldn't be. This is because Mesa's eglInitialize() loads
|
||||||
* the DRI2 driver and the relevant functions aren't available
|
* the DRI2 driver and the relevant functions aren't available
|
||||||
* until then. */
|
* until then.
|
||||||
|
*
|
||||||
|
* Therefore, this function is called instead inside
|
||||||
|
* gst_gl_window_gbm_egl_create_window(), which in turn is
|
||||||
|
* called inside gst_gl_context_egl_create_context(). */
|
||||||
|
|
||||||
GstGLWindow *window = GST_GL_WINDOW (window_egl);
|
GstGLWindow *window = GST_GL_WINDOW (window_egl);
|
||||||
GstGLDisplayGBM *display = (GstGLDisplayGBM *) window->display;
|
GstGLDisplayGBM *display = (GstGLDisplayGBM *) window->display;
|
||||||
|
@ -355,3 +349,10 @@ gst_gl_window_gbm_egl_new (GstGLDisplay * display)
|
||||||
|
|
||||||
return window_egl;
|
return window_egl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
gst_gl_window_gbm_egl_create_window (GstGLWindowGBMEGL * window_egl)
|
||||||
|
{
|
||||||
|
return gst_gl_window_gbm_init_surface (window_egl);
|
||||||
|
}
|
||||||
|
|
|
@ -63,6 +63,7 @@ struct _GstGLWindowGBMEGLClass {
|
||||||
GType gst_gl_window_gbm_egl_get_type (void);
|
GType gst_gl_window_gbm_egl_get_type (void);
|
||||||
|
|
||||||
GstGLWindowGBMEGL * gst_gl_window_gbm_egl_new (GstGLDisplay * display);
|
GstGLWindowGBMEGL * gst_gl_window_gbm_egl_new (GstGLDisplay * display);
|
||||||
|
gboolean gst_gl_window_gbm_egl_create_window (GstGLWindowGBMEGL * window_egl);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue