From d0ee0b4e7216e8694ab3a32830e7eab4071ceca9 Mon Sep 17 00:00:00 2001 From: Hyunjun Ko Date: Fri, 29 Jul 2016 18:06:30 +0900 Subject: [PATCH] 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 --- gst/vaapi/gstvaapipluginbase.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c index ad65297925..c5b8b8558d 100644 --- a/gst/vaapi/gstvaapipluginbase.c +++ b/gst/vaapi/gstvaapipluginbase.c @@ -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)