mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
vulkan: move instance_open into the utility ensure_element_data
So callers don't have to perform it themselves.
This commit is contained in:
parent
0bcb3cdd29
commit
bfab93dabe
2 changed files with 8 additions and 6 deletions
|
@ -252,12 +252,6 @@ gst_vulkan_sink_change_state (GstElement * element, GstStateChange transition)
|
|||
return GST_STATE_CHANGE_FAILURE;
|
||||
}
|
||||
|
||||
if (!gst_vulkan_instance_open (vk_sink->instance, &error)) {
|
||||
GST_ELEMENT_ERROR (vk_sink, RESOURCE, NOT_FOUND,
|
||||
("Failed to create vulkan instance"), ("%s", error->message));
|
||||
return GST_STATE_CHANGE_FAILURE;
|
||||
}
|
||||
|
||||
if (!(vk_sink->device =
|
||||
gst_vulkan_instance_create_device (vk_sink->instance, &error))) {
|
||||
GST_ELEMENT_ERROR (vk_sink, RESOURCE, NOT_FOUND,
|
||||
|
|
|
@ -195,6 +195,8 @@ gst_vulkan_ensure_element_data (gpointer element,
|
|||
* type.
|
||||
*/
|
||||
if (!*instance_ptr) {
|
||||
GError *error = NULL;
|
||||
|
||||
_vk_gst_context_query (element, GST_VULKAN_INSTANCE_CONTEXT_TYPE_STR);
|
||||
|
||||
/* Neighbour found and it updated the display */
|
||||
|
@ -209,6 +211,12 @@ gst_vulkan_ensure_element_data (gpointer element,
|
|||
|
||||
_vk_context_propagate (element, context);
|
||||
}
|
||||
|
||||
if (!gst_vulkan_instance_open (*instance_ptr, &error)) {
|
||||
GST_ELEMENT_ERROR (element, RESOURCE, NOT_FOUND,
|
||||
("Failed to create vulkan instance"), ("%s", error->message));
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!*display_ptr) {
|
||||
|
|
Loading…
Reference in a new issue