mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 19:42:26 +00:00
vaapivideobufferpool: set correct buffer size
We should set the correct buffer size when we are configuring the pool, otherwise the buffer will be discarded when it returns to the pool. Indeed when the ref-count of a buffer reaches zero, its pool will queue it back (and ref it) if, and only if, the buffer size matches the configured buffer size on the pool. This issue can be debugged with GST_DEBUG=*PERF*:6, see gstbufferpool.c https://bugzilla.gnome.org/show_bug.cgi?id=774782
This commit is contained in:
parent
e265788271
commit
aca43dab47
1 changed files with 7 additions and 1 deletions
|
@ -140,11 +140,13 @@ gst_vaapi_video_buffer_pool_set_config (GstBufferPool * pool,
|
|||
GstVideoAlignment align;
|
||||
GstAllocator *allocator;
|
||||
gboolean ret, updated = FALSE;
|
||||
guint size, min_buffers, max_buffers;
|
||||
|
||||
GST_DEBUG_OBJECT (pool, "config %" GST_PTR_FORMAT, config);
|
||||
|
||||
caps = NULL;
|
||||
if (!gst_buffer_pool_config_get_params (config, &caps, NULL, NULL, NULL))
|
||||
if (!gst_buffer_pool_config_get_params (config, &caps, &size, &min_buffers,
|
||||
&max_buffers))
|
||||
goto error_invalid_config;
|
||||
if (!caps)
|
||||
goto error_no_caps;
|
||||
|
@ -177,6 +179,10 @@ gst_vaapi_video_buffer_pool_set_config (GstBufferPool * pool,
|
|||
goto error_create_allocator_info;
|
||||
priv->alloc_info = *alloc_vip;
|
||||
}
|
||||
if (GST_VIDEO_INFO_SIZE (&priv->alloc_info) != size) {
|
||||
gst_buffer_pool_config_set_params (config, caps,
|
||||
GST_VIDEO_INFO_SIZE (&priv->alloc_info), min_buffers, max_buffers);
|
||||
}
|
||||
}
|
||||
if (!priv->allocator)
|
||||
goto error_no_allocator;
|
||||
|
|
Loading…
Reference in a new issue