mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 12:32:29 +00:00
plugins: pluginbase: Do not destroy display when _close()
When the element's state changes to NULL, it can still receive queries, such as the image formats. The display is needed in such queries but not well protected for MT safe. For example, ensure_allowed_raw_caps() may still use the display while it is disposed by gst_vaapi_plugin_base_close() because of the state change. We can keep the display until the element is destroyed. When the state changes to NULL, and then changes to PAUSED again, the display can be correctly set(if type changes), or leave untouched. Fix: #260 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/343>
This commit is contained in:
parent
1c5f32b5cd
commit
72c4a161c0
1 changed files with 2 additions and 1 deletions
|
@ -314,6 +314,7 @@ void
|
|||
gst_vaapi_plugin_base_finalize (GstVaapiPluginBase * plugin)
|
||||
{
|
||||
gst_vaapi_plugin_base_close (plugin);
|
||||
gst_vaapi_display_replace (&plugin->display, NULL);
|
||||
g_free (plugin->display_name);
|
||||
|
||||
if (plugin->sinkpriv)
|
||||
|
@ -339,6 +340,7 @@ gst_vaapi_plugin_base_finalize (GstVaapiPluginBase * plugin)
|
|||
gboolean
|
||||
gst_vaapi_plugin_base_open (GstVaapiPluginBase * plugin)
|
||||
{
|
||||
gst_caps_replace (&plugin->allowed_raw_caps, NULL);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -355,7 +357,6 @@ gst_vaapi_plugin_base_close (GstVaapiPluginBase * plugin)
|
|||
/* Release vaapi textures first if exist, which refs display object */
|
||||
plugin_reset_texture_map (plugin);
|
||||
|
||||
gst_vaapi_display_replace (&plugin->display, NULL);
|
||||
gst_object_replace (&plugin->gl_context, NULL);
|
||||
gst_object_replace (&plugin->gl_display, NULL);
|
||||
gst_object_replace (&plugin->gl_other_context, NULL);
|
||||
|
|
Loading…
Reference in a new issue