summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyunjun Ko <zzoon@igalia.com>2017-01-10 15:15:31 +0900
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2017-01-10 13:42:34 +0100
commitbca2b1680bf07a1f7c593eb3aa1b04a354c47e6f (patch)
tree08248061159f32d3f8e289b6e3e1aa204478ab95
parent58e7b575bbcaac8a9b1d442087ccf0dcb34313d5 (diff)
plugins: provide at least two buffers in sink pool
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 <victorx.jaquez@intel.com>
-rw-r--r--gst/vaapi/gstvaapipluginbase.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c
index 2aa3b867..7e7a4438 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);
}