From bca2b1680bf07a1f7c593eb3aa1b04a354c47e6f Mon Sep 17 00:00:00 2001 From: Hyunjun Ko Date: Tue, 10 Jan 2017 15:15:31 +0900 Subject: [PATCH] plugins: provide at least two buffers in sink pool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds two buffers as the default value of minimum buffer. This would be used when creating and proposing vaapi bufferpool for sink pad, hence the upstream element will keep, at least, these two buffers. https://bugzilla.gnome.org/show_bug.cgi?id=775203 Signed-off-by: Víctor Manuel Jáquez Leal --- gst/vaapi/gstvaapipluginbase.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c index 2aa3b867f2..7e7a4438e4 100644 --- a/gst/vaapi/gstvaapipluginbase.c +++ b/gst/vaapi/gstvaapipluginbase.c @@ -34,6 +34,8 @@ /* Default debug category is from the subclass */ #define GST_CAT_DEFAULT (plugin->debug_category) +#define BUFFER_POOL_SINK_MIN_BUFFERS 2 + /* GstVideoContext interface */ static void plugin_set_display (GstVaapiPluginBase * plugin, GstVaapiDisplay * display) @@ -714,7 +716,9 @@ ensure_sinkpad_buffer_pool (GstVaapiPluginBase * plugin, GstCaps * caps) if (!ensure_sinkpad_allocator (plugin, caps, &size)) return FALSE; - pool = gst_vaapi_plugin_base_create_pool (plugin, caps, size, 0, 0, + pool = + gst_vaapi_plugin_base_create_pool (plugin, caps, size, + BUFFER_POOL_SINK_MIN_BUFFERS, 0, GST_VAAPI_VIDEO_BUFFER_POOL_OPTION_VIDEO_META, plugin->sinkpad_allocator); if (!pool) return FALSE; @@ -789,7 +793,7 @@ gst_vaapi_plugin_base_propose_allocation (GstVaapiPluginBase * plugin, if (!ensure_sinkpad_buffer_pool (plugin, caps)) return FALSE; gst_query_add_allocation_pool (query, plugin->sinkpad_buffer_pool, - plugin->sinkpad_buffer_size, 0, 0); + plugin->sinkpad_buffer_size, BUFFER_POOL_SINK_MIN_BUFFERS, 0); gst_query_add_allocation_param (query, plugin->sinkpad_allocator, NULL); }