From 8b916da6d783d002281c8f8cf9dff6e254e5170c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 8 Aug 2012 12:19:31 +0200 Subject: [PATCH] videofilter: Really add a buffer pool if none was provided And also use the allocation parameters from the query if any and if there are none set our own (16-byte alignment) on the query. --- gst-libs/gst/video/gstvideofilter.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/gst-libs/gst/video/gstvideofilter.c b/gst-libs/gst/video/gstvideofilter.c index c21358c778..a29a58b194 100644 --- a/gst-libs/gst/video/gstvideofilter.c +++ b/gst-libs/gst/video/gstvideofilter.c @@ -79,15 +79,24 @@ gst_video_filter_propose_allocation (GstBaseTransform * trans, size = GST_VIDEO_INFO_SIZE (&info); - if (gst_query_get_n_allocation_pools (query) < 0) { + if (gst_query_get_n_allocation_pools (query) == 0) { GstStructure *structure; - static GstAllocationParams params = { 0, 0, 0, 15, }; + GstAllocator *allocator = NULL; + GstAllocationParams params = { 0, 0, 0, 15, }; + + if (gst_query_get_n_allocation_params (query) > 0) + gst_query_parse_nth_allocation_param (query, 0, &allocator, ¶ms); + else + gst_query_add_allocation_param (query, allocator, ¶ms); pool = gst_video_buffer_pool_new (); structure = gst_buffer_pool_get_config (pool); gst_buffer_pool_config_set_params (structure, caps, size, 0, 0); - gst_buffer_pool_config_set_allocator (structure, NULL, ¶ms); + gst_buffer_pool_config_set_allocator (structure, allocator, ¶ms); + + if (allocator) + gst_object_unref (allocator); if (!gst_buffer_pool_set_config (pool, structure)) goto config_failed;