mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-08 13:18:52 +00:00
[410/906] gstglmixer: inactivate shared gl context before to release ours
First, inactivate shared gl contexts known by each sink pad. Then, destroy the gl context known by the glmixer. Finally, re-activate shared gl contexts. This is to satisfy the fact that no shared gl context must be current when an opengl context is destroyed. Moreover the application may hang or crash without those steps.
This commit is contained in:
parent
727191d7b6
commit
4874b35304
1 changed files with 11 additions and 4 deletions
|
@ -1274,10 +1274,8 @@ gst_gl_mixer_change_state (GstElement * element, GstStateChange transition)
|
|||
while (walk) {
|
||||
GstGLMixerPad *sink_pad = GST_GL_MIXER_PAD (walk->data);
|
||||
walk = g_slist_next (walk);
|
||||
if (sink_pad->display) {
|
||||
g_object_unref (sink_pad->display);
|
||||
sink_pad->display = NULL;
|
||||
}
|
||||
if (sink_pad->display)
|
||||
gst_gl_display_activate_gl_context (sink_pad->display, FALSE);
|
||||
}
|
||||
if (mixer_class->reset)
|
||||
mixer_class->reset (mix);
|
||||
|
@ -1290,6 +1288,15 @@ gst_gl_mixer_change_state (GstElement * element, GstStateChange transition)
|
|||
g_object_unref (mix->display);
|
||||
mix->display = NULL;
|
||||
}
|
||||
while (walk) {
|
||||
GstGLMixerPad *sink_pad = GST_GL_MIXER_PAD (walk->data);
|
||||
walk = g_slist_next (walk);
|
||||
if (sink_pad->display) {
|
||||
gst_gl_display_activate_gl_context (sink_pad->display, TRUE);
|
||||
g_object_unref (sink_pad->display);
|
||||
sink_pad->display = NULL;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue