1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

hwcontext_vulkan: do not dup() semaphore FDs for CUDA

This commit is contained in:
Lynne 2021-11-13 00:14:10 +01:00
parent fa28c1b2f9
commit 015b487777
No known key found for this signature in database
GPG Key ID: A2FEA5F03F034464

View File

@ -123,7 +123,6 @@ typedef struct AVVkFrameInternal {
CUmipmappedArray cu_mma[AV_NUM_DATA_POINTERS];
CUarray cu_array[AV_NUM_DATA_POINTERS];
CUexternalSemaphore cu_sem[AV_NUM_DATA_POINTERS];
int exp_sem[AV_NUM_DATA_POINTERS];
#endif
} AVVkFrameInternal;
@ -1572,7 +1571,6 @@ static void vulkan_free_internal(AVVkFrameInternal *internal)
CHECK_CU(cu->cuMipmappedArrayDestroy(internal->cu_mma[i]));
if (internal->ext_mem[i])
CHECK_CU(cu->cuDestroyExternalMemory(internal->ext_mem[i]));
close(internal->exp_sem[i]);
}
av_buffer_unref(&internal->cuda_fc_ref);
@ -2698,7 +2696,7 @@ static int vulkan_export_to_cuda(AVHWFramesContext *hwfc,
}
ret = vk->GetSemaphoreFdKHR(hwctx->act_dev, &sem_export,
&dst_int->exp_sem[i]);
&ext_sem_desc.handle.fd);
if (ret != VK_SUCCESS) {
av_log(ctx, AV_LOG_ERROR, "Failed to export semaphore: %s\n",
vk_ret2str(ret));
@ -2706,8 +2704,6 @@ static int vulkan_export_to_cuda(AVHWFramesContext *hwfc,
goto fail;
}
ext_sem_desc.handle.fd = dup(dst_int->exp_sem[i]);
ret = CHECK_CU(cu->cuImportExternalSemaphore(&dst_int->cu_sem[i],
&ext_sem_desc));
if (ret < 0) {