summaryrefslogtreecommitdiff
path: root/gst/vaapi
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2016-11-21 18:28:18 +0100
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2016-11-24 13:24:08 +0100
commit3fccc8327887133cd85077f58eae49cd6b622108 (patch)
treee187f0a1f25c4eb3ed7a6d4f4cb9ba21860e1401 /gst/vaapi
parent89531263746c1455b71d25d1dc170918320117fe (diff)
plugins: destroy source pad allocator and pool
First, deactivate source pad pool when the out caps change, and if so, destroy texture map, the source pad allocator and pool only if the new caps are different from the ones already set.
Diffstat (limited to 'gst/vaapi')
-rw-r--r--gst/vaapi/gstvaapipluginbase.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c
index be75c17a..2aa3b867 100644
--- a/gst/vaapi/gstvaapipluginbase.c
+++ b/gst/vaapi/gstvaapipluginbase.c
@@ -749,9 +749,15 @@ gst_vaapi_plugin_base_set_caps (GstVaapiPluginBase * plugin, GstCaps * incaps,
if (outcaps && outcaps != plugin->srcpad_caps) {
if (!gst_video_info_from_caps (&plugin->srcpad_info, outcaps))
return FALSE;
- g_clear_object (&plugin->srcpad_allocator);
+ if (plugin->srcpad_buffer_pool
+ && !gst_vaapi_buffer_pool_caps_is_equal (plugin->srcpad_buffer_pool,
+ outcaps)) {
+ gst_buffer_pool_set_active (plugin->srcpad_buffer_pool, FALSE);
+ g_clear_object (&plugin->srcpad_buffer_pool);
+ g_clear_object (&plugin->srcpad_allocator);
+ plugin_reset_texture_map (plugin);
+ }
gst_caps_replace (&plugin->srcpad_caps, outcaps);
- plugin_reset_texture_map (plugin);
}
if (!ensure_sinkpad_buffer_pool (plugin, plugin->sinkpad_caps))