diff --git a/subprojects/gst-plugins-bad/sys/va/gstvapluginutils.c b/subprojects/gst-plugins-bad/sys/va/gstvapluginutils.c index 020d04ce62..41555f8024 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvapluginutils.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvapluginutils.c @@ -73,3 +73,29 @@ gst_va_create_feature_name (GstVaDevice * device, if (*rank > 0) *rank -= 1; } + +GstBufferPool * +gst_va_create_other_pool (GstAllocator * allocator, + GstAllocationParams * params, GstCaps * caps, guint size) +{ + GstBufferPool *pool = NULL; + GstStructure *config; + + if (size == 0) { + GstVideoInfo info; + + if (!gst_video_info_from_caps (&info, caps)) + return NULL; + size = GST_VIDEO_INFO_SIZE (&info); + } + + pool = gst_video_buffer_pool_new (); + config = gst_buffer_pool_get_config (pool); + + gst_buffer_pool_config_set_params (config, caps, size, 0, 0); + gst_buffer_pool_config_set_allocator (config, allocator, params); + if (!gst_buffer_pool_set_config (pool, config)) + gst_clear_object (&pool); + + return pool; +} diff --git a/subprojects/gst-plugins-bad/sys/va/gstvapluginutils.h b/subprojects/gst-plugins-bad/sys/va/gstvapluginutils.h index 58f6ad314c..04e54cfcfc 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvapluginutils.h +++ b/subprojects/gst-plugins-bad/sys/va/gstvapluginutils.h @@ -45,4 +45,9 @@ void gst_va_create_feature_name (GstVaDevice * device, gchar ** desc, guint * rank); +GstBufferPool * gst_va_create_other_pool (GstAllocator * allocator, + GstAllocationParams * params, + GstCaps * caps, + guint size); + G_END_DECLS