va: pool: Add gst_va_pool_new_with_config().

It is a function helper.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2442>
This commit is contained in:
Víctor Manuel Jáquez Leal 2021-07-27 13:03:37 +02:00
parent 1f6fd7550c
commit 2added54c3
2 changed files with 32 additions and 0 deletions

View file

@ -343,3 +343,26 @@ gst_va_pool_requires_video_meta (GstBufferPool * pool)
{
return GST_VA_POOL (pool)->force_videometa;
}
GstBufferPool *
gst_va_pool_new_with_config (GstCaps * caps, guint size, guint min_buffers,
guint max_buffers, guint usage_hint, GstAllocator * allocator,
GstAllocationParams * alloc_params)
{
GstBufferPool *pool;
GstStructure *config;
pool = gst_va_pool_new ();
config = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set_params (config, caps, size, min_buffers,
max_buffers);
gst_buffer_pool_config_set_va_allocation_params (config, usage_hint);
gst_buffer_pool_config_set_allocator (config, allocator, alloc_params);
gst_buffer_pool_config_add_option (config, GST_BUFFER_POOL_OPTION_VIDEO_META);
if (!gst_buffer_pool_set_config (pool, config))
gst_clear_object (&pool);
return pool;
}

View file

@ -31,4 +31,13 @@ GstBufferPool * gst_va_pool_new (void);
gboolean gst_va_pool_requires_video_meta (GstBufferPool * pool);
void gst_buffer_pool_config_set_va_allocation_params (GstStructure * config,
guint usage_hint);
GstBufferPool * gst_va_pool_new_with_config (GstCaps * caps,
guint size,
guint min_buffers,
guint max_buffers,
guint usage_hint,
GstAllocator * allocator,
GstAllocationParams * alloc_params);
G_END_DECLS