vkencoder-private: shuffle up get format to bail out better

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7993>
This commit is contained in:
Víctor Manuel Jáquez Leal 2024-09-17 13:44:53 +02:00 committed by GStreamer Marge Bot
parent 98d30cc30a
commit 83cd24a30d

View file

@ -694,6 +694,13 @@ gst_vulkan_encoder_start (GstVulkanEncoder * self,
}
GST_OBJECT_UNLOCK (self);
/* Get output format */
pic_format = gst_vulkan_video_encoder_get_format (self,
VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR |
VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR, error);
if (pic_format == VK_FORMAT_UNDEFINED)
return FALSE;
priv->profile_caps = gst_vulkan_video_profile_to_caps (&priv->profile);
GST_LOG_OBJECT (self, "Capabilities for %" GST_PTR_FORMAT ":\n"
@ -717,14 +724,6 @@ gst_vulkan_encoder_start (GstVulkanEncoder * self,
priv->caps.caps.pNext = NULL;
/* Get output format */
pic_format =
gst_vulkan_video_encoder_get_format (self,
VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR |
VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR, error);
if (pic_format == VK_FORMAT_UNDEFINED)
goto failed;
/* *INDENT-OFF* */
session_create = (VkVideoSessionCreateInfoKHR) {
.sType = VK_STRUCTURE_TYPE_VIDEO_SESSION_CREATE_INFO_KHR,