mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 19:20:35 +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,19 +959,20 @@ 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);
|
||||
gst_object_unref (window);
|
||||
}
|
||||
}
|
||||
/* default opengl scene */
|
||||
else {
|
||||
|
|
Loading…
Reference in a new issue