mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-20 14:18:34 +00:00
vaapivideobufferpool: Reuse internal allocator is possible.
Instead of creating a new allocator when upstream requests a different allocator, this patch tries to reuse the internal allocator if it was already initializated. If the stream changes, then either one will be unref and a new allocator is created.
This commit is contained in:
parent
9fa177951e
commit
4778882728
1 changed files with 8 additions and 2 deletions
|
@ -162,8 +162,14 @@ gst_vaapi_video_buffer_pool_set_config (GstBufferPool * pool,
|
|||
if (allocator
|
||||
&& (g_strcmp0 (allocator->mem_type, GST_VAAPI_VIDEO_MEMORY_NAME) != 0
|
||||
&& g_strcmp0 (allocator->mem_type,
|
||||
GST_VAAPI_DMABUF_ALLOCATOR_NAME) != 0))
|
||||
GST_VAAPI_DMABUF_ALLOCATOR_NAME) != 0)) {
|
||||
/* if pool has already an allocator, try it and ignore the one in
|
||||
* configuration */
|
||||
if (priv->allocator)
|
||||
allocator = priv->allocator;
|
||||
else
|
||||
allocator = NULL;
|
||||
}
|
||||
|
||||
/* get the allocator properties */
|
||||
if (allocator) {
|
||||
|
|
Loading…
Reference in a new issue