Commit 66d7d471 authored by Julien Isorce's avatar Julien Isorce Committed by Tim-Philipp Müller

[831/906] glimagesink: avoid to overload the drawer if already drawing

Especially if the application calls gst_video_overlay_expose a lot
parent 7b7e7bb8
......@@ -107,6 +107,8 @@ gst_gl_window_init (GstGLWindow * window)
g_cond_init (&window->priv->cond_destroy_context);
window->priv->context_created = FALSE;
window->is_drawing = FALSE;
g_weak_ref_init (&window->context_ref, NULL);
}
......@@ -221,6 +223,13 @@ gst_gl_window_draw (GstGLWindow * window, guint width, guint height)
g_return_if_fail (window_class->draw != NULL);
GST_GL_WINDOW_LOCK (window);
/* avoid to overload the drawer */
if (window->is_drawing) {
GST_GL_WINDOW_UNLOCK (window);
return;
}
window_class->draw (window, width, height);
GST_GL_WINDOW_UNLOCK (window);
}
......
......@@ -76,6 +76,8 @@ struct _GstGLWindow {
guintptr external_gl_context;
gboolean is_drawing;
GstGLWindowCB draw;
gpointer draw_data;
GDestroyNotify draw_notify;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment