mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
plugins: reset textures at negotiation/shutdown
When caps reconfiguration is called, the new downstream frame size might be different. Thus, if the downstream caps change,the display's texture map is reset. In addition, during pipeline shutdown, textures in texture map have to be released, since each one have a reference to the GstVaapiDisplay object, which is a dangerous circular reference. https://bugzilla.gnome.org/show_bug.cgi?id=769293 Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
This commit is contained in:
parent
a80e10ac5c
commit
5a4540e654
1 changed files with 11 additions and 0 deletions
|
@ -206,6 +206,13 @@ error_create_proxy:
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
plugin_reset_texture_map (GstVaapiPluginBase * plugin)
|
||||
{
|
||||
if (plugin->display)
|
||||
gst_vaapi_display_reset_texture_map (plugin->display);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_vaapi_plugin_base_find_gl_context (GstVaapiPluginBase * plugin)
|
||||
{
|
||||
|
@ -278,6 +285,9 @@ gst_vaapi_plugin_base_open (GstVaapiPluginBase * plugin)
|
|||
void
|
||||
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);
|
||||
|
||||
|
@ -704,6 +714,7 @@ gst_vaapi_plugin_base_set_caps (GstVaapiPluginBase * plugin, GstCaps * incaps,
|
|||
if (outcaps && outcaps != plugin->srcpad_caps) {
|
||||
g_clear_object (&plugin->srcpad_allocator);
|
||||
gst_caps_replace (&plugin->srcpad_caps, outcaps);
|
||||
plugin_reset_texture_map (plugin);
|
||||
if (!gst_video_info_from_caps (&plugin->srcpad_info, outcaps))
|
||||
return FALSE;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue