diff options
author | Sebastian Dröge <slomo@circular-chaos.org> | 2013-07-15 15:58:04 +0200 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2013-07-15 15:58:04 +0200 |
commit | 777fe40b893ccc45e012ea60ea8791fef33725a5 (patch) | |
tree | 49b10e51ac15a1940d697ba16b89bd7ff07ed556 /gst | |
parent | 753f7f21d14b6b07d70829578c72a4700a7b57a5 (diff) |
glwindow: Add destroy notifies for the data of the callbacks
And actually call the close callback when the window is closed.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/gl/gstglimagesink.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/gst/gl/gstglimagesink.c b/gst/gl/gstglimagesink.c index b2dcebc..5d45983 100644 --- a/gst/gl/gstglimagesink.c +++ b/gst/gl/gstglimagesink.c @@ -446,11 +446,14 @@ gst_glimage_sink_change_state (GstElement * element, GstStateChange transition) /* setup callbacks */ gst_gl_window_set_resize_callback (window, - GST_GL_WINDOW_RESIZE_CB (gst_glimage_sink_on_resize), glimage_sink); + GST_GL_WINDOW_RESIZE_CB (gst_glimage_sink_on_resize), + gst_object_ref (glimage_sink), (GDestroyNotify) gst_object_unref); gst_gl_window_set_draw_callback (window, - GST_GL_WINDOW_CB (gst_glimage_sink_on_draw), glimage_sink); + GST_GL_WINDOW_CB (gst_glimage_sink_on_draw), + gst_object_ref (glimage_sink), (GDestroyNotify) gst_object_unref); gst_gl_window_set_close_callback (window, - GST_GL_WINDOW_CB (gst_glimage_sink_on_close), glimage_sink); + GST_GL_WINDOW_CB (gst_glimage_sink_on_close), + gst_object_ref (glimage_sink), (GDestroyNotify) gst_object_unref); gst_object_unref (window); } @@ -487,9 +490,9 @@ gst_glimage_sink_change_state (GstElement * element, GstStateChange transition) if (glimage_sink->display) { GstGLWindow *window = gst_gl_display_get_window (glimage_sink->display); - gst_gl_window_set_resize_callback (window, NULL, NULL); - gst_gl_window_set_draw_callback (window, NULL, NULL); - gst_gl_window_set_close_callback (window, NULL, NULL); + gst_gl_window_set_resize_callback (window, NULL, NULL, NULL); + gst_gl_window_set_draw_callback (window, NULL, NULL, NULL); + gst_gl_window_set_close_callback (window, NULL, NULL, NULL); gst_object_unref (window); gst_object_unref (glimage_sink->display); |