From: Haihua Hu Date: Wed, 27 Jul 2016 02:55:01 +0000 (+0800) Subject: glwindow: Fix glimagesink cannot show frame when connect to qmlglsrc X-Git-Tag: 1.19.3~511^2~1989^2~278 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4cd94ddd258976d5fc2d9cc5c3258eae882a42af;p=platform%2Fupstream%2Fgstreamer.git glwindow: Fix glimagesink cannot show frame when connect to qmlglsrc When connect to qmlglsrc, x11 event loop will be replace by qt event loop which will cause the window cannot receive event from xserver, such as resize https://bugzilla.gnome.org/show_bug.cgi?id=768160 --- diff --git a/gst-libs/gst/gl/x11/gstglwindow_x11.c b/gst-libs/gst/gl/x11/gstglwindow_x11.c index a330825..d08b757 100644 --- a/gst-libs/gst/gl/x11/gstglwindow_x11.c +++ b/gst-libs/gst/gl/x11/gstglwindow_x11.c @@ -391,6 +391,7 @@ draw_cb (gpointer data) GstGLWindow *window = GST_GL_WINDOW (window_x11); if (gst_gl_window_is_running (window)) { + guint width, height; XWindowAttributes attr; XGetWindowAttributes (window_x11->device, window_x11->internal_win_id, @@ -414,13 +415,16 @@ draw_cb (gpointer data) } } - if (window_x11->allow_extra_expose_events) { - if (window->queue_resize) { - guint width, height; + gst_gl_window_get_surface_dimensions (window, &width, &height); + if (attr.width != width || attr.height != height) { + width = attr.width; + height = attr.height; + gst_gl_window_queue_resize (window); + } - gst_gl_window_get_surface_dimensions (window, &width, &height); + if (window_x11->allow_extra_expose_events) { + if (window->queue_resize) gst_gl_window_resize (window, width, height); - } if (window->draw) { GstGLContext *context = gst_gl_window_get_context (window);