]> git.sesse.net Git - ffmpeg/commitdiff
hwcontext_vulkan: initialize the frames context when deriving
authorLynne <dev@lynne.ee>
Mon, 25 May 2020 19:56:00 +0000 (20:56 +0100)
committerLynne <dev@lynne.ee>
Tue, 26 May 2020 09:52:10 +0000 (10:52 +0100)
Otherwise, the frames context is considered to be ready to handle
mapping, and it doesn't get initialized the normal way through
.frames_init.

libavutil/hwcontext_vulkan.c

index 5976e33f0344ede84626cf8f0bf3a5d067880f9a..7383af2083b3faf8c0fa04b659e1388af235e73f 100644 (file)
@@ -3251,6 +3251,12 @@ static int vulkan_transfer_data_from(AVHWFramesContext *hwfc, AVFrame *dst,
     }
 }
 
+static int vulkan_frames_derive_to(AVHWFramesContext *dst_fc,
+                                   AVHWFramesContext *src_fc, int flags)
+{
+    return vulkan_frames_init(dst_fc);
+}
+
 AVVkFrame *av_vk_frame_alloc(void)
 {
     return av_mallocz(sizeof(AVVkFrame));
@@ -3280,6 +3286,7 @@ const HWContextType ff_hwcontext_type_vulkan = {
 
     .map_to                 = vulkan_map_to,
     .map_from               = vulkan_map_from,
+    .frames_derive_to       = &vulkan_frames_derive_to,
 
     .pix_fmts = (const enum AVPixelFormat []) {
         AV_PIX_FMT_VULKAN,