summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyunjun Ko <zzoon@igalia.com>2016-09-08 16:16:09 +0900
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2016-09-08 17:09:55 +0200
commitde233c137feefba9a993067d3b2b10a8d2fbbcd3 (patch)
treeb5c1b1fff702f236e5db0b418aef819402ca141f
parent574ff693a5eedf79f1e012654b6d08af486972fb (diff)
plugins: set allocator's image size to sinkpad bufferpool
Otherwise the buffer is always ditched by the bufferpool, losing performance. https://bugzilla.gnome.org/show_bug.cgi?id=771035
-rw-r--r--gst/vaapi/gstvaapipluginbase.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c
index 7717ec5d..7849161b 100644
--- a/gst/vaapi/gstvaapipluginbase.c
+++ b/gst/vaapi/gstvaapipluginbase.c
@@ -625,6 +625,7 @@ ensure_sinkpad_buffer_pool (GstVaapiPluginBase * plugin, GstCaps * caps)
{
GstBufferPool *pool;
GstVideoInfo vi;
+ guint size;
/* video decoders don't use a buffer pool in the sink pad */
if (GST_IS_VIDEO_DECODER (plugin))
@@ -648,13 +649,15 @@ ensure_sinkpad_buffer_pool (GstVaapiPluginBase * plugin, GstCaps * caps)
if (!ensure_sinkpad_allocator (plugin, &vi))
goto error_create_allocator;
- pool = gst_vaapi_plugin_base_create_pool (plugin, caps,
- GST_VIDEO_INFO_SIZE (&vi), 0, 0,
+
+ size = GST_VIDEO_INFO_SIZE (&vi);
+ gst_allocator_get_vaapi_image_size (plugin->sinkpad_allocator, &size);
+ pool = gst_vaapi_plugin_base_create_pool (plugin, caps, size, 0, 0,
GST_VAAPI_VIDEO_BUFFER_POOL_OPTION_VIDEO_META, plugin->sinkpad_allocator);
if (!pool)
goto error_create_pool;
plugin->sinkpad_buffer_pool = pool;
- plugin->sinkpad_buffer_size = GST_VIDEO_INFO_SIZE (&vi);
+ plugin->sinkpad_buffer_size = size;
return TRUE;
/* ERRORS */