mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
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
This commit is contained in:
parent
574ff693a5
commit
de233c137f
1 changed files with 6 additions and 3 deletions
|
@ -625,6 +625,7 @@ ensure_sinkpad_buffer_pool (GstVaapiPluginBase * plugin, GstCaps * caps)
|
||||||
{
|
{
|
||||||
GstBufferPool *pool;
|
GstBufferPool *pool;
|
||||||
GstVideoInfo vi;
|
GstVideoInfo vi;
|
||||||
|
guint size;
|
||||||
|
|
||||||
/* video decoders don't use a buffer pool in the sink pad */
|
/* video decoders don't use a buffer pool in the sink pad */
|
||||||
if (GST_IS_VIDEO_DECODER (plugin))
|
if (GST_IS_VIDEO_DECODER (plugin))
|
||||||
|
@ -648,13 +649,15 @@ ensure_sinkpad_buffer_pool (GstVaapiPluginBase * plugin, GstCaps * caps)
|
||||||
|
|
||||||
if (!ensure_sinkpad_allocator (plugin, &vi))
|
if (!ensure_sinkpad_allocator (plugin, &vi))
|
||||||
goto error_create_allocator;
|
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);
|
GST_VAAPI_VIDEO_BUFFER_POOL_OPTION_VIDEO_META, plugin->sinkpad_allocator);
|
||||||
if (!pool)
|
if (!pool)
|
||||||
goto error_create_pool;
|
goto error_create_pool;
|
||||||
plugin->sinkpad_buffer_pool = pool;
|
plugin->sinkpad_buffer_pool = pool;
|
||||||
plugin->sinkpad_buffer_size = GST_VIDEO_INFO_SIZE (&vi);
|
plugin->sinkpad_buffer_size = size;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
|
|
Loading…
Reference in a new issue