[FFmpeg-devel] [PATCH 2/2] libavutil/hwcontect_cuda: add option to use current CUDA context

Anton Khirnov anton at khirnov.net
Thu Sep 14 17:03:18 EEST 2023


Quoting Roman Arzumanyan (2023-09-14 09:26:52)
> Hello,
> 
> This is the second patch of the group which adds the option to use CUDA
> context current to calling thread. It simplifies the usage of ffmpeg
> libraries in applications which rely on CUDA runtime API.
> 
> Example:
> 
> AVDictionary *opts = NULL;
> 
> AVBufferRef *hwDeviceCtx;
> 
> 
> av_dict_set(&opts, "current_ctx", "1", 0);
> 
> av_hwdevice_ctx_create(&hwDeviceCtx, type, NULL, opts, 0);

Use av_hwdevice_ctx_alloc() av_hwdevice_ctx_init() then.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list