mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
[831/906] glimagesink: avoid to overload the drawer if already drawing
Especially if the application calls gst_video_overlay_expose a lot
This commit is contained in:
parent
7b7e7bb8d0
commit
66d7d4712e
2 changed files with 11 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue