plugins: re-using buffer pool breaks renegotiation

at propose_allocation() we should not reuse the proposed buffer,
because it could break renegotiation.

https://bugzilla.gnome.org/show_bug.cgi?id=792620
This commit is contained in:
Víctor Manuel Jáquez Leal 2018-01-17 17:30:50 +01:00
parent 9933dcb218
commit 6efce291f6

View file

@ -806,22 +806,30 @@ gst_vaapi_plugin_base_propose_allocation (GstVaapiPluginBase * plugin,
GstCaps *caps = NULL; GstCaps *caps = NULL;
GstBufferPool *pool = NULL; GstBufferPool *pool = NULL;
gboolean need_pool; gboolean need_pool;
guint size = 0;
gst_query_parse_allocation (query, &caps, &need_pool); gst_query_parse_allocation (query, &caps, &need_pool);
if (!caps) if (!caps)
goto error_no_caps; goto error_no_caps;
/* FIXME re-using buffer pool breaks renegotiation */ if (!ensure_sinkpad_allocator (plugin, caps, &size))
if (!ensure_sinkpad_buffer_pool (plugin, caps))
return FALSE; return FALSE;
if (need_pool) { if (need_pool) {
pool = plugin->sinkpad_buffer_pool; 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;
gst_query_add_allocation_param (query, plugin->sinkpad_allocator, NULL); gst_query_add_allocation_param (query, plugin->sinkpad_allocator, NULL);
} }
gst_query_add_allocation_pool (query, pool, plugin->sinkpad_buffer_size, gst_query_add_allocation_pool (query, pool, size,
BUFFER_POOL_SINK_MIN_BUFFERS, 0); BUFFER_POOL_SINK_MIN_BUFFERS, 0);
if (pool)
gst_object_unref (pool);
gst_query_add_allocation_meta (query, GST_VAAPI_VIDEO_META_API_TYPE, NULL); gst_query_add_allocation_meta (query, GST_VAAPI_VIDEO_META_API_TYPE, NULL);
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL); gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL);