From bd86647970b17995f1d73c05e048f86fdd31eed5 Mon Sep 17 00:00:00 2001 From: Olivier Crete Date: Fri, 17 Apr 2015 19:10:35 +0000 Subject: [PATCH] vaapipluginbase: The allocation query can return without a pool It is possible to return the min/max/size without actually providing a pool. This way the source knows how many buffers downstream needs. https://bugzilla.gnome.org/show_bug.cgi?id=748076 --- gst/vaapi/gstvaapipluginbase.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c index 37aa390..e8079d0 100644 --- a/gst/vaapi/gstvaapipluginbase.c +++ b/gst/vaapi/gstvaapipluginbase.c @@ -670,13 +670,15 @@ gst_vaapi_plugin_base_decide_allocation (GstVaapiPluginBase * plugin, if (gst_query_get_n_allocation_pools (query) > 0) { gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max); - size = MAX (size, vi.size); - update_pool = TRUE; - - /* Check whether downstream element proposed a bufferpool but did - not provide a correct propose_allocation() implementation */ - has_video_alignment = gst_buffer_pool_has_option (pool, - GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT); + if (pool) { + size = MAX (size, vi.size); + update_pool = TRUE; + + /* Check whether downstream element proposed a bufferpool but did + not provide a correct propose_allocation() implementation */ + has_video_alignment = gst_buffer_pool_has_option (pool, + GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT); + } } else { pool = NULL; size = vi.size; -- 2.7.4