vkencoder-private: rename first_encode_cmd to session_reset

Since it reflect better when it's needed to be used: to reset the current
session.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8007>
This commit is contained in:
Víctor Manuel Jáquez Leal 2024-09-19 15:04:09 +02:00 committed by GStreamer Marge Bot
parent 200484a84b
commit d63ec09b5e

View file

@ -51,7 +51,7 @@ struct _GstVulkanEncoderPrivate
GstVulkanEncoderPicture *slots[32]; GstVulkanEncoderPicture *slots[32];
gboolean started; gboolean started;
gboolean first_encode_cmd; gboolean session_reset;
gboolean layered_dpb; gboolean layered_dpb;
GstBufferPool *dpb_pool; GstBufferPool *dpb_pool;
@ -671,7 +671,7 @@ gst_vulkan_encoder_start (GstVulkanEncoder * self,
&priv->vk, &session_create, error)) &priv->vk, &session_create, error))
goto failed; goto failed;
priv->session_reset = TRUE;
priv->started = TRUE; priv->started = TRUE;
return TRUE; return TRUE;
@ -956,11 +956,12 @@ gst_vulkan_encoder_encode (GstVulkanEncoder * self, GstVideoInfo * info,
/* *INDENT-OFF* */ /* *INDENT-OFF* */
coding_ctrl = (VkVideoCodingControlInfoKHR) { coding_ctrl = (VkVideoCodingControlInfoKHR) {
.sType = VK_STRUCTURE_TYPE_VIDEO_CODING_CONTROL_INFO_KHR, .sType = VK_STRUCTURE_TYPE_VIDEO_CODING_CONTROL_INFO_KHR,
.flags = VK_VIDEO_CODING_CONTROL_RESET_BIT_KHR,
}; };
/* *INDENT-ON* */ /* *INDENT-ON* */
/* First run, some information such as rate_control and slot index must be initialized. */ /* some information such as rate_control must be initialized. */
if (!priv->first_encode_cmd) { if (!priv->session_reset) {
/* begin_coding.pNext = &rate_control_info; */ /* begin_coding.pNext = &rate_control_info; */
} }
@ -1027,12 +1028,9 @@ gst_vulkan_encoder_encode (GstVulkanEncoder * self, GstVideoInfo * info,
quality information. This should be done when requesting a new coding contol ie quality information. This should be done when requesting a new coding contol ie
first attempt of encoding. first attempt of encoding.
*/ */
if (!priv->first_encode_cmd) { if (priv->session_reset) {
coding_ctrl.flags = VK_VIDEO_CODING_CONTROL_RESET_BIT_KHR;
coding_ctrl.pNext = NULL;
priv->vk.CmdControlVideoCoding (cmd_buf->cmd, &coding_ctrl); priv->vk.CmdControlVideoCoding (cmd_buf->cmd, &coding_ctrl);
priv->session_reset = FALSE;
priv->first_encode_cmd = TRUE;
} }
/* Peek the output memory to be used by VkVideoEncodeInfoKHR.dstBuffer */ /* Peek the output memory to be used by VkVideoEncodeInfoKHR.dstBuffer */