Otherwise, the frames context is considered to be ready to handle mapping, and it doesn't get initialized the normal way through .frames_init.
Unified · Split
| @@ -3251,6 +3251,12 @@ static int vulkan_transfer_data_from(AVHWFramesContext *hwfc, AVFrame *dst, · 3250 unmodified lines | ||
| 3251 | 3251 | } |
| 3252 | 3252 | } |
| 3253 | 3253 | |
| 3254 | +static int vulkan_frames_derive_to(AVHWFramesContext *dst_fc, | |
| 3255 | + AVHWFramesContext *src_fc, int flags) | |
| 3256 | +{ | |
| 3257 | + return vulkan_frames_init(dst_fc); | |
| 3258 | +} | |
| 3259 | + | |
| 3254 | 3260 | AVVkFrame *av_vk_frame_alloc(void) |
| 3255 | 3261 | { |
| 3256 | 3262 | return av_mallocz(sizeof(AVVkFrame)); |
| @@ -3280,6 +3286,7 @@ const HWContextType ff_hwcontext_type_vulkan = { · 23 unmodified lines | ||
| 3280 | 3286 | |
| 3281 | 3287 | .map_to = vulkan_map_to, |
| 3282 | 3288 | .map_from = vulkan_map_from, |
| 3289 | + .frames_derive_to = &vulkan_frames_derive_to, | |
| 3283 | 3290 | |
| 3284 | 3291 | .pix_fmts = (const enum AVPixelFormat []) { |
| 3285 | 3292 | AV_PIX_FMT_VULKAN, |