You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
hwcontext_vulkan: wait for semaphores when unmapping from VAAPI
We don't really want to do a full all-queue blocking wait here, since this happens once per frame, and this could delay future frames.
This commit is contained in:
@@ -2218,6 +2218,16 @@ static void vulkan_unmap_from(AVHWFramesContext *hwfc, HWMapDescriptor *hwmap)
|
|||||||
VulkanDevicePriv *p = hwfc->device_ctx->internal->priv;
|
VulkanDevicePriv *p = hwfc->device_ctx->internal->priv;
|
||||||
FFVulkanFunctions *vk = &p->vkfn;
|
FFVulkanFunctions *vk = &p->vkfn;
|
||||||
|
|
||||||
|
VkSemaphoreWaitInfo wait_info = {
|
||||||
|
.sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO,
|
||||||
|
.flags = 0x0,
|
||||||
|
.pSemaphores = map->frame->sem,
|
||||||
|
.pValues = map->frame->sem_value,
|
||||||
|
.semaphoreCount = planes,
|
||||||
|
};
|
||||||
|
|
||||||
|
vk->WaitSemaphores(hwctx->act_dev, &wait_info, UINT64_MAX);
|
||||||
|
|
||||||
for (int i = 0; i < planes; i++) {
|
for (int i = 0; i < planes; i++) {
|
||||||
vk->DestroyImage(hwctx->act_dev, map->frame->img[i], hwctx->alloc);
|
vk->DestroyImage(hwctx->act_dev, map->frame->img[i], hwctx->alloc);
|
||||||
vk->FreeMemory(hwctx->act_dev, map->frame->mem[i], hwctx->alloc);
|
vk->FreeMemory(hwctx->act_dev, map->frame->mem[i], hwctx->alloc);
|
||||||
|
Reference in New Issue
Block a user