summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2018-02-08 11:33:26 +0100
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2018-02-08 11:33:26 +0100
commitc0826fdc96d9fca6d0e203e8c23c2b400be5c31a (patch)
treeb5bd30b0317da19093a38d622a9d2fde4cb95348
parentb31b773af4ac301dd7a2a120b0152469866cd58a (diff)
plugins: handle vaapi allocator in allocation query
In propose_allocation() if the numer of allocation params is zero, the system's allocator is added first, and lastly the native VA-API allocator. https://bugzilla.gnome.org/show_bug.cgi?id=789476
-rw-r--r--gst/vaapi/gstvaapipluginbase.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c
index 4f43b6c0..738f8b6d 100644
--- a/gst/vaapi/gstvaapipluginbase.c
+++ b/gst/vaapi/gstvaapipluginbase.c
@@ -819,14 +819,28 @@ gst_vaapi_plugin_base_propose_allocation (GstVaapiPluginBase * plugin,
if (!caps)
goto error_no_caps;
+ if (!ensure_sinkpad_buffer_pool (plugin, caps))
+ return FALSE;
+
if (need_pool) {
- if (!ensure_sinkpad_buffer_pool (plugin, caps))
- return FALSE;
gst_query_add_allocation_pool (query, plugin->sinkpad_buffer_pool,
plugin->sinkpad_buffer_size, BUFFER_POOL_SINK_MIN_BUFFERS, 0);
- gst_query_add_allocation_param (query, plugin->sinkpad_allocator, NULL);
}
+ /* Set sinkpad allocator as the last allocation param.
+ *
+ * If there's none, set system's allocator first and VAAPI allocator
+ * second
+ */
+ if (gst_query_get_n_allocation_params (query) == 0) {
+ GstAllocator *allocator;
+
+ allocator = gst_allocator_find (GST_ALLOCATOR_SYSMEM);
+ gst_query_add_allocation_param (query, allocator, NULL);
+ gst_object_unref (allocator);
+ }
+ gst_query_add_allocation_param (query, plugin->sinkpad_allocator, NULL);
+
gst_query_add_allocation_meta (query, GST_VAAPI_VIDEO_META_API_TYPE, NULL);
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL);
return TRUE;