[Bug 794614] New: gst_gl_window_set_window_handle() problem on Wayland EGL

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Fri Mar 23 06:59:48 UTC 2018


https://bugzilla.gnome.org/show_bug.cgi?id=794614

            Bug ID: 794614
           Summary: gst_gl_window_set_window_handle() problem on Wayland
                    EGL
    Classification: Platform
           Product: GStreamer
           Version: 1.12.4
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gst-plugins-bad
          Assignee: gstreamer-bugs at lists.freedesktop.org
          Reporter: HHG01200 at nifty.ne.jp
        QA Contact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---

In "gstglwindow.c"
----------------------------------------------------------------
void
gst_gl_window_set_window_handle (GstGLWindow * window, guintptr handle)
{
  :
  gst_gl_window_send_message_async (window,
      (GstGLWindowCB) _set_window_handle_cb, data,
      (GDestroyNotify) _free_swh_cb);
}
----------------------------------------------------------------


In "gstglwindow.c"
----------------------------------------------------------------
static void
_set_window_handle_cb (GstSetWindowHandleCb * data)
{
  :
    gst_gl_context_activate (context, FALSE);
  :

  window_class->set_window_handle (data->window, data->handle);

  :
    gst_gl_context_activate (context, TRUE);
  :

}
----------------------------------------------------------------


In "gstglcontext_egl.c"
----------------------------------------------------------------
static gboolean
gst_gl_context_egl_activate (GstGLContext * context, gboolean activate)
{
  :
  if (activate) {
    /* Check if the backing handle changed */
      handle = (EGLNativeWindowType) gst_gl_window_get_window_handle (window);

    if (handle && handle != egl->window_handle) {
      GST_DEBUG_OBJECT (context,
          "Handle changed ",
          :
    }
    result = eglMakeCurrent (egl->egl_display, egl->egl_surface,
        egl->egl_surface, egl->egl_context);
  }
  :
}
----------------------------------------------------------------
NOTE: GstGLContextEGL assumes window handle change.


In "gstglwindow_wayland_egl.c"
----------------------------------------------------------------
static guintptr
gst_gl_window_wayland_egl_get_window_handle (GstGLWindow * window)
{
  return (guintptr) GST_GL_WINDOW_WAYLAND_EGL (window)->window.native;
}
----------------------------------------------------------------
NOTE: "window handle" is window.native .


In "gstglwindow_wayland_egl.c"
----------------------------------------------------------------
static void
gst_gl_window_wayland_egl_set_window_handle (GstGLWindow * window,
    guintptr handle)
{
  :
  destroy_surfaces (window_egl);
  window_egl->window.foreign_surface = surface;
  create_surfaces (window_egl);
  :
}
----------------------------------------------------------------
NOTE: window.native is destroyed in destroy_surfaces().
 create_surfaces() may allocate same id for window.native .
 If so, gst_gl_context_egl_activate() cannot detect change.


Modification suggestion:

In "gstglwindow_wayland_egl.c"
----------------------------------------------------------------
static void
gst_gl_window_wayland_egl_set_window_handle (GstGLWindow * window,
    guintptr handle)
{
  :
  struct wl_egl_window *savewin;
  :
  :
  savewin = window_egl->window.native;  /* defer destroy window to generate
different id */
  window_egl->window.native = NULL;     /* avoid destroy */


  destroy_surfaces (window_egl);
  window_egl->window.foreign_surface = surface;
  create_surfaces (window_egl);


  if (savewin) {
    wl_egl_window_destroy (savewin);  /* deferred destroy */
  }
}
----------------------------------------------------------------

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list