Skip to content

Instantly share code, notes, and snippets.

View cyanreg's full-sized avatar

Lynne cyanreg

View GitHub Profile
/* How to use any randomly retrieved VkImages in ffmpeg-related code. */
/* If you don't have a device initialized, but you have a VkDevice,
* you have to import it. */
{
AVBufferRef *ctx_ref = av_hwdevice_ctx_alloc(AV_HWDEVICE_TYPE_VULKAN);
AVHWDeviceContext *ctx = (AVHWDeviceContext *)ctx_ref->data;
AVVulkanDeviceContext *hwctx = ctx->hwctx;
/* Mandatory. */