mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
[790/906] glimagesink: retrieve window only when clientDrawCallback return true
This commit is contained in:
parent
7bd7d7a48f
commit
44d82d6aad
1 changed files with 5 additions and 4 deletions
|
@ -959,20 +959,21 @@ gst_glimage_sink_on_draw (GstGLImageSink * gl_sink)
|
|||
|
||||
/* check if a client draw callback is registered */
|
||||
if (gl_sink->clientDrawCallback) {
|
||||
GstGLWindow *window = gst_gl_display_get_window (gl_sink->display);
|
||||
|
||||
gboolean doRedisplay =
|
||||
gl_sink->clientDrawCallback (gl_sink->redisplay_texture,
|
||||
gl_sink->redisplay_texture_width,
|
||||
gl_sink->redisplay_texture_height,
|
||||
gl_sink->client_data);
|
||||
|
||||
if (doRedisplay && window)
|
||||
if (doRedisplay) {
|
||||
GstGLWindow *window = gst_gl_display_get_window (gl_sink->display);
|
||||
|
||||
gst_gl_window_draw_unlocked (window,
|
||||
gl_sink->redisplay_texture_width, gl_sink->redisplay_texture_height);
|
||||
|
||||
gst_object_unref (window);
|
||||
}
|
||||
}
|
||||
/* default opengl scene */
|
||||
else {
|
||||
#if GST_GL_HAVE_OPENGL
|
||||
|
|
Loading…
Reference in a new issue