diff options
Diffstat (limited to 'ext/vulkan/vkutils.c')
-rw-r--r-- | ext/vulkan/vkutils.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/ext/vulkan/vkutils.c b/ext/vulkan/vkutils.c index e83a91e23..c9652be59 100644 --- a/ext/vulkan/vkutils.c +++ b/ext/vulkan/vkutils.c @@ -194,35 +194,38 @@ gst_vulkan_ensure_element_data (gpointer element, /* 1) Check if the element already has a context of the specific * type. */ - if (!*display_ptr) { - _vk_display_context_query (element, display_ptr); + if (!*instance_ptr) { + _vk_gst_context_query (element, GST_VULKAN_INSTANCE_CONTEXT_TYPE_STR); /* Neighbour found and it updated the display */ - if (!*display_ptr) { + if (!*instance_ptr) { GstContext *context; /* If no neighboor, or application not interested, use system default */ - *display_ptr = gst_vulkan_display_new (); + *instance_ptr = gst_vulkan_instance_new (); - context = gst_context_new (GST_VULKAN_DISPLAY_CONTEXT_TYPE_STR, TRUE); - gst_context_set_vulkan_display (context, *display_ptr); + context = gst_context_new (GST_VULKAN_INSTANCE_CONTEXT_TYPE_STR, TRUE); + gst_context_set_vulkan_instance (context, *instance_ptr); _vk_context_propagate (element, context); } } - if (!*instance_ptr) { - _vk_gst_context_query (element, GST_VULKAN_INSTANCE_CONTEXT_TYPE_STR); + if (!*display_ptr) { + _vk_display_context_query (element, display_ptr); /* Neighbour found and it updated the display */ - if (!*instance_ptr) { + if (!*display_ptr) { GstContext *context; + /* instance is required before the display */ + g_return_val_if_fail (*instance_ptr != NULL, FALSE); + /* If no neighboor, or application not interested, use system default */ - *instance_ptr = gst_vulkan_instance_new (); + *display_ptr = gst_vulkan_display_new (*instance_ptr); - context = gst_context_new (GST_VULKAN_INSTANCE_CONTEXT_TYPE_STR, TRUE); - gst_context_set_vulkan_instance (context, *instance_ptr); + context = gst_context_new (GST_VULKAN_DISPLAY_CONTEXT_TYPE_STR, TRUE); + gst_context_set_vulkan_display (context, *display_ptr); _vk_context_propagate (element, context); } |