vkencoder-private: free err when bailing

And log out the error message from the Vulkan call.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7197>
This commit is contained in:
Víctor Manuel Jáquez Leal 2025-06-09 17:27:24 +02:00
parent 7001d48483
commit 88a302a3c9

View File

@ -1309,13 +1309,18 @@ gst_vulkan_encoder_encode (GstVulkanEncoder * self, GstVideoInfo * info,
priv->vk.CmdEndVideoCoding (cmd_buf->cmd, &end_coding);
if (!gst_vulkan_operation_end (priv->exec, &err)) {
GST_ERROR_OBJECT (self, "The operation did not complete properly");
GST_ERROR_OBJECT (self, "The operation did not complete properly: %s",
err->message);
goto bail;
}
/* Wait the operation to complete or we might have a failing query */
gst_vulkan_operation_wait (priv->exec);
gst_vulkan_operation_get_query (priv->exec, (gpointer *) & encode_res, &err);
if (!gst_vulkan_operation_get_query (priv->exec, (gpointer *) & encode_res,
&err)) {
GST_ERROR_OBJECT (self, "Failed to query the operation: %s", err->message);
goto bail;
}
if (encode_res->status == VK_QUERY_RESULT_STATUS_COMPLETE_KHR) {
GST_INFO_OBJECT (self, "The frame %p has been encoded with size %"
G_GUINT64_FORMAT, pic, encode_res->data_size + pic->offset);
@ -1330,6 +1335,8 @@ gst_vulkan_encoder_encode (GstVulkanEncoder * self, GstVideoInfo * info,
return ret;
bail:
{
if (err)
g_error_free (err);
return FALSE;
}
}