vaapipluginbase: The allocation query can return without a pool
authorOlivier Crete <olivier.crete@collabora.com>
Fri, 17 Apr 2015 19:10:35 +0000 (19:10 +0000)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Sun, 19 Apr 2015 07:25:56 +0000 (09:25 +0200)
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

index 37aa390..e8079d0 100644 (file)
@@ -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;