vkdecoder-private: manage existing dpb pool

When the decoder wants to recreate the dpb pool
on resize event for example, an existing dpb pool
might exist, so it should be kept if the caps
are equal or destroy for new caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9614>
This commit is contained in:
Stéphane Cerveau 2025-05-28 16:12:07 +02:00 committed by Víctor Manuel Jáquez Leal
parent c086c83ac4
commit 0b26bebe35

View File

@ -585,6 +585,23 @@ gst_vulkan_decoder_create_dpb_pool (GstVulkanDecoder * self, GstCaps * caps)
max_buffers = 0;
}
if (priv->dpb_pool) {
GstCaps *old_caps = NULL;
gboolean keep_pool = FALSE;
config = gst_buffer_pool_get_config (priv->dpb_pool);
gst_buffer_pool_config_get_params (config, &old_caps, NULL, NULL, NULL);
keep_pool = gst_caps_is_strictly_equal (caps, old_caps);
gst_structure_free (config);
if (keep_pool) {
GST_INFO_OBJECT (self, "Reusing existing DPB pool");
return TRUE;
}
gst_clear_object (&priv->dpb_pool);
}
priv->dpb_pool = gst_vulkan_image_buffer_pool_new (self->queue->device);
config = gst_buffer_pool_get_config (priv->dpb_pool);