summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2016-07-01 16:18:55 +1000
committerMatthew Waters <matthew@centricular.com>2016-08-19 16:07:07 +1000
commit306e6105471bca8006aeda437ea0adc2ab02a197 (patch)
treef52c30c29977dd9a3003e4cf5ae62dabfd8a450d
parent05a0f0002ccaa94b4d5c173999f7e8a58aceafd4 (diff)
glwindow: marshal gst_gl_window_resize through the window loop
saves having every caller do it themselves.
-rw-r--r--gst-libs/gst/gl/gstglwindow.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/gst-libs/gst/gl/gstglwindow.c b/gst-libs/gst/gl/gstglwindow.c
index d30b911d7..b74d39755 100644
--- a/gst-libs/gst/gl/gstglwindow.c
+++ b/gst-libs/gst/gl/gstglwindow.c
@@ -1162,13 +1162,35 @@ gst_gl_window_queue_resize (GstGLWindow * window)
window_class->queue_resize (window);
}
+struct resize_data
+{
+ GstGLWindow *window;
+ guint width, height;
+};
+
+static void
+_on_resize (gpointer data)
+{
+ struct resize_data *resize = data;
+
+ resize->window->resize (resize->window->resize_data, resize->width,
+ resize->height);
+}
+
void
gst_gl_window_resize (GstGLWindow * window, guint width, guint height)
{
g_return_if_fail (GST_IS_GL_WINDOW (window));
- if (window->resize)
- window->resize (window->resize_data, width, height);
+ if (window->resize) {
+ struct resize_data resize = { 0, };
+
+ resize.window = window;
+ resize.width = width;
+ resize.height = height;
+
+ gst_gl_window_send_message (window, (GstGLWindowCB) _on_resize, &resize);
+ }
window->priv->surface_width = width;
window->priv->surface_height = height;