diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-09-14 22:30:29 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-09-15 02:38:05 +0200 |
commit | 677635cd04cb0f9c5a9319c1f6109959438eafe0 (patch) | |
tree | 084cc72ad446d1d4420f862a082535522083ea9a /libavutil/hwcontext_vulkan.c | |
parent | 47b1c0d0db67273e802c369bd9d061ebcad4b971 (diff) | |
download | ffmpeg-677635cd04cb0f9c5a9319c1f6109959438eafe0.tar.gz |
avutil/hwcontext_vulkan: Deduplicate code
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavutil/hwcontext_vulkan.c')
-rw-r--r-- | libavutil/hwcontext_vulkan.c | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index d1c2d69b7b..0c846fde38 100644 --- a/libavutil/hwcontext_vulkan.c +++ b/libavutil/hwcontext_vulkan.c @@ -2407,31 +2407,7 @@ static int vulkan_transfer_get_formats(AVHWFramesContext *hwfc, #if CONFIG_LIBDRM static void vulkan_unmap_from_drm(AVHWFramesContext *hwfc, HWMapDescriptor *hwmap) { - AVVkFrame *f = hwmap->priv; - AVVulkanDeviceContext *hwctx = hwfc->device_ctx->hwctx; - VulkanDevicePriv *p = hwfc->device_ctx->internal->priv; - FFVulkanFunctions *vk = &p->vkctx.vkfn; - const int nb_images = ff_vk_count_images(f); - - VkSemaphoreWaitInfo wait_info = { - .sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO, - .flags = 0x0, - .pSemaphores = f->sem, - .pValues = f->sem_value, - .semaphoreCount = nb_images, - }; - - vk->WaitSemaphores(hwctx->act_dev, &wait_info, UINT64_MAX); - - vulkan_free_internal(f); - - for (int i = 0; i < nb_images; i++) { - vk->DestroyImage(hwctx->act_dev, f->img[i], hwctx->alloc); - vk->FreeMemory(hwctx->act_dev, f->mem[i], hwctx->alloc); - vk->DestroySemaphore(hwctx->act_dev, f->sem[i], hwctx->alloc); - } - - av_free(f); + vulkan_frame_free(hwfc, hwmap->priv); } static const struct { |