gl/viv-fb: fix gl plugin hang when run with viv-fb backend

below commit change the window resize thread and cause viv-fb backend
hang, need move resize code after window->open is called. Otherwise,
the resize message will send to a thread that not start running and
window resize call will waiting forever.

Commit:        b887db1efe
glwindow: fix racy resize updates

Take locks around resize handling and marshall all resizes to the
windowing thread by default.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1195>
This commit is contained in:
Haihua Hu 2021-06-07 17:54:46 +08:00
parent 025a14e7fe
commit 58f4217468
3 changed files with 19 additions and 5 deletions

View file

@ -53,6 +53,9 @@
#if GST_GL_HAVE_WINDOW_GBM
#include "../gbm/gstglwindow_gbm_egl.h"
#endif
#if GST_GL_HAVE_WINDOW_VIV_FB
#include "../viv-fb/gstglwindow_viv_fb_egl.h"
#endif
#define GST_CAT_DEFAULT gst_gl_context_debug
@ -1080,6 +1083,12 @@ gst_gl_context_egl_create_context (GstGLContext * context,
gst_gl_window_gbm_egl_create_window ((GstGLWindowGBMEGL *)
context->window);
}
#endif
#if GST_GL_HAVE_WINDOW_VIV_FB
if (GST_IS_GL_WINDOW_VIV_FB_EGL (context->window)) {
gst_gl_window_viv_fb_egl_create_window ((GstGLWindowVivFBEGL *)
context->window);
}
#endif
}

View file

@ -130,21 +130,25 @@ gst_gl_window_viv_fb_egl_open (GstGLWindow * window, GError ** error)
return FALSE;
}
return GST_GL_WINDOW_CLASS (parent_class)->open (window, error);
}
void
gst_gl_window_viv_fb_egl_create_window (GstGLWindowVivFBEGL * window_egl)
{
fbGetWindowGeometry (window_egl->win_id, NULL, NULL,
&window_egl->window_width, &window_egl->window_height);
window_egl->render_rectangle.x = 0;
window_egl->render_rectangle.y = 0;
window_egl->render_rectangle.w = window_egl->window_width;
window_egl->render_rectangle.h = window_egl->window_height;
gst_gl_window_resize (window, window_egl->window_width,
gst_gl_window_resize (GST_GL_WINDOW (window_egl), window_egl->window_width,
window_egl->window_height);
GST_DEBUG
("Opened Vivante FB display successfully, resolution is (%dx%d), display %p, window %p.",
window_egl->window_width, window_egl->window_height, (gpointer) display,
("create viv-fb window, resolution is (%dx%d), window %p.",
window_egl->window_width, window_egl->window_height,
(gpointer) window_egl->win_id);
return GST_GL_WINDOW_CLASS (parent_class)->open (window, error);
}
static guintptr

View file

@ -59,6 +59,7 @@ struct _GstGLWindowVivFBEGLClass {
GType gst_gl_window_viv_fb_egl_get_type (void);
GstGLWindowVivFBEGL * gst_gl_window_viv_fb_egl_new (GstGLDisplay * display);
void gst_gl_window_viv_fb_egl_create_window (GstGLWindowVivFBEGL * window_egl);
G_END_DECLS