vkencoder-private: shuffle down VkVideoBeginCodingInfoKHR initialization
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Thu, 19 Sep 2024 10:47:17 +0000 (12:47 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 4 Dec 2024 02:17:45 +0000 (02:17 +0000)
to make it more cohesive

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8007>

subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkencoder-private.c

index c125cb65c085737653cd44c6743e1bf75527ccb9..6d59188e303301f343fb5e6a03097494f8d10658 100644 (file)
@@ -953,14 +953,7 @@ gst_vulkan_encoder_encode (GstVulkanEncoder * self, GstVideoInfo * info,
   if (!gst_vulkan_operation_begin (priv->exec, &err))
     goto bail;
 
-  /* Prepare the encoding scope by flling the VkVideoBeginCodingInfoKHR structure */
   /* *INDENT-OFF* */
-  begin_coding = (VkVideoBeginCodingInfoKHR) {
-    .sType = VK_STRUCTURE_TYPE_VIDEO_BEGIN_CODING_INFO_KHR,
-    .pNext = NULL,
-    .videoSession = priv->session.session->handle,
-    .videoSessionParameters = priv->session_params->handle,
-  };
   coding_ctrl = (VkVideoCodingControlInfoKHR) {
     .sType = VK_STRUCTURE_TYPE_VIDEO_CODING_CONTROL_INFO_KHR,
   };
@@ -1015,8 +1008,16 @@ gst_vulkan_encoder_encode (GstVulkanEncoder * self, GstVideoInfo * info,
   ref_slots[nb_refs].slotIndex = -1;
 
   /* Setup the begin coding structure using the reference slots */
-  begin_coding.referenceSlotCount = nb_refs + 1;
-  begin_coding.pReferenceSlots = ref_slots;
+  /* *INDENT-OFF* */
+  begin_coding = (VkVideoBeginCodingInfoKHR) {
+    .sType = VK_STRUCTURE_TYPE_VIDEO_BEGIN_CODING_INFO_KHR,
+    .pNext = NULL,
+    .videoSession = priv->session.session->handle,
+    .videoSessionParameters = priv->session_params->handle,
+    .referenceSlotCount = nb_refs + 1,
+    .pReferenceSlots = ref_slots,
+  };
+  /* *INDENT-ON* */
 
   cmd_buf = priv->exec->cmd_buf;
   priv->vk.CmdBeginVideoCoding (cmd_buf->cmd, &begin_coding);