plugins: update buffer pool size with new allocator's image size

Depends on media, video size is sometimes updated with new allocator.
It leads to dismatch between bufferpool's set size and real allocated buffer size.

In this case, it causes every buffer is freed during release in bufferpool,
which should be reused. This affects performance.

https://bugzilla.gnome.org/show_bug.cgi?id=769248
This commit is contained in:
Hyunjun Ko 2016-07-29 18:06:30 +09:00 committed by Víctor Manuel Jáquez Leal
parent ad3ae71032
commit d0ee0b4e72

View file

@ -832,6 +832,10 @@ gst_vaapi_plugin_base_decide_allocation (GstVaapiPluginBase * plugin,
if (!pool) {
if (!ensure_srcpad_allocator (plugin, &vi))
goto error_create_allocator;
/* Update video size with allocator's image size */
size = GST_VIDEO_INFO_SIZE (&GST_VAAPI_VIDEO_ALLOCATOR_CAST
(plugin->srcpad_allocator)->image_info);
pool = gst_vaapi_plugin_base_create_pool (plugin, caps, size, min, max,
pool_options, plugin->srcpad_allocator);
if (!pool)