mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-30 19:32:13 +00:00
hwcontext_vulkan: host wait on semaphores before freeing frame
This commit is contained in:
parent
f7f1613638
commit
bde1fc5386
@ -112,6 +112,7 @@ enum VulkanExtensions {
|
||||
/* Semaphores */ \
|
||||
MACRO(1, 1, EXT_EXTERNAL_FD_SEM, GetSemaphoreFdKHR) \
|
||||
MACRO(1, 1, EXT_NO_FLAG, CreateSemaphore) \
|
||||
MACRO(1, 1, EXT_NO_FLAG, WaitSemaphores) \
|
||||
MACRO(1, 1, EXT_NO_FLAG, DestroySemaphore) \
|
||||
\
|
||||
/* Memory */ \
|
||||
@ -1737,6 +1738,16 @@ static void vulkan_frame_free(void *opaque, uint8_t *data)
|
||||
VulkanFunctions *vk = &p->vkfn;
|
||||
int planes = av_pix_fmt_count_planes(hwfc->sw_format);
|
||||
|
||||
VkSemaphoreWaitInfo wait_info = {
|
||||
.sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO,
|
||||
.flags = 0x0,
|
||||
.pSemaphores = f->sem,
|
||||
.pValues = f->sem_value,
|
||||
.semaphoreCount = planes,
|
||||
};
|
||||
|
||||
vk->WaitSemaphores(hwctx->act_dev, &wait_info, UINT64_MAX);
|
||||
|
||||
vulkan_free_internal(f->internal);
|
||||
|
||||
for (int i = 0; i < planes; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user