mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 04:56:24 +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;
|
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 =
|
if (!(vk_sink->device =
|
||||||
gst_vulkan_instance_create_device (vk_sink->instance, &error))) {
|
gst_vulkan_instance_create_device (vk_sink->instance, &error))) {
|
||||||
GST_ELEMENT_ERROR (vk_sink, RESOURCE, NOT_FOUND,
|
GST_ELEMENT_ERROR (vk_sink, RESOURCE, NOT_FOUND,
|
||||||
|
|
|
@ -195,6 +195,8 @@ gst_vulkan_ensure_element_data (gpointer element,
|
||||||
* type.
|
* type.
|
||||||
*/
|
*/
|
||||||
if (!*instance_ptr) {
|
if (!*instance_ptr) {
|
||||||
|
GError *error = NULL;
|
||||||
|
|
||||||
_vk_gst_context_query (element, GST_VULKAN_INSTANCE_CONTEXT_TYPE_STR);
|
_vk_gst_context_query (element, GST_VULKAN_INSTANCE_CONTEXT_TYPE_STR);
|
||||||
|
|
||||||
/* Neighbour found and it updated the display */
|
/* Neighbour found and it updated the display */
|
||||||
|
@ -209,6 +211,12 @@ gst_vulkan_ensure_element_data (gpointer element,
|
||||||
|
|
||||||
_vk_context_propagate (element, context);
|
_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) {
|
if (!*display_ptr) {
|
||||||
|
|
Loading…
Reference in a new issue